GATE Computer ScienceVery hardGATE CSE

Over {a, b}, L = { w : the number of a's in w is ≡ 1 (mod 4) and |w| ≡ 3 (mod 6) }. How many states does the minimal DFA of L have?

  1. A. 12
  2. B. 24
  3. C. 20
  4. D. 27

Correct answer: B. 24

The pair (a mod 4, |w| mod 6) gives 24 reachable states, and the length counter separates every residue because a b-only extension changes only the length; Moore refinement confirms all 24 pairs are pairwise distinguishable, so no merging is possible.

More Theory of Computation questions

Exams that ask this topic