GATE Computer ScienceVery hardGATE CSE

The pumping lemma for regular languages states that some length p exists 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 valid p for L = { w ∈ {a, b}* : w contains aab as a substring }?

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

Correct answer: C. 4

A DFA for L has 4 states, so p = 4 works; p = 3 fails for the word aab itself (every non-empty y inside the first 3 symbols breaks the substring when removed or repeated). Hence 4.

More Theory of Computation questions

Exams that ask this topic