GATE Computer ScienceHardGATE CS (PYQ pattern)

How many states does the minimal complete DFA (dead state included) for the regular expression (ab | aba)* over {a, b} have?

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

Correct answer: A. 5

Myhill–Nerode classes: ε (accepting, start), a (waiting for b), ab (accepting: a block just ended, or aba may follow), aba (accepting; its last a may also begin a new block, so b leads back to the ab class and a to the a class), and the dead state (e.g. after b). ε and ab differ: ab·a is accepted but a alone is not. Total 5

More Compiler Design questions

Exams that ask this topic