Chapter 2, Finite Automata
Deterministic Finite Automaton, DFA
A deterministic finite automaton consists of:
- A finite set of states, often denoted .
- A finite set of input symbols, often denoted .
- A transition function that takes as arguments a state and an input symbol and returns a state, often denoted . In our formal graph representation of automata, was represented by arcs between states and the labels on the arcs. If is a state, and is an input symbol, then is that state such that there is an arc labeled from to .
- A start state, one of the states in .
- A set of final or accepting states . The set is a subset of .
A deterministic finite automaton can often be referred to by its acronym: DFA. The most succinct representation of a DFA is a listing of the five components above. In proofs we often talk about a DFA in "five-tuple" notation:
where is the name of DFA, is its set of states, its input symbols, its transition function, its start state, and its set of accepting states.
How a DFA Processes Strings
The first thing we need to understand about a DFA is how the DFA decides whether or not to "accept" a sequence of input symbols. The "language" of the DFA is the set of all strings that the DFA accepts. Suppose is a sequence of input symbols. We start out with the DFA in its start state, . We consult the transition function , say to find the state that the DFA enters after processing the first input symbol . We process the next input symbol, , by evaluating ; let us suppose this state is . We continue in this manner, finding states such that for each . If is a member of , then the input is accepted, and if not then it is "rejected".
Simpler Notations for DFA's
Specifying a DFA as a five-tuple with a detailed description of the ð transition function is both tedious and hard to read. There are two preferred notations for describing automata:
- A transition diagram, which is a graph such as the ones we saw before.
- A transition table, which is a tabular listing of function, which by implication tells us the set of states and the input alphabet.
Transition Diagrams
A transition diagram for a DFA is a graph defined as follows:
- For each state in there is a node.
- For each state in and each input symbol in , let .Then the transition diagram has an arc from node to node , labeled . If there are several input symbols that cause transitions from to , then the transition diagram can have one arc, labeled by the list of these symbols.
- There is an arrow into the start state , labeled
Start. This arrow does not originate at any node. - Nodes corresponding to accepting states (those in ) are marked by a double circle. States noe in have a single circle.
Figure 1 shows the transition diagram for the DFA that we designed before.

Transition Tables
A transition table is a conventional, tabular representation of a function like that takes two arguments and returns a value. The rows of the table correspond to the states, and the columns correspond to the inputs. The entry for the row corresponding to state and the column corresponding to input is the state .
Figure 2 is a transition diagram.

Nondeterministic Finite Automata, NfA
A "nondeterministic" finite automaton (NFA) has the power to be in several states at once. This ability is often expressed as an ability to "guess" something about its input. The NFA's accept exactly the regular languages, just as DfA's do. They are often more succinct and easier to design than DFA's, and we can always convert an NFA to a DFA. The latter may have exponentially more states than the NFA; fortunately, cases of this type are rare.
An Informal View of Nondeterministic Finite Automata
Figure 3 shows a nondeterministic finite automaton, whose job is to accept all and only the strings of 0's and 1's that end in "01".

Definition of Nondeterministic Finite Automata
An NFA is represented essentially like a DFA:
where:
- is a finite set of states.
- is a finite set of input symbols.
- , a member of , is the start state.
- , a subset of , is the set of final (or accepting) states.
- , the transition function is a function that takes a state in and an input symbol in as arguments and returns a subset of . Notice that the only difference between an NFA and a DFA is in the type of value that returns: a set of states in the case of an NFA and a single state in the case of a DFA.