GATE Computer ScienceVery hardGATE CSE

Decimal numerals are read most significant digit first (empty string = 0, leading zeros allowed). What is the number of states in the minimal DFA for the multiples of 12?

  1. A. 12
  2. B. 6
  3. C. 8
  4. D. 7

Correct answer: D. 7

Residues r and r + 6 (mod 12) have identical transitions (10r + d mod 12), and only residue 0 accepts. So {1,7}, {2,8}, {3,9}, {4,10}, {5,11} merge while 0 and 6 stay separate: 7 states.

More Theory of Computation questions

Exams that ask this topic