GATE Computer ScienceVery hardGATE CS (PYQ pattern)

L = { w ∈ {a, b}* : the 4th symbol from the right is a, OR the 2nd symbol from the right is b }. How many ACCEPTING states does the minimal complete DFA for L have?

  1. A. 6
  2. B. 4
  3. C. 8
  4. D. 12

Correct answer: A. 6

The minimal DFA has 12 states (ε, a, b, aa, ab, ba, bb, aaa, aba, aaaa, aaab, abaa as representatives). A class accepts iff its representative is in L: ba, bb (2nd from right b), aba (2nd from right b) and aaaa, aaab, abaa (4th from right a). So 6 accepting states.

More Theory of Computation questions

Exams that ask this topic