GATE Computer ScienceHardGATE CS (PYQ pattern)

The regular expression a*(ba*b)*a* is over Σ = {a, b}. How many states does the minimal complete DFA for its language have?

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

Correct answer: C. 5

Strings like b·a·b·a·b·a·b have 4 b's but are not generated, because consecutive pairs ba*b cannot have a's between them. So the language is NOT 'even number of b's' (2 states); enumeration of Myhill–Nerode classes gives 5.

More Theory of Computation questions

Exams that ask this topic