GATE Computer ScienceHardGATE CSE · UGC NET

Let L = { w ∈ {a,b}* : the 4th symbol from the right end of w is 'a' }. The minimal DFA for L has how many states (including any dead/trap state)?

  1. A. 8
  2. B. 16
  3. C. 15
  4. D. 32

Correct answer: B. 16

The DFA must remember the last 4 symbols; all 2^4 = 16 histories are pairwise distinguishable (verified by Myhill–Nerode enumeration), and no dead state exists.

More Compiler Design questions

Exams that ask this topic