GATE Computer ScienceVery hardGATE CSE

Over {a, b}, L = { w : w contains aab as a substring and |w| is odd }. What is the number of states in the minimal complete DFA for L?

  1. A. 8
  2. B. 7
  3. C. 9
  4. D. 11

Correct answer: A. 8

Before aab is seen the DFA needs the matching progress (0, 1 or 2 symbols of aab matched) and the parity of the length; after aab only parity matters. Minimising the product gives 8 states.

More Theory of Computation questions

Exams that ask this topic