GATE Computer ScienceVery hardGATE CS (PYQ pattern)

L = { w ∈ {a, b}* : w contains aab as a substring, or w ends with ba }. How many states does the minimal complete DFA have?

  1. A. 5
  2. B. 7
  3. C. 6
  4. D. 8

Correct answer: C. 6

Once aab appears the string is accepted forever (sink). Otherwise track the suffix state among: ε/b-ish, a, aa, ab (which is also 'ends in b' ), and 'ends with ba'; Myhill–Nerode enumeration gives 6 classes in total.

More Theory of Computation questions

Exams that ask this topic