0% found this document useful (0 votes)
1K views18 pages

Epsilon NFA Into NFA Into DFA

The document describes the process of converting an ε-NFA to NFA and then to DFA. It gives an example ε-NFA with 3 states and finds the ε-closure of each state. The transition function δ' is constructed by applying the ε-closure. This results in a 3-state NFA transition table. The NFA is then determinized to produce a 1-state DFA with identical transitions for all inputs.

Uploaded by

Alan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views18 pages

Epsilon NFA Into NFA Into DFA

The document describes the process of converting an ε-NFA to NFA and then to DFA. It gives an example ε-NFA with 3 states and finds the ε-closure of each state. The transition function δ' is constructed by applying the ε-closure. This results in a 3-state NFA transition table. The NFA is then determinized to produce a 1-state DFA with identical transitions for all inputs.

Uploaded by

Alan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

∈-NFA into NFA into DFA

R.VIJAY SAI,
ASSISTANT PROFESSOR,
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Subject code and name:
50 CB 404/FORMAL LANGUAGE AND AUTOMATA THEORY
MODULE 1
Convert the following ∈-NFA into NFA

State\Inputs ∈ a b
q0 - { q1} -
q1 q2 - -
*q2 - - { q2}
Step 1:
Find the epsilon closure for each states:

• ∈-closure(q0)={q0}
• ∈-closure(q1)={q1, q2}
• ∈-closure(q2)={q2}
Step 2:
Applying the transition function:
• δ' (q0,a)= ∈-closure(δ(∈-closure(q0),a))
– ∈-closure(q0)={q0}
– δ({q0},a)={q1}
– ∈-closure(q1)= {q1, q2}
– δ' (q0,a)={q1, q2}
• δ' (q0,b)= ∈-closure(δ(∈-closure(q0),b))
– ∈-closure(q0)={q0}
– δ({q0},b)= Φ
– ∈-closure(Φ)=Φ
• δ' (q1,a)= ∈-closure(δ(∈-closure(q1),a))=
– ∈-closure(q1)={q1, q2}
– δ({q1, q2 } ,a)=δ(q1 ,a)U δ( q2 ,a)
– =Φ UΦ
– =Φ
• ∈-closure(Φ)=Φ
• δ' (q1,b)= ∈-closure(δ(∈-closure(q1),b))=
– ∈-closure(δ({q1, q2 } ,b))= ∈-closure(q2)= {q2}
• δ' (q2,a)= ∈-closure(δ(∈-closure(q2),a))=
– ∈-closure(δ(q2 ,a))=Φ
• δ' (q2,b)= ∈-closure(δ(∈-closure(q2),b))=
– ∈-closure(δ(q2 ,b))= {q2}
Step 3:
Transition Table:
State\Inputs a b
q0 { q1 ,q2} -
*q1 - { q2}
*q2 - { q2}
Step 4:
Transition Diagram:
Convert the following ∈ – NFA to NFA and the resultant NFA to DFA.

Input symbols
States
𝜖 a b c
→p {q, r} {p} {p,q} {r}
q Ф {p} {q,r} {p, q}
*r Ф Ф Ф {r}
Transition Diagram
Step 1:
Find the epsilon closure for each states:

• ∈-closure(p)={p,q,r}
• ∈-closure(q)={q}
• ∈-closure(r)={r}
Step 2:
Applying the transition function:
• δ' (p,a)= ∈-closure(δ(∈-closure(p),a))
– ∈-closure(p)={p,q,r}
– δ({p,q,r},a)={p}
– ∈-closure(p)={p,q,r}
– δ' (p,a)= {p,q,r}
• δ' (p,b)= ∈-closure(δ(∈-closure(p),b))
– ∈-closure(p)={p,q,r}
– δ({p,q,r},b)={p}
– ∈-closure(p)={p,q,r}
– δ' (p,b)= {p,q,r}
• δ' (p,c)= ∈-closure(δ(∈-closure(p),c))
– ∈-closure(p)={p,q,r}
– δ({p,q,r},c)={p}
– ∈-closure(p)={p,q,r}
– δ' (p,c)= {p,q,r}
• δ' (q,a)= ∈-closure(δ(∈-closure(q),a))
– ∈-closure(q)={q}
– δ({q},a)={p}
– ∈-closure(p)={p,q,r}
– δ' (q,a)= {p,q,r}
• δ' (q,b)= ∈-closure(δ(∈-closure(q),b))
– ∈-closure(q)={q}
– δ({q},b)={q,r}
– ∈-closure(q,r)=q U r={q,r}
– δ' (q,b)= {q,r}
• δ' (q,c)= ∈-closure(δ(∈-closure(q),c))
– ∈-closure(q)={q}
– δ({q},c)={p,q}
– ∈-closure(p,q)={p,q,r}
– δ' (q,c)= {p,q,r}
• δ' (r,a)= ∈-closure(δ(∈-closure(r),a))
– ∈-closure(r)={r}
– δ({r},a)=Φ ∈-closure(Φ)=Φ
– δ' (r,a)= Φ
• δ' (r,b)= ∈-closure(δ(∈-closure(r),b))
– ∈-closure(r)={r}
– δ({r},b)=Φ ∈-closure(Φ)=Φ
– δ' (r,b)= Φ
• δ' (r,c)= ∈-closure(δ(∈-closure(r),c))
– ∈-closure(r)={r}
– δ({r},c)=r
– ∈-closure(r)={r}
– δ' (r,c)= {r}
NFA Transition Table
Input symbols
States
a b c
→p {p,q,r} {p,q,r} {p,q,r}
q {p,q,r} {q,r} {p,q,r}
*r Ф Ф {r}
• δD (p,a)=[pqr]
• δD (p,b)=[pqr]
• δD (p,c)=[pqr]
• δD ([pqr],a)=[pqr]
• δD ([pqr],b)=[pqr]
• δD ([pqr],c)=[pqr]
DFA Transition table
Input symbols
States
a b c

→p [p,q,r] [p,q,r] [p,q,r]

[p,q,r]* [p,q,r] [p,q,r] [p,q,r]


Transition Diagram

You might also like