Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

  • GATE CS
  • 2026–27 pattern practice
  • Theory of Computation
  • Finite automata
  • Medium

How many states does the minimal DFA have for the language of strings over {a, b} containing exactly two a's?

Regular Languages

Pick an option to check your answer.

The DFA counts a's: 0 seen, 1 seen, 2 seen (accepting), and more than 2 (a dead state that can never accept). All four behave differently on future input, so the minimal DFA has 4 states.

Why not the others

  • 33 omits the dead state needed after a third a.
  • 55 adds a state equivalent to an existing one.
  • 22 cannot count up to two.

Report an error

GATE CS · Theory of Computation · Regular Languages