4.3Nondeterministic Finite Automata
The finite automata we have seen so far are deterministic finite automata (DFA): given the current state and the next input symbol, there is exactly one state that a finite automaton can move to. In this section, we introduce nondeterministic finite automata (NFA), which have two additional features:
An NFA’s state transition function takes as input the current state and the next input symbol, and is allowed to return, not just one state, but a subset of states.
An NFA is also allowed to make transitions without consuming the next input symbol. These are called -transitions as it is as if the next input symbol is the empty string.
We will introduce these two features one by one.
4.3.1Transition to more than one state¶
Let be an NFA without -transitions. Consider a string where each is an input symbol from . The NFA processes as follows. We use to denote the set of states the NFA is in after processing .
Start at the start state: .
For each input symbol (starting from ): define to consist of states such that there exists and .
After all input symbols have been processed, it accepts the string if contains an accepting state, and rejects it otherwise.
We can also view the NFA as having several possible state transition sequences of the form
where for each ranging from 1 to . Note that since can be a set of more than one state, there can be several possible state transition sequences, and so there may be several resulting states. We denote by the set of resulting states.
The high level interpretation is as follows: Suppose the NFA is at state , the next input symbol is 0, and for some set of states . Then, simultaneously transitions to all of them, in parallel. Each of these parallel “threads” then process the input independently of each other. Metaphorically, the universe is “split” into parallel universes, where is the size of . The NFA accepts the string iff it ends up in an accepting state in one of the universes.
Computation tree¶
Similar to DFAs, we can define a computation path to be a sequence of state transitions followed by while processing . We say that the path is accepting path if it ends in an accepting state and rejecting otherwise. Thus, an NFA accepts a string iff there exists an accepting computation path.
Observe that with DFAs, we have a single computation path for each input string. NFAs on the other hand, can have multiple computation paths. Consider the following NFA.

On input 110, it has 3 possible state transition sequences, each corresponding to a computation path.
We can in turn represent these paths using a tree, which we call a computation tree.

In this example, the string 110 is accepted by the NFA as there is one computation path (the one in the middle) ending in an accepting state.
4.3.2epsilon-transitions¶
An NFA with -transitions is one where instead of consuming the next input symbol and processing it using the transition function, the NFA can instead choose to follow an -transition which is a transition that does not consume the next input symbol.
Thus, in the state transition diagram, there may be edges that are labeled with instead of a symbol from . Suppose the NFA is at state , the next input symbol is 0, and for some set of states . Then, can immediately transition simultaneously to the states in .
Let be an NFA. Consider a string where each . A state is a resulting state of after processing iff there exists a sequence of state transitions:
where , and . Note that there may be several resulting states. We denote by the set of resulting states.
The definition of acceptance is the same as for NFAs without -transitions (Definition 2).
Computation tree¶
Consider the following NFA.

On input 10, it has 3 possible state transition sequences, each again corresponding to a computation path.
Here is its computation tree. Observe that for every root-to-leaf path, concatenating the symbols on the path gives us 10.

In this example, the string 10 is accepted by the NFA as there is one computation path (the one in the middle) ending in an accepting state.
See Set notation for details on the notation .