GATE Computer ScienceHardGATE CS (PYQ pattern)

Let L = { aⁿbⁿ : 0 ≤ n ≤ 3 } over {a, b}. How many Myhill–Nerode equivalence classes does L have (equivalently, how many states does its minimal complete DFA have)?

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

Correct answer: C. 8

L is finite, so regular. Classes: ε (accepting), a, aa, aaa (the a-count still matters), 'exactly one more b needed' (aab, aaabb), 'two more b's needed' (aaab), 'complete, nothing more allowed' (ab, aabb, aaabbb), and dead. ab and aab are different (ab is accepted); aab and aaabb are the same. 8 classes — the 'infinitely many' answer is for unbounded n.

More Theory of Computation questions

Exams that ask this topic