GATE Computer ScienceVery hardGATE CS (PYQ pattern)

L = { w ∈ {a, b}* : any two a's in w are separated by at least two b's, and w ends with b }. How many states does the minimal complete DFA for L have?

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

Correct answer: B. 5

Adding 'ends with b' to the 4-state separation DFA splits the 'free' state into an accepting version (last symbol b) and a non-accepting start version, giving 5.

More Theory of Computation questions

Exams that ask this topic