GATE Computer ScienceHardGATE CS (PYQ pattern)

For the regular language L(r) with r = aaaa + a*b, 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. 8
  2. B. 9
  3. C. 6
  4. D. 5

Correct answer: D. 5

The minimal complete DFA has 8 states, so p = 8 always works, but the smallest valid p can be smaller: here a brute-force check over all strings gives 5. (A p is valid iff every sufficiently long member has a pumpable loop in its first p symbols.)

More Theory of Computation questions

Exams that ask this topic