Computability and Complexity/Formal Languages/Chomsky Hierarchy/sample DFA inputs

From Wikibooks, open books for an open world
Jump to: navigation, search

Sample DFA inputs[edit]

These examples are for use with the perl DFA emulator provided at the bottom of Regular Languages. That page also contains a description of what a DFA is and how it works.

The specifications for a machine that accepts all strings ending in b:

q1 q2 q3
:Start State:
:Accept States:
a b
q1 a q2
q1 b q3
q2 a q2
q2 b q3
q3 a q2
q3 b q3

Some sample words:

this accepts:

b a b a b

this rejects:

a a b b a a b a
(the empty string)