Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 11

Equivalence of ɛ-NFA and

NFA
ɛ-Closure (q)
ɛ-Closure (q) :
is the set of all states reachable from a given state q using ɛ-transitions.
ɛ-Closure (q) = δˆ(q,ε)
1/0

ɛ ɛ ɛ
q0 q1 q2 q3q

ɛ-Closure (q0) = {q0 , q1 , q2 , q3 }


ɛ-Closure (q1) = {q1 , q2 , q3 }
ɛ-Closure (q2) = {q2 , q3 }
ɛ-Closure (q3) = {q3 }
δˆ(q,a)
• δˆ(q,a) = ɛ-Closure (δ (δˆ(q,ε),a) )
= ɛ-Closure (δ (ɛ-Closure(q),a) )
If ɛ-Closure(q) = { p1, p2, … pk }
ɛ-Closure (δ ({ p1, p2, … pk },a) )
= ɛ-Closure (δ ( p1,a) Ս δ ( p2,a) Ս …… Ս δ ( pk,a) )
= ɛ-Closure ({r1,r2,….,rn})
= ɛ-Closure (r1) Ս ɛ-Closure (r2) Ս …Ս ɛ-Closure (rn)
Let M = (Q ,Σ, δ ,q0,F ) be an NFA with ɛ-transitions. Then there
exists NFA without ɛ-transitions M’ = (Q ,Σ, δ’ ,q0, F’) where

F U {q0} if ɛ-Closure (q0) contains a state of F


F’ =
F otherwise

And δ’(q,a) = δˆ(q,a) for q in Q and a in Σ


Convert the following ɛ-NFA to an equivalent
NFA without ɛ

0 1 2
ɛ ɛ
q0 q1 q2q
Convert the following ɛ-NFA to an equivalent NFA without ɛ
0 1 2

q0 q1 q2q
ɛ ɛ

Step 1 : Find δ’(q0,0) = δˆ(q0,0)

δ’(q0,0) = δˆ(q0,0) = ɛ-Closure (δ (δˆ(q0,ε),0) )


= ɛ-Closure (δ (ɛ-Closure(q0),0) )
= ɛ-Closure (δ ({q0 , q1 , q2 }, 0))
= ɛ-Closure (δ (q0 , 0) U δ (q1 , 0) U δ (q2 , 0) )
= ɛ-Closure (q0 U Ø U Ø)
= ɛ-Closure (q0 )
= {q0 , q1 , q2 }
Convert the following ɛ-NFA to an equivalent NFA without ɛ
0 1 2

q0 q1 q2q
ɛ ɛ

Step 2 : Similarly Find δ’(q0,1) = δˆ(q0,1)

δ’(q0,1) = δˆ(q0,1) = ɛ-Closure (δ (δˆ(q0,ε),1) )


= ɛ-Closure (δ (ɛ-Closure(q0),1) )
= ɛ-Closure (δ ({q0 , q1 , q2 }, 1))
= ɛ-Closure (δ (q0 , 1) U δ (q1 , 1) U δ (q2 , 1) )
= ɛ-Closure (Ø U q1 U Ø)
= ɛ-Closure (q1 )
= {q1 , q2 }
Convert the following ɛ-NFA to an equivalent NFA without ɛ
0 1 2

q0 q1 q2q
ɛ ɛ

Step 3 : Also Find δ’(q0,2) = δˆ(q0,2)

δ’(q0,2) = δˆ(q0,2) = ɛ-Closure (δ (δˆ(q0,ε),2) )


= ɛ-Closure (δ (ɛ-Closure(q0),2) )
= ɛ-Closure (δ ({q0 , q1 , q2 }, 2))
= ɛ-Closure (δ (q0 , 2) U δ (q1 , 2) U δ (q2 , 2) )
= ɛ-Closure (Ø U Ø U q2)
= ɛ-Closure (q2 )
= {q2 }
Convert the following ɛ-NFA to an equivalent NFA without ɛ
0 1 2

q0 q1 q2q
ɛ ɛ

Find δ’ for rest of all states for all input symbols


Step 4 : Find δ’(q1,0) = δˆ(q1,0) = Ø
δ’(q1,1) = δˆ(q1,1) = {q1 , q2 }
δ’(q1,2) = δˆ(q1,2) = {q2 }
Step 5 : Find δ’(q2,0) = δˆ(q2,0) = Ø
δ’(q2,1) = δˆ(q2,1) = Ø
δ’(q2,2) = δˆ(q2,2) = {q2 }
Convert the following ɛ-NFA to an equivalent NFA without ɛ
0 1 2

q0 q1 q2q
ɛ ɛ

Finally Find the new set of final states F’


As ɛ-Closure (q0) contains a state of F , F’ =F U {q0}
F’ = {q0 , q2 }
Convert the following ɛ-NFA to an equivalent NFA without ɛ
0 1 2

q0 q1 q2q
ɛ ɛ

Resultant NFA will be


0
1 2

q0 q1 q2q
0,1 1,2

0,1,2

You might also like