GATE Computer ScienceVery hardGATE CSE · NIELIT

Let L = { w ∈ {a,b}* : w contains the substring "aba" and |w| is even }. How many states does the minimal DFA for L have?

  1. A. 7
  2. B. 9
  3. C. 6
  4. D. 8

Correct answer: D. 8

Myhill–Nerode classes: before "aba" appears the DFA tracks the matching progress (3 states) × length parity (2), and after it appears only parity matters (2): 8 states.

More Compiler Design questions

Exams that ask this topic