SlideShare a Scribd company logo
2
Most read
3
Most read
19
Most read
Equivalence of
NFA and DFA
-Sampath Kumar S,
AP/CSE, SECE
Equivalence of NFA and DFA
 The NFA with ε can be converted to NFA
without ε and this NFA without ε can be
converted to DFA.
11/21/2017
Sampath Kumar S, AP/CSE, SECE
2
ε-NFA
NFA
DFA
Conversion of NFA to DFA:
The conversion of NFA to DFA involves following steps:
1. QD = 2Q
N. If NFA has n states. DFA at most have 2n
states.
2. Σn=ΣD
3. [q0]=[q0]
4. FD = A set of all the states of QD that contains at
least one of the final states of FN .
5. δD((q1,q2,q3),a)=
δn(q1,a) u δn(q2,a) u δn(q3,a) ={p1,p2,p3}
Add state [P1,P2,P3] to QD if it is not there
11/21/20173
Sampath Kumar S, AP/CSE, SECE
Problem to discuss:
38. Convert the following NFA to DFA
11/21/20174
Sampath Kumar S, AP/CSE, SECE
Problem to discuss:
39. Construct DFA equivalent to NFA
M = ( {p,q,r,s}, {0,1}, δ, P, {q,s} )
where δ is defined in the following table.
11/21/20175
Sampath Kumar S, AP/CSE, SECE
δ 0 1
->p {q, s} {q}
q* {r} {q,r}
r {s} {p}
s* - {p}
Problem to discuss:
40. Convert the given NFA to its equivalent DFA
11/21/20176
Sampath Kumar S, AP/CSE, SECE
Conversion of ε-NFA to NFA:
The conversion of ε-NFA to NFA involves following
steps:
1. Find out all the ε-transition from each state from Q.
That will be called as ε-closure {qi} where qi ∈ Q.
2. Then δ’ transition can be obtained. The δ’ transition
means and ε-closure on δ moves.
3. Step 2 is repeated for each input symbol and for
each state of given NFA.
4. Using the resultant states the transition table for
equivalent NFA without ε can be built
11/21/20177
Sampath Kumar S, AP/CSE, SECE
Rule for conversion:
δ’(q,a) = ε-closure (δ (δ (q, ε ), a)
Where
δ (q, ε ) = ε-closure (q)
11/21/20178
Sampath Kumar S, AP/CSE, SECE
Problem to discuss:
41. Convert the following ε-NFA to NFA
11/21/20179
Sampath Kumar S, AP/CSE, SECE
Solution:
Step 1: Find ε-closure for all states:
ε-closure (q)={q, r, s}
ε-closure (r)={ r, s}
ε-closure (s)={s}
11/21/201710
Sampath Kumar S, AP/CSE, SECE
Solution:
δ’(q,a) = ε-closure (δ (q,r,s), a)
= ε-closure (δ(q,a) U δ(r,a) U δ(s,a) )
= ε-closure (q U Φ U Φ)
= ε-closure (q) = {q, r, s}
δ’(q,b) = ε-closure (δ (δ (q, ε ), b)
= ε-closure (δ (q,r,s), b)
= ε-closure (δ(q,b) U δ(r,b) U δ(s,b) )
= ε-closure (Φ U r U Φ)
= ε-closure (r) = {r, s}
11/21/201711
Sampath Kumar S, AP/CSE, SECE
Solution:
δ’(q,c) = ε-closure (δ (δ (q, ε ), c)
= ε-closure (δ (q,r,s), c)
= ε-closure (δ(q,c) U δ(r,c) U δ(s,c) )
= ε-closure (Φ U Φ U s)
= ε-closure (s) = {s}
11/21/201712
Sampath Kumar S, AP/CSE, SECE
Final Solution:
δ’(q,a) = {q, r, s}
δ’(q,b) = {r, s}
δ’(q,c) = {s}
δ’(r,a) = {Φ}
δ’(r,b) = {r, s}
δ’(r,c) = {s}
δ’(s,a) = {Φ}
δ’(s,b) = {Φ}
δ’(s,c) = {s}
11/21/201713
Sampath Kumar S, AP/CSE, SECE
Problem to discuss:
42. Convert the following ε-NFA to NFA
11/21/201714
Sampath Kumar S, AP/CSE, SECE
Conversion of ε-NFA to DFA:
The conversion of NFA to DFA involves following steps:
1. Compute ε* for the current state, resulting in a set
of the states S.
2. δ(S, a) is computed for all a Σ by
1. Let S ={p1,p2, ….. pK}
2. Compute R = δ(S, a) as
R = pi S δ(pi, a) ={r1,r2, ….. rm}
This set is achieved by the following input a, not by
following any ε transitions.
3. Add the ε transitions in by computing ε-closure(R)
3. Make a state, an accepting state if it includes any
final states in the NFA
11/21/201715
Sampath Kumar S, AP/CSE, SECE
Problem to discuss:
43. Convert the following ε-NFA to DFA
11/21/201717
Sampath Kumar S, AP/CSE, SECE
Problem to discuss:
44. Convert the given ε-NFA to its equivalent DFA
11/21/201718
Sampath Kumar S, AP/CSE, SECE
11/21/2017
Sampath Kumar S, AP/CSE, SECE
19
நன்றி
11/21/2017
Sampath Kumar S, AP/CSE, SECE
20

More Related Content

PDF
NFA to DFA
PPTX
3.5 equivalence of pushdown automata and cfl
PPTX
Bfs and Dfs
PPTX
Automata theory - NFA ε to DFA Conversion
PPTX
Simplification of cfg ppt
PDF
Parse Tree
PDF
Flat unit 1
PPTX
Push down automata
NFA to DFA
3.5 equivalence of pushdown automata and cfl
Bfs and Dfs
Automata theory - NFA ε to DFA Conversion
Simplification of cfg ppt
Parse Tree
Flat unit 1
Push down automata

What's hot (20)

PPTX
daa-unit-3-greedy method
PPTX
3.1,2,3 pushdown automata definition, moves & id
PDF
Lecture: Automata
PPTX
1.9. minimization of dfa
PPTX
1.8. equivalence of finite automaton and regular expressions
PPT
NFA or Non deterministic finite automata
PPTX
Rabin karp string matching algorithm
PDF
LR(1) CLR(1) Parser with Example
PPTX
NFA & DFA
PPTX
CONTEXT FREE GRAMMAR
PPTX
Predicate logic
PPT
Regular expressions-Theory of computation
PPTX
Automata theory - Push Down Automata (PDA)
PDF
I. AO* SEARCH ALGORITHM
PPTX
push down automata
PPTX
asymptotic notation
PPTX
Water jug problem ai part 6
PDF
Formal Languages and Automata Theory Unit 1
PPTX
PPTX
Compiler Design Unit 4
daa-unit-3-greedy method
3.1,2,3 pushdown automata definition, moves & id
Lecture: Automata
1.9. minimization of dfa
1.8. equivalence of finite automaton and regular expressions
NFA or Non deterministic finite automata
Rabin karp string matching algorithm
LR(1) CLR(1) Parser with Example
NFA & DFA
CONTEXT FREE GRAMMAR
Predicate logic
Regular expressions-Theory of computation
Automata theory - Push Down Automata (PDA)
I. AO* SEARCH ALGORITHM
push down automata
asymptotic notation
Water jug problem ai part 6
Formal Languages and Automata Theory Unit 1
Compiler Design Unit 4
Ad

Similar to 1.7. eqivalence of nfa and dfa (20)

PPTX
1.3.2 non deterministic finite automaton
PDF
Nondeterministic Finite Automata AFN.pdf
PPTX
1.3.1 deterministic finite automaton
PPTX
3.4 deterministic pda
PPT
Lecture 03 lexical analysis
PPTX
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
PDF
7-Backtracking.pdfsssssssssssssssssssssssssssssssssss
PPT
NFAvsDFA.ppt
PPTX
Automata theory - RE to DFA Conversion
PDF
Color Coding
PDF
Automata theory
PDF
Sensor Fusion Study - Ch9. Optimal Smoothing [Hayden]
PDF
BNL_Research_Report
PPT
Algorithm.ppt
PDF
Lecture 17- F19.pdf
PDF
lecture14.pdf
PDF
PDF
International Journal of Mathematics and Statistics Invention (IJMSI)
PPTX
Lec1.pptx
PDF
Theory of Computation FSM Conversions and Problems
1.3.2 non deterministic finite automaton
Nondeterministic Finite Automata AFN.pdf
1.3.1 deterministic finite automaton
3.4 deterministic pda
Lecture 03 lexical analysis
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
7-Backtracking.pdfsssssssssssssssssssssssssssssssssss
NFAvsDFA.ppt
Automata theory - RE to DFA Conversion
Color Coding
Automata theory
Sensor Fusion Study - Ch9. Optimal Smoothing [Hayden]
BNL_Research_Report
Algorithm.ppt
Lecture 17- F19.pdf
lecture14.pdf
International Journal of Mathematics and Statistics Invention (IJMSI)
Lec1.pptx
Theory of Computation FSM Conversions and Problems
Ad

More from Sampath Kumar S (19)

PPTX
5.2 primitive recursive functions
PPTX
4.7. chomskian hierarchy of languages
PPTX
4.6 halting problem
PPTX
4.3 techniques for turing machines construction
PPTX
4.2 variantsof turing machines (types of tm)
PPTX
4.1 turing machines
PPTX
3.6 & 7. pumping lemma for cfl & problems based on pl
PPTX
2.8 normal forms gnf & problems
PPTX
2.7 normal forms cnf & problems
PPTX
2.5 ambiguity in context free grammars
PPTX
2.4 derivations and languages
PPTX
2.3 context free grammars and languages
PPTX
2.1 & 2.2 grammar introduction – types of grammar
PPTX
1.10. pumping lemma for regular sets
PPTX
1.5 & 1.6 regular languages & regular expression
PPTX
1.4. finite automaton with ε moves
PPTX
1.2. introduction to automata theory
PPTX
1.1. the central concepts of automata theory
PPTX
0.0 Introduction to theory of computation
5.2 primitive recursive functions
4.7. chomskian hierarchy of languages
4.6 halting problem
4.3 techniques for turing machines construction
4.2 variantsof turing machines (types of tm)
4.1 turing machines
3.6 & 7. pumping lemma for cfl & problems based on pl
2.8 normal forms gnf & problems
2.7 normal forms cnf & problems
2.5 ambiguity in context free grammars
2.4 derivations and languages
2.3 context free grammars and languages
2.1 & 2.2 grammar introduction – types of grammar
1.10. pumping lemma for regular sets
1.5 & 1.6 regular languages & regular expression
1.4. finite automaton with ε moves
1.2. introduction to automata theory
1.1. the central concepts of automata theory
0.0 Introduction to theory of computation

Recently uploaded (20)

PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Classroom Observation Tools for Teachers
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
Trump Administration's workforce development strategy
DOC
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Computing-Curriculum for Schools in Ghana
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
O7-L3 Supply Chain Operations - ICLT Program
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Classroom Observation Tools for Teachers
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Trump Administration's workforce development strategy
Soft-furnishing-By-Architect-A.F.M.Mohiuddin-Akhand.doc
Chinmaya Tiranga quiz Grand Finale.pdf
Final Presentation General Medicine 03-08-2024.pptx
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
GDM (1) (1).pptx small presentation for students
Microbial diseases, their pathogenesis and prophylaxis
VCE English Exam - Section C Student Revision Booklet
RTP_AR_KS1_Tutor's Guide_English [FOR REPRODUCTION].pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Computing-Curriculum for Schools in Ghana

1.7. eqivalence of nfa and dfa

  • 1. Equivalence of NFA and DFA -Sampath Kumar S, AP/CSE, SECE
  • 2. Equivalence of NFA and DFA  The NFA with ε can be converted to NFA without ε and this NFA without ε can be converted to DFA. 11/21/2017 Sampath Kumar S, AP/CSE, SECE 2 ε-NFA NFA DFA
  • 3. Conversion of NFA to DFA: The conversion of NFA to DFA involves following steps: 1. QD = 2Q N. If NFA has n states. DFA at most have 2n states. 2. Σn=ΣD 3. [q0]=[q0] 4. FD = A set of all the states of QD that contains at least one of the final states of FN . 5. δD((q1,q2,q3),a)= δn(q1,a) u δn(q2,a) u δn(q3,a) ={p1,p2,p3} Add state [P1,P2,P3] to QD if it is not there 11/21/20173 Sampath Kumar S, AP/CSE, SECE
  • 4. Problem to discuss: 38. Convert the following NFA to DFA 11/21/20174 Sampath Kumar S, AP/CSE, SECE
  • 5. Problem to discuss: 39. Construct DFA equivalent to NFA M = ( {p,q,r,s}, {0,1}, δ, P, {q,s} ) where δ is defined in the following table. 11/21/20175 Sampath Kumar S, AP/CSE, SECE δ 0 1 ->p {q, s} {q} q* {r} {q,r} r {s} {p} s* - {p}
  • 6. Problem to discuss: 40. Convert the given NFA to its equivalent DFA 11/21/20176 Sampath Kumar S, AP/CSE, SECE
  • 7. Conversion of ε-NFA to NFA: The conversion of ε-NFA to NFA involves following steps: 1. Find out all the ε-transition from each state from Q. That will be called as ε-closure {qi} where qi ∈ Q. 2. Then δ’ transition can be obtained. The δ’ transition means and ε-closure on δ moves. 3. Step 2 is repeated for each input symbol and for each state of given NFA. 4. Using the resultant states the transition table for equivalent NFA without ε can be built 11/21/20177 Sampath Kumar S, AP/CSE, SECE
  • 8. Rule for conversion: δ’(q,a) = ε-closure (δ (δ (q, ε ), a) Where δ (q, ε ) = ε-closure (q) 11/21/20178 Sampath Kumar S, AP/CSE, SECE
  • 9. Problem to discuss: 41. Convert the following ε-NFA to NFA 11/21/20179 Sampath Kumar S, AP/CSE, SECE
  • 10. Solution: Step 1: Find ε-closure for all states: ε-closure (q)={q, r, s} ε-closure (r)={ r, s} ε-closure (s)={s} 11/21/201710 Sampath Kumar S, AP/CSE, SECE
  • 11. Solution: δ’(q,a) = ε-closure (δ (q,r,s), a) = ε-closure (δ(q,a) U δ(r,a) U δ(s,a) ) = ε-closure (q U Φ U Φ) = ε-closure (q) = {q, r, s} δ’(q,b) = ε-closure (δ (δ (q, ε ), b) = ε-closure (δ (q,r,s), b) = ε-closure (δ(q,b) U δ(r,b) U δ(s,b) ) = ε-closure (Φ U r U Φ) = ε-closure (r) = {r, s} 11/21/201711 Sampath Kumar S, AP/CSE, SECE
  • 12. Solution: δ’(q,c) = ε-closure (δ (δ (q, ε ), c) = ε-closure (δ (q,r,s), c) = ε-closure (δ(q,c) U δ(r,c) U δ(s,c) ) = ε-closure (Φ U Φ U s) = ε-closure (s) = {s} 11/21/201712 Sampath Kumar S, AP/CSE, SECE
  • 13. Final Solution: δ’(q,a) = {q, r, s} δ’(q,b) = {r, s} δ’(q,c) = {s} δ’(r,a) = {Φ} δ’(r,b) = {r, s} δ’(r,c) = {s} δ’(s,a) = {Φ} δ’(s,b) = {Φ} δ’(s,c) = {s} 11/21/201713 Sampath Kumar S, AP/CSE, SECE
  • 14. Problem to discuss: 42. Convert the following ε-NFA to NFA 11/21/201714 Sampath Kumar S, AP/CSE, SECE
  • 15. Conversion of ε-NFA to DFA: The conversion of NFA to DFA involves following steps: 1. Compute ε* for the current state, resulting in a set of the states S. 2. δ(S, a) is computed for all a Σ by 1. Let S ={p1,p2, ….. pK} 2. Compute R = δ(S, a) as R = pi S δ(pi, a) ={r1,r2, ….. rm} This set is achieved by the following input a, not by following any ε transitions. 3. Add the ε transitions in by computing ε-closure(R) 3. Make a state, an accepting state if it includes any final states in the NFA 11/21/201715 Sampath Kumar S, AP/CSE, SECE
  • 16. Problem to discuss: 43. Convert the following ε-NFA to DFA 11/21/201717 Sampath Kumar S, AP/CSE, SECE
  • 17. Problem to discuss: 44. Convert the given ε-NFA to its equivalent DFA 11/21/201718 Sampath Kumar S, AP/CSE, SECE
  • 18. 11/21/2017 Sampath Kumar S, AP/CSE, SECE 19

Editor's Notes

  • #2: School of EECS, WSU