GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Let L = { w ∈ {a, b}* : |w| ≥ 3 and the 3rd symbol from the right end equals the last symbol }. How many states does the minimal complete DFA for L have?

  1. A. 8
  2. B. 9
  3. C. 16
  4. D. 11

Correct answer: D. 11

For |w| ≥ 3 the future depends on the last two symbols (2 × 2 = 4) and acceptance now depends on whether the 3rd-from-right equals the last: 4 × 2 = 8 classes. A length-2 string yz behaves like the non-accepting class with the same last two symbols, so it merges. Add ε, a and b (3 distinct short-string classes): 8 + 3 = 11.

More Theory of Computation questions

Exams that ask this topic