GATE Computer ScienceVery hardGATE CS (PYQ pattern)

How many states does the minimal complete DFA have for the set of ODD-length strings over {a, b} that contain neither aba nor bab as a substring?

  1. A. 6
  2. B. 12
  3. C. 7
  4. D. 10

Correct answer: D. 10

The avoidance part must know the last symbol and whether the last two differ; combined with length parity, the Myhill–Nerode classes have representatives ε, a, b, aa, ab, ba, bb, aab, bba and a dead class (e.g. aba). Accepting: a, b, aab, bba. 10 states — not 6 (parity ignored) nor 12 (a blind product).

More Theory of Computation questions

Exams that ask this topic