GATE Computer ScienceVery hardGATE CSE

A DFA reads binary strings most-significant bit first and accepts those whose numeric value is divisible by 12 (the empty string counts as value 0 and is accepted). How many states does the minimal DFA have?

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

Correct answer: C. 5

Tracking the value mod 12 uses 12 residues, but residues that cannot be told apart by any suffix merge; the Myhill–Nerode count is 5 (stable for longer strings: 5).

More Compiler Design questions

Exams that ask this topic