Question discussion

A DFA reads a binary number from its most significant bit and must accept exactly those numbers that are divisible by 3. What is the minimu…

2502Medium DSSSB TGT Computer Science 0 replies 1 views
0

A DFA reads a binary number from its most significant bit and must accept exactly those numbers that are divisible by 3. What is the minimum number of states that it needs?

  • A2
  • B4
  • C3
  • D6
Correct answer: C

Explanation

The state only has to remember the remainder (0, 1 or 2) of the number read so far, because reading a bit b changes a remainder r to (2r + b) mod 3, and these three remainders are pairwise distinguishable.

Discussion 0

Nobody has replied yet. Start the discussion!