Answer: Finite automata

Question: Draw a finite-automaton state transition table that accepts bit-strings representing numbers divisible by 5.

Answer: The following is one valid answer (with a start state of Sx and an accepting state of S0).

        input
state   0   1
 Sx    S0  S1
 S0    S0  S1
 S1    S2  S3
 S2    S4  S0
 S3    S1  S2
 S4    S3  S4
There's a good chance you forgot the Sx state. This is just so the empty string isn't accepted, since it doesn't really represent a number at all. You don't really need to worry about this.


Answer / Finite automata / Review questions / 15-211 A, B