GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Let L = { w ∈ {a, b}* : the 3rd symbol from the right is a } (minimal DFA: 8 states) and Lᴿ its reversal (the 3rd symbol from the LEFT is a). How many states does the minimal complete DFA for L ∪ Lᴿ have?

  1. A. 13
  2. B. 16
  3. C. 40
  4. D. 12

Correct answer: B. 16

Once the 3rd symbol from the left is a, every extension is accepted (sink). Otherwise the DFA must, while reading the first three symbols, also keep the window needed for L: prefixes of length 0–2 (1 + 2 + 4 = 7 classes, some merging) lead into the 8 window states of L, with the accept sink added. Minimisation gives 16 states.

More Theory of Computation questions

Exams that ask this topic