Equivalence of NFAs and DFAs
Learn how to convert a nondeterministic finite automaton to a deterministic finite automaton.
We'll cover the following...
Construct a DFA from a NFA
In this lesson, we will show how to convert a NFA to a DFA. Consider the language over , which consists of strings that end and begin with the same symbol, i.e.,
The NFA that accepts the language L is depicted in the figure below.
The key idea is that for each state we have a (possibly empty) set of states to track for every input symbol. The tree in the figure below illustrates how things can progress as we begin with the start state of the original NFA, , and track all possible moves while reading the first three symbols of any input string. In this case, going three levels deep suffices to observe all the possible states for this language. Multiple transitions leaving a state with the same symbol appear in horizontally adjacent boxes in the figure below.
The symbol can reach either or from state . We will combine these two states into a single, “composite” state, . The same logic applies to states and when leaving state with a , giving us the composite state . See the figure below.
This tree suggests that five possible states suffice to process all possible movements: , , , , and , giving the following equivalent DFA.
Whenever a composite state contains any accepting state from the original NFA, that state becomes an accepting state in the resulting DFA. Thus, both states containing in the figure above are accepting states.
It is usually easier to track multiple moves in a NFA with a transition table instead of a tree. This is a transition table for the NFA.
State | ||
---|---|---|