GATE Computer ScienceVery hardGATE CS (PYQ pattern)

Binary strings are read LSB first (the leftmost symbol is the least significant bit; ε has value 0 and is accepted). The minimal DFA for 'value divisible by 6' has how many states?

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

Correct answer: D. 5

Reading LSB first, the number is even only if the first bit is 0, so strings starting with 1 form a dead class. The start state is its own class and 3 live classes remain (value mod 3 with the weight of the next bit), giving 5.

More Theory of Computation questions

Exams that ask this topic