**Source:** http://www.wikiwand.com/en/Deterministic_finite_automaton

The DFA below has a binary alphabet and accepts all words that contain an even number of 0s.

*M* = (*Q*, Σ, δ, *q _{0}*,

*Q*= {*S*_{1},*S*_{2}},- Σ = {0, 1},
*q*=_{0}*S*_{1},*F*= {*S*_{1}}, and- δ is defined by the following state transition table:

0 | 1 | |

S_{1} | S_{2} | S_{1} |

S_{2} | S_{1} | S_{2} |

The state *S*_{1} represents that there has been an even number of 0s in the input so far, while *S*_{2} signifies an odd number. A 1 in the input does not change the state of the automaton. When the input ends, the state will show whether the input contained an even number of 0s or not. If the input did contain an even number of 0s, *M* will finish in state *S*_{1}, an accepting state, so the input string will be accepted.