For understanding Conversion of Finite Automata (NDFA) to DFA let we first understand FA with ε.
Finite Automata with ε is a set of five tupples ( Q , Σ , δ , q0 , f )
Where :
Q is a set of states.
Σ is a set of input symbol.
q0 is initial state
f is set of final state.
δ is transition function of the form.
δ : ( Q U Σ ) → 2Q
δ : Q x ( Σ U ε) → 2Q [ since ε is not a member of Σ)
It as NDFA with ε because it gives many output like [ q2 , q3 ,q4 ]
CONVERSION OF FINITE AUTOMATA (NDFA) WITH DFA
For this conversion there are two steps :
1. Removal of ε
2. NFA to DFA conversion.
Let we understand the above steps with the help of example.
QUESTION 1:
Construct a DFA for this Finite Automata (FA)
SOLUTION:STEP 1 REMOVAL OF ε
Construct a Automata on the basis of above transition table:
Such as: q0 q1 q2 ε
q0 ε-closer =[ q0 q1 q2 ]
here in this set of output there is q2 so we can say that q0 is also set to final state.
Same as:
q1 ε-closer =[ q1 q2 ]
since q1→Final state
q2 ε-closer =[ q2 ]
since q2→Final state
The final transition diagram will be:
STEP 2 NFA TO DFA CONVERSION
NOW From above transition diagram we get:
Q = [ q0 q1 q2 ]
2Q = [ [q0] , [q1] , [q2] , [φ] , [ q1 q2 ] , ...... ]
Σ = [ 0 ,1 ,2 ]
q0 = q0
f = [ q0 q1 q2 ]
On the basis of above transition diagram δ (Transition Table) =
here E means [φ] .
QUESTION 2:
Convert into DFA
Now for conversion first step is to remove ε from above transition diagram
On the basis of above transition diagram the transition table will be :
δ (Transition Table) =
Consider label for all states such as:
[A] for [q0]
[B] for [q2,q3,q4,q6,q9]
[C] for [q8,q9]
[D] for [q4,q5,q6,q9]
[E] for [φ] ( In above table already change )
Now the new transition table is:
QUESTION 3:
Convert into DFA
SOLUTION :
STEP 1 REMOVAL OF ε
Now transition table of above diagram:
δ (Transition Table) =
Final states will be : [ q0 , q3 , q5 , q6 , q7 ]
STEP 2 NFA TO DFA CONVERSION
Now new transition table after removing ε is :
δ (Transition Table) =
Give some label for all states such as:
[A] = [q0]
[B] = [q1,q2,q3,q4,q6,q7]
[C] = [q1,q2,q4,q5,q6,q7]
Now the transition diagram is:
I hope from the above description and examples we can understand how convert Finite Automata (NDFA) to DFA.
No comments:
Post a Comment