Skip to content
Mad4Study

Engineering & Science

GATE Computer Science

  • GATE CS
  • 2026–27 pattern practice
  • Theory of Computation
  • Finite automata
  • Medium

How many states does the minimal DFA have that accepts binary strings (read MSB first) whose value is divisible by 5?

Regular Languages

Pick an option to check your answer.

Track the value modulo 5. Reading bit bb maps remainder rr to (2r+b) mod 5(2r + b) \bmod 5. The remainders 00–44 are pairwise distinguishable, so the minimal DFA has 5 states, with state 0 as start and accept. No dead state is needed.

Why not the others

  • 4 merges two distinguishable remainders.
  • 6 adds an unreachable or dead state.
  • 10 mixes in the remainder modulo 2 unnecessarily.

Report an error

GATE CS · Theory of Computation · Regular Languages