SlideShare a Scribd company logo
2
Most read
6
Most read
12
Most read
Automata Theory and Logic:
NFA to DFA
A TUTORIAL
BY
ANIMESH CHATURVEDI
AT
INDIAN INSTITUTE OF TECHNOLOGY INDORE (IIT-I)
Non-Deterministic Finite Automata (NFA)
an NFA may have more than one transition labeled with a certain symbol
an NFA may have no transitions labeled with a certain symbol
transitions may be labeled with ε, the empty string.
NFAs are usually easier to design than equivalent DFAs
Every DFA is also a non-deterministic finite automata (NFA)
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
NFA
Q = {q1, q2, q3, q4}, Σ = {0, 1},
δ is
q1 is the start state, and F = {q4}.
0 1 ε
q1 {q1, q2} {q1} Ø
q2 {q3} Ø {q3}
q3 Ø {q4} Ø
q4 {q4} {q4} Ø
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
NFA v/s DFA
DFA: For every string x, there is a unique path from initial state and associated with x.
x is accepted if and only if this path ends at a final state.
NFA: For any string x, there may exist none or more than one path from initial state and
associated with x.
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Expressive power of DFA and NFA
Deterministic finite automata (DFA) and Non-deterministic finite automata (NFA) have same
expressive power.
Given an NFA N, then we construct a DFA M, that accepts the same language
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Convert NFA to DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Convert NFA to DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Convert NFA to DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Convert NFA to DFA
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
Convert NFA to DFA
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Convert NFA to DFA
Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
DFA to Minimal DFA
Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Up Next
A DFA represent a Regular Expression language
DFA or NDFA has less expressive power than Deterministic push down automata (DPDA)
References
Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University
http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
Slide by: Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
Slide by Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
NFA to DFA

More Related Content

PDF
Theory of computation and automata
PPT
NFA or Non deterministic finite automata
PDF
BRMK557 Model Question Paper – 1 Solution.pdf
PDF
Chapter 6 Flow control Instructions
PPTX
Theory of Automata and formal languages unit 2
PPTX
Introduction TO Finite Automata
PDF
ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
PPTX
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)
Theory of computation and automata
NFA or Non deterministic finite automata
BRMK557 Model Question Paper – 1 Solution.pdf
Chapter 6 Flow control Instructions
Theory of Automata and formal languages unit 2
Introduction TO Finite Automata
ARTIFICIAL INTELLIGENCE AND MACHINE LEARNING
Finite Automata: Deterministic And Non-deterministic Finite Automaton (DFA)

What's hot (20)

PPTX
Automata theory - Push Down Automata (PDA)
PDF
Deterministic Finite Automata (DFA)
PPTX
Automata theory -Conversion of ε nfa to nfa
PPTX
CLR AND LALR PARSER
PPTX
Moore Mealy Machine Conversion
PPTX
Regular expressions
PPTX
Pumping lemma Theory Of Automata
PPTX
Finite automata-for-lexical-analysis
PPTX
Traveling salesman problem
PPTX
Automata theory - NFA ε to DFA Conversion
PPTX
Chomsky classification of Language
PPT
Finite automata
PPTX
serializability in dbms
PPTX
NFA & DFA
PDF
Automata theory
PPTX
1.10. pumping lemma for regular sets
PPTX
Alphabets , strings, languages and grammars
PPT
pushdown automata
PPT
Sum of subsets problem by backtracking 
Automata theory - Push Down Automata (PDA)
Deterministic Finite Automata (DFA)
Automata theory -Conversion of ε nfa to nfa
CLR AND LALR PARSER
Moore Mealy Machine Conversion
Regular expressions
Pumping lemma Theory Of Automata
Finite automata-for-lexical-analysis
Traveling salesman problem
Automata theory - NFA ε to DFA Conversion
Chomsky classification of Language
Finite automata
serializability in dbms
NFA & DFA
Automata theory
1.10. pumping lemma for regular sets
Alphabets , strings, languages and grammars
pushdown automata
Sum of subsets problem by backtracking 
Ad

Viewers also liked (20)

PPT
Minimization of DFA
PPTX
optimization of DFA
PPT
Nfa vs dfa
PPTX
Optimization of dfa
PPTX
Programming Languages / Translators
PPT
Bottom - Up Parsing
PPT
DFA Minimization
PPT
Lexical Analysis
PPTX
Lexical analysis - Compiler Design
PPTX
Programming languages,compiler,interpreter,softwares
PPT
Dfa vs nfa
PPTX
Compiler Chapter 1
PPTX
Intermediate code- generation
PPTX
Phases of Compiler
PPTX
Translators(Compiler, Assembler) and interpreter
PPT
Lexical analyzer
PPT
Intermediate code generation
PPT
Language translator
PPTX
Lexical analyzer
PPTX
Code generation
Minimization of DFA
optimization of DFA
Nfa vs dfa
Optimization of dfa
Programming Languages / Translators
Bottom - Up Parsing
DFA Minimization
Lexical Analysis
Lexical analysis - Compiler Design
Programming languages,compiler,interpreter,softwares
Dfa vs nfa
Compiler Chapter 1
Intermediate code- generation
Phases of Compiler
Translators(Compiler, Assembler) and interpreter
Lexical analyzer
Intermediate code generation
Language translator
Lexical analyzer
Code generation
Ad

More from Animesh Chaturvedi (20)

PDF
Cloud Platforms & Frameworks
PDF
Cloud platforms and frameworks
PDF
Cloud service lifecycle management
PDF
Graph Analytics and Complexity Questions and answers
PDF
Advance Systems Engineering Topics
PDF
P, NP, NP-Complete, and NP-Hard
PDF
System Development Life Cycle (SDLC)
PDF
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
PDF
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
PDF
C- Programming Assignment practice set 2 solutions
PDF
C- Programming Assignment 4 solution
PDF
C- Programming Assignment 3
PDF
C - Programming Assignment 1 and 2
PDF
System requirements engineering
PDF
Informatics systems
PDF
Introduction to Systems Engineering
PDF
Big Data Analytics and Ubiquitous computing
PDF
Cloud Platforms and Frameworks
PDF
Cloud Service Life-cycle Management
PDF
Push Down Automata (PDA)
Cloud Platforms & Frameworks
Cloud platforms and frameworks
Cloud service lifecycle management
Graph Analytics and Complexity Questions and answers
Advance Systems Engineering Topics
P, NP, NP-Complete, and NP-Hard
System Development Life Cycle (SDLC)
Shortest path, Bellman-Ford's algorithm, Dijkastra's algorithm, their Java co...
Minimum Spanning Tree (MST), Kruskal's algorithm and Prim's Algorithm, and th...
C- Programming Assignment practice set 2 solutions
C- Programming Assignment 4 solution
C- Programming Assignment 3
C - Programming Assignment 1 and 2
System requirements engineering
Informatics systems
Introduction to Systems Engineering
Big Data Analytics and Ubiquitous computing
Cloud Platforms and Frameworks
Cloud Service Life-cycle Management
Push Down Automata (PDA)

Recently uploaded (20)

PPTX
web development for engineering and engineering
DOCX
573137875-Attendance-Management-System-original
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Well-logging-methods_new................
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
PPT on Performance Review to get promotions
PPTX
CH1 Production IntroductoryConcepts.pptx
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Sustainable Sites - Green Building Construction
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
web development for engineering and engineering
573137875-Attendance-Management-System-original
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Well-logging-methods_new................
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT on Performance Review to get promotions
CH1 Production IntroductoryConcepts.pptx
Embodied AI: Ushering in the Next Era of Intelligent Systems
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Structs to JSON How Go Powers REST APIs.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Sustainable Sites - Green Building Construction
Lesson 3_Tessellation.pptx finite Mathematics
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Foundation to blockchain - A guide to Blockchain Tech

NFA to DFA

  • 1. Automata Theory and Logic: NFA to DFA A TUTORIAL BY ANIMESH CHATURVEDI AT INDIAN INSTITUTE OF TECHNOLOGY INDORE (IIT-I)
  • 2. Non-Deterministic Finite Automata (NFA) an NFA may have more than one transition labeled with a certain symbol an NFA may have no transitions labeled with a certain symbol transitions may be labeled with ε, the empty string. NFAs are usually easier to design than equivalent DFAs Every DFA is also a non-deterministic finite automata (NFA) Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
  • 3. NFA Q = {q1, q2, q3, q4}, Σ = {0, 1}, δ is q1 is the start state, and F = {q4}. 0 1 ε q1 {q1, q2} {q1} Ø q2 {q3} Ø {q3} q3 Ø {q4} Ø q4 {q4} {q4} Ø Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf
  • 4. NFA v/s DFA DFA: For every string x, there is a unique path from initial state and associated with x. x is accepted if and only if this path ends at a final state. NFA: For any string x, there may exist none or more than one path from initial state and associated with x. Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 5. Expressive power of DFA and NFA Deterministic finite automata (DFA) and Non-deterministic finite automata (NFA) have same expressive power. Given an NFA N, then we construct a DFA M, that accepts the same language Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
  • 6. Convert NFA to DFA Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
  • 7. Convert NFA to DFA Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
  • 8. Convert NFA to DFA Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
  • 9. Convert NFA to DFA Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
  • 10. Convert NFA to DFA Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html
  • 11. Convert NFA to DFA Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 12. Convert NFA to DFA Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 13. Convert NFA to DFA Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 14. Convert NFA to DFA Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt
  • 15. DFA to Minimal DFA Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf
  • 16. Up Next A DFA represent a Regular Expression language DFA or NDFA has less expressive power than Deterministic push down automata (DPDA)
  • 17. References Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University http://www.cs.tau.ac.il/~orilahav/CompModelFall10/Compute2-print.pdf Slide by: Dr. Harry H. Porter http://web.cecs.pdx.edu/~harry/compilers/slides/LexicalPart3.pdf Slide by Dr. Ding-Zhu Du http://www.utdallas.edu/~dzdu/cs4384/lect7.ppt Prof. Shunichi Toida http://www.cs.odu.edu/~toida/nerzic/390teched/regular/fa/nfa-2-dfa.html