GATE Computer ScienceVery hardGATE CS (PYQ pattern)

L = { w ∈ {a, b}* : the 5th symbol from the right is a AND the 3rd symbol from the right is b } (so |w| ≥ 5). How many states does the minimal complete DFA for L have?

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

Correct answer: C. 15

Only windows consistent with the pattern a?b?? need to be told apart. Track the longest suffix that can still lead to a match: the Myhill–Nerode classes are ε, a, aa, ab, aab, abb, aaba, aabb, abbb and the six accepting windows aabaa, aabab, aabba, aabbb, abbba, abbbb — 15 states (32 would track all 5-windows; 20 is the OR version).

More Theory of Computation questions

Exams that ask this topic