GATE Computer ScienceHardGATE CS (PYQ pattern)

For the regular language L(r) with r = (aab + abb)*, the pumping lemma asks for a length p such that every w ∈ L with |w| ≥ p can be split w = xyz with |xy| ≤ p, |y| ≥ 1 and xyⁱz ∈ L for all i ≥ 0. What is the smallest such p?

  1. A. 6
  2. B. 3
  3. C. 2
  4. D. 4

Correct answer: B. 3

p = 2 fails on w = aab: y must lie within the first two symbols, and removing a, aa or the second a leaves ab, b or ab — none of length divisible by 3. p = 3 works: every non-empty member starts with a complete block of length 3, so take x = ε and y = that block; pumping it keeps a concatenation of blocks.

More Theory of Computation questions

Exams that ask this topic