GATE Computer ScienceVery hardGATE CSE · NIELIT

A DFA reads a binary string most-significant bit first (leading zeros allowed) and tracks the value so far modulo 12, accepting exactly when the value is divisible by 12. How many states does the minimal DFA for this language have?

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

Correct answer: B. 5

For any extension of length ≥ 2 acceptance depends only on r mod 3, and extensions of length 0 or 1 only separate r = 0 and r = 6; the classes are {0}, {6}, {3,9}, {r ≡ 1 mod 3 else}, {r ≡ 2 mod 3 else}: 5 states.

More Theory of Computation questions

Exams that ask this topic