GATE Computer ScienceHardGATE CS (PYQ pattern)

For the regular language L(r) with r = aaa* + bbbb* (that is, a's of length ≥ 2 or b's of length ≥ 3), 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. 4
  2. B. 3
  3. C. 2
  4. D. 5

Correct answer: A. 4

p = 3 fails: w = bbb has |w| ≥ 3 but every choice of y removes a b when pumped down, leaving bb or b ∉ L. p = 4 works: an a-string of length ≥ 4 pumps with x = a, y = a (pumping down still leaves ≥ 3 a's), and a b-string of length ≥ 4 pumps with x = ε, y = b (pumping down leaves ≥ 3 b's). Hence 4.

More Theory of Computation questions

Exams that ask this topic