[Overview] [Previous] [Next]
Example DFA
Example input string:
1 0 0 1 1 1 0 0
Operation
- Start with the "current state" set to the start state
and a "read head" at the beginning of the input string;
- while there are still characters in the string:
- Read the next character and advance the read head;
- From the current state, follow the arc that is
labeled with the character just read;
the state that the arc points to becomes the next
current state;
- When all characters have been read, accept
the string if the current state is a final state,
otherwise reject the string.
Sample trace:
q0 1
q1 0
q3 0
q1 1
q0 1
q1 1
q0 0
q2 0
q0
Since q0 is a final state, the string is accepted.
Copyright © 1996 by David Matuszek
Last modified Jan 29, 1996