## Conversion from NFA to DFAIn this section, we will discuss the method of converting NFA to its equivalent DFA. In NFA, when a specific input is given to the current state, the machine goes to multiple states. It can have zero, one or more than one move on a given input symbol. On the other hand, in DFA, when a specific input is given to the current state, the machine goes to only one state. DFA has only one move on a given input symbol. Let, M = (Q, ∑, δ, q0, F) is an NFA which accepts the language L(M). There should be equivalent DFA denoted by M' = (Q', ∑', q0', δ', F') such that L(M) = L(M'). ## Steps for converting NFA to DFA:
## Example 1:Convert the given NFA to DFA.
Now we will obtain δ' transition for state q0. The δ' transition for state q1 is obtained as: The δ' transition for state q2 is obtained as: Now we will obtain δ' transition on [q1, q2]. The state [q1, q2] is the final state as well because it contains a final state q2. The transition table for the constructed DFA will be:
The Transition diagram will be: The state q2 can be eliminated because q2 is an unreachable state. ## Example 2:Convert the given NFA to DFA.
Now we will obtain δ' transition for state q0. The δ' transition for state q1 is obtained as: Now we will obtain δ' transition on [q0, q1]. Similarly, As in the given NFA, q1 is a final state, then in DFA wherever, q1 exists that state becomes a final state. Hence in the DFA, final states are [q1] and [q0, q1]. Therefore set of final states F = {[q1], [q0, q1]}. The transition table for the constructed DFA will be:
The Transition diagram will be: Even we can change the name of the states of DFA.
With these new names the DFA will be as follows: Next TopicConversion from NFA with ε to DFA |