GATE Computer ScienceVery hardGATE CS (PYQ pattern)

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

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

Correct answer: C. 9

The language is: |w| ≥ 3 and the 3rd and 2nd symbols from the right differ. The future depends on the last two symbols; acceptance also needs the 3-window xyz to have x ≠ y. Classes: ε; last a with no pending pair (a, …aa); last b likewise; ab or …aab; ba or …bba; and the four accepting windows aba, abb, baa, bab. Total 9 (not the 8 of a plain 3-window).

More Theory of Computation questions

Exams that ask this topic