GATE Computer ScienceHardGATE CS (PYQ pattern)

Let L = { w ∈ {a, b}* : |w| ≥ 5 and the 5th symbol from the LEFT equals the 1st symbol }. How many states does the minimal complete DFA for L have?

  1. A. 7
  2. B. 32
  3. C. 11
  4. D. 10

Correct answer: C. 11

Remember the first symbol and count positions 2–4: ε, then for each first symbol a separate chain of length-1…4 states (2 × 4 = 8), then an accept sink and a reject sink (once the 5th symbol is read, the answer is fixed). 1 + 8 + 2 = 11.

More Theory of Computation questions

Exams that ask this topic