Consider the following NFA,
In this NFA, from state q0 there are three possible moves on the input symbol a, namely to q0, q1, and q2. When we simulate this NFA, the move from q0 on input a is non-deterministic. That means the next state is not uniquely determined by the current state and input symbol. In a deterministic finite automaton (DFA), however, for each state and each input symbol there is exactly one transition. A DFA is easier to simulate because the next state is unambiguous. For every NFA there exists an equivalent DFA that recognises the same language; the conversion procedure constructs such a DFA.
Before applying the standard construction from NFA to DFA we must handle epsilon (ε) transitions. The epsilon closure (or ε-closure) of a state is central to that process.
Definition. The epsilon closure of a state q, written ECLOSE(q), is the set containing q itself and every state that can be reached from q by following zero or more ε-transitions.
To compute ECLOSE(q) one may use a depth-first or breadth-first search restricted to ε-transitions: start from q, follow all outgoing ε-transitions to new states, then continue from those states until no new states are discovered.
Consider the following NFA.
Find the epsilon closure of all states.
Consider the following NFA.
Find the epsilon closure of all states.
Consider the following NFA.
Compute the epsilon closure of all states.
The conversion from an NFA (possibly with ε-transitions) to an equivalent DFA is performed in two main phases:
Both phases are described below with examples and clear step-by-step instructions.
Given an NFA with ε-transitions, we construct an equivalent NFA without ε by using epsilon closures. The idea is to replace each state by its epsilon closure for transition purposes so that all ε-moves are absorbed into ordinary symbol transitions.
One systematic method:
Consider the NFA with ε-transitions below.
The original states are q0, q1, q2. The start state is q0. The final state is q2.
Step a: Find all epsilon closures.
The reachable sets (closures) become the states of the new NFA: {q0,q1,q2}, {q1,q2}, {q2}. The start state is {q0,q1,q2} because it is ECLOSE(start). Any of these new states that include the original final state q2 are final.
Next find transitions of these new states on input symbols a, b, c. For example, consider the composite state {q0,q1,q2} and determine where an input a, b, or c can lead by following the above algorithm.
After computing these transitions we obtain the NFA without ε-transitions.
Rename the composite states for convenience:
The transition diagram of the new NFA is shown below. Note that in this particular case the resulting NFA without ε-transitions already satisfies the DFA property (one transition per symbol from each state).
After eliminating ε-transitions we apply the subset construction:
Convert the following NFA to a DFA.
Step 1: This NFA has no ε-transitions, so we proceed directly to the subset construction.
Step a: Start with the start state q0.
We have a new DFA state {q0, q1}.
Step b: Consider {q0, q1}.
We have a new DFA state {q0, q1, q2}.
Step c: Consider {q0, q1, q2}.
We obtain two new DFA states {q0, q1, q2, q3} and {q0, q1, q3}.
Step d: Process each of these newly generated states.
For {q0, q1, q2, q3} compute transitions (details shown below).
For {q0, q1, q3} compute transitions (details shown below).
No further new states are generated. The transition table for the completed DFA is shown below. The start state is q0. DFA final states are those composite states that contain at least one final state of the original NFA (here q2 or q3).
Rename these DFA states for compactness:
The diagram shows a DFA because from each state there is exactly one transition for each input symbol.
Convert the following NFA to DFA.
Step 1: This NFA contains no ε-transitions, so proceed directly to subset construction.
From the start state q0:
Generate new composite states and compute their transitions. Intermediate tables/diagrams are shown below.
No more new states are generated. The start state is q0. Final states are q2 and {q1, q2} because they contain the original final state q2.
Rename composite states for convenience:
Consider the NFA below. Convert it to a DFA.
Step 1: Eliminate ε-transitions by computing closures.
The states of the new NFA are the closures above; the start state is {q0, q1, q2}. Any closure that contains the original final state q2 becomes final in the new NFA.
Now find transitions of these closures on input symbols 0 and 1. For example, consider closure {q0, q1, q2} and compute its transitions:
Rename closures as:
The NFA without ε-transitions shown above is already a DFA because from each state there is exactly one transition for each input symbol.
Consider the following NFA. Convert it to a DFA.
Step 1: This NFA contains no ε-transitions, so proceed to the subset construction.
Begin from the start state q1:
Continue computing transitions for newly generated composite states:
The start state is q1. The DFA accepting state is {q1, qf} because it contains the original final state qf. Rename states:
The resulting machine is a DFA because every state has exactly one transition for each input symbol.
1. Convert the following NFA to DFA.
2. Convert the following NFA to DFA.
3. Convert the following NFA to DFA.
| 1. What is NFA to DFA conversion in computer science engineering? | ![]() |
| 2. Why is NFA to DFA conversion important in computer science engineering? | ![]() |
| 3. How does NFA to DFA conversion work? | ![]() |
| 4. What are the advantages of NFA to DFA conversion? | ![]() |
| 5. Are there any limitations to NFA to DFA conversion? | ![]() |
![]() | Explore Courses for Computer Science Engineering (CSE) exam |
![]() | Get EduRev Notes directly in your Google search |