SlideShare a Scribd company logo
1 of 26
NFA CONVERSION TO DFA
Author : Abdullah Jan
Non-deterministic Automaton.
• In NDFA, for a particular input symbol, the machine can move to any
combination of the states in the machine. Hence, it is called Non-
deterministic Automaton.
• Formal Definition of an NDFA
• An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −
• Q is a finite set of states.
• ∑ is a finite set of symbols called the alphabets.
• δ is the transition function where δ: Q × ∑ → 2Q
• (Here the power set of Q (2Q) has been taken because in case of NDFA,
from a state, transition can occur to any combination of Q states)
Deterministic Finite Automaton (DFA)
• Deterministic Finite Automaton (DFA)
• In DFA, for each input symbol, one can determine the state to which the machine will
move.
• Hence, it is called Deterministic Automaton.
• As it has a finite number of states, the machine is called Deterministic Finite Machine
or Deterministic Finite Automaton
•Q is a finite set of states.
•∑ is a finite set of symbols called the alphabet.
•δ is the transition function where δ: Q × ∑ → Q
Properties
NFA
• “NFA” stands for “Nondeterministic
Finite Automata.”
• In NFA each pair of state and input
symbol can have many possible next
states.
• NFA can use empty string transition
• NFA is easier to construct
• NFA requires less space
DFA
• DFA” stands for “Deterministic Finite
Automata”
• In DFA the next possible state is
distinctly set
• DFA cannot use empty string
transition.
• It is more difficult to construct DFA.
• DFA requires more space
Conversion of NFA TO DFA
• Every DFA is an NFA But not vice versa
DFA δ = Q x ∑ -> Q NFA δ = Q x ∑ -> 2Q
• But there is an equivalent DFA For every NFA
NFA ˜ DFA=
Important point
• In DFA we combine two state into single state.
• In DFA there is only one transition to only one state
EXAMPLE NO1 ON CONVERSION
• L = {set of all strings over (0,1) that start with ‘0’}
∑ = {0,1)
NFA:
A B
O,1
State 0 1
->A B ɸ
B B B
NFA converter into DFA
• DFA
A B
O,1
State 0 1
->A B C
B B B
C C C
O
C
1
EXAMPLE 2
• L = {set of all string over(0,1) that end with ‘1’}
• ∑ = {0,1)1
A B
State 0 1
->A B {A,B}
ɸ ɸ
O,1
1
B
NFA converted into DFA
A AB
State 0 1
->A B {AB}
A {AB}
1
O 1
O AB
Example 3
• L = {Set of all string over(0,1) that end with ‘01’}
• NFA
A C
O,1
State 0 1
->A {A,B} A
B ɸ C
ɸ ɸ
B
O 1
C
NFA converted into DFA
A
AB
State 0 1
->A AB A
AB AB AC
AB A
0
1 0
1
AB
0 1
AC
Example 4 NFA
• M= [ {A,B,C},(a,b), δ,A,{C}]
• NFA AND DFA is represented by 5 tuple
State a b
->A {A,B} C
B A B
ɸ {A,B}
AB
AB
a
A
b
a
a
b
bb
C
NFA converted into DFA
A
BC
State 0 1
->A AB C
AB AB BC
A AB
D AB
D D D
a
b a
a
AB
b b
C
D
a
a,b
b
BC
C
Assignment for home
• Assignment : try to find out what type of string this NFA and
Equivalent DFA accepted
Transition Graph
• Properties:
• Can have more than one initial state
• Empty transaction is allowed
• We allow the machine to real move than one character at a time
• If ∑ = {a,b} Draw TG for all string containing bbb or aaa
• (a+b)* (aaa+bbb) (a+b)*
• TG reduced the complexity of NFA and DFA
Transition Graph
A
A
B
a,b
a,b
a,b
MINIMIZATION OF DFA
• Minimization of DFA is required to obtain the minimal version of any
DFA which consists of the minimum number of states possible
• DFA 5 state 4 state
00000 0000
These two are equivalent Two state ‘A’ and ‘B’ are said to be equivalent
δ(A,X) -> F δ(A,X) -> F
and and
δ (B,X) ->F δ (B,X) -> F
MINIMIZATION OF DFA
• If |X| = 0, then A and B are said to be 0 equivalent
• If |X| = 1, then A and B are said to be 1 equivalent
• If |X| = 2, then A and B are said to be 2 equivalent
.
.
.
if|X| = n then A and B are said to be n equivalent
We need these properties to combined two state and make one state
to get minimal version DFA
Example Part1
A
C
DB
E
0
1
0
1
1
1
1
State 0 1
->A B C
B B D
C B C
D B E
B CE
Example Part1
• 0 equivalence {A,B,C,D} {E}
• 1 equivalence {A,B,C) {D} {E}
• 2 equivalence {A,C} {B} {D} {E}
• 3 equivalence {A,C} {B} {D} {E}
When you find two row gives consecutive result than it time to stop the
process
Result both are
same
Example Part1
AC
E
DB
Particle work to create NFA AND DFA IN JFLAP
Particle work to create NFA AND DFA IN JFLAP
Assignment
• Thompson subset construction
Work Smart Not hard

More Related Content

What's hot

Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
Srimatre K
 

What's hot (20)

Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1Formal Languages and Automata Theory Unit 1
Formal Languages and Automata Theory Unit 1
 
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDAPush Down Automata (PDA) | TOC  (Theory of Computation) | NPDA | DPDA
Push Down Automata (PDA) | TOC (Theory of Computation) | NPDA | DPDA
 
Turing machine-TOC
Turing machine-TOCTuring machine-TOC
Turing machine-TOC
 
NFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushikNFA Non Deterministic Finite Automata by Mudasir khushik
NFA Non Deterministic Finite Automata by Mudasir khushik
 
Minimization of DFA.pptx
Minimization of DFA.pptxMinimization of DFA.pptx
Minimization of DFA.pptx
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
 
language , grammar and automata
language , grammar and automatalanguage , grammar and automata
language , grammar and automata
 
push down automata
push down automatapush down automata
push down automata
 
Parsing
ParsingParsing
Parsing
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Finite automata
Finite automataFinite automata
Finite automata
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
 
Theory of automata and formal language
Theory of automata and formal languageTheory of automata and formal language
Theory of automata and formal language
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
COMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed TranslationCOMPILER DESIGN- Syntax Directed Translation
COMPILER DESIGN- Syntax Directed Translation
 
Specification-of-tokens
Specification-of-tokensSpecification-of-tokens
Specification-of-tokens
 
NFA or Non deterministic finite automata
NFA or Non deterministic finite automataNFA or Non deterministic finite automata
NFA or Non deterministic finite automata
 
Regular expressions-Theory of computation
Regular expressions-Theory of computationRegular expressions-Theory of computation
Regular expressions-Theory of computation
 
pushdown automata
pushdown automatapushdown automata
pushdown automata
 
Theory of computation Lec3 dfa
Theory of computation Lec3 dfaTheory of computation Lec3 dfa
Theory of computation Lec3 dfa
 

Similar to NFA Converted to DFA , Minimization of DFA , Transition Diagram

deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfdeterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
AmayJaiswal4
 
Finite Automata fgyft rtrt rr uuy y.pptx
Finite Automata fgyft rtrt  rr uuy y.pptxFinite Automata fgyft rtrt  rr uuy y.pptx
Finite Automata fgyft rtrt rr uuy y.pptx
AsadBaig49
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
Adel Al-Ofairi
 
finiteautomata-160104102657.pptx
finiteautomata-160104102657.pptxfiniteautomata-160104102657.pptx
finiteautomata-160104102657.pptx
StudyvAbhi
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
FariyaTasneem1
 

Similar to NFA Converted to DFA , Minimization of DFA , Transition Diagram (20)

Nondeterministic Finite Automata
Nondeterministic Finite Automata Nondeterministic Finite Automata
Nondeterministic Finite Automata
 
Automata
AutomataAutomata
Automata
 
CS 5th.pptx
CS 5th.pptxCS 5th.pptx
CS 5th.pptx
 
deterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdfdeterministicfiniteautomatondfa-181008145215 (1).pdf
deterministicfiniteautomatondfa-181008145215 (1).pdf
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Finite Automata fgyft rtrt rr uuy y.pptx
Finite Automata fgyft rtrt  rr uuy y.pptxFinite Automata fgyft rtrt  rr uuy y.pptx
Finite Automata fgyft rtrt rr uuy y.pptx
 
TOC Introduction
TOC Introduction TOC Introduction
TOC Introduction
 
Theory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and ProblemsTheory of Computation FSM Conversions and Problems
Theory of Computation FSM Conversions and Problems
 
5. NFA & DFA.pdf
5. NFA & DFA.pdf5. NFA & DFA.pdf
5. NFA & DFA.pdf
 
1. finite_automata_new.ppt
1. finite_automata_new.ppt1. finite_automata_new.ppt
1. finite_automata_new.ppt
 
Nondeterministic Finite Automat
Nondeterministic Finite AutomatNondeterministic Finite Automat
Nondeterministic Finite Automat
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
FiniteAutomata_anim.pptx
FiniteAutomata_anim.pptxFiniteAutomata_anim.pptx
FiniteAutomata_anim.pptx
 
finiteautomata-160104102657.pptx
finiteautomata-160104102657.pptxfiniteautomata-160104102657.pptx
finiteautomata-160104102657.pptx
 
Finite automata
Finite automataFinite automata
Finite automata
 
minimization the number of states of DFA
minimization the number of states of DFAminimization the number of states of DFA
minimization the number of states of DFA
 
flat unit1
flat unit1flat unit1
flat unit1
 
Implementation of lexical analyser
Implementation of lexical analyserImplementation of lexical analyser
Implementation of lexical analyser
 
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf@vtucode.in-module-1-21CS51-5th-semester (1).pdf
@vtucode.in-module-1-21CS51-5th-semester (1).pdf
 
Theory of automata
Theory of automataTheory of automata
Theory of automata
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Economic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food AdditivesEconomic Importance Of Fungi In Food Additives
Economic Importance Of Fungi In Food Additives
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Our Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdfOur Environment Class 10 Science Notes pdf
Our Environment Class 10 Science Notes pdf
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 

NFA Converted to DFA , Minimization of DFA , Transition Diagram

  • 1. NFA CONVERSION TO DFA Author : Abdullah Jan
  • 2. Non-deterministic Automaton. • In NDFA, for a particular input symbol, the machine can move to any combination of the states in the machine. Hence, it is called Non- deterministic Automaton. • Formal Definition of an NDFA • An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where − • Q is a finite set of states. • ∑ is a finite set of symbols called the alphabets. • δ is the transition function where δ: Q × ∑ → 2Q • (Here the power set of Q (2Q) has been taken because in case of NDFA, from a state, transition can occur to any combination of Q states)
  • 3. Deterministic Finite Automaton (DFA) • Deterministic Finite Automaton (DFA) • In DFA, for each input symbol, one can determine the state to which the machine will move. • Hence, it is called Deterministic Automaton. • As it has a finite number of states, the machine is called Deterministic Finite Machine or Deterministic Finite Automaton •Q is a finite set of states. •∑ is a finite set of symbols called the alphabet. •δ is the transition function where δ: Q × ∑ → Q
  • 4. Properties NFA • “NFA” stands for “Nondeterministic Finite Automata.” • In NFA each pair of state and input symbol can have many possible next states. • NFA can use empty string transition • NFA is easier to construct • NFA requires less space DFA • DFA” stands for “Deterministic Finite Automata” • In DFA the next possible state is distinctly set • DFA cannot use empty string transition. • It is more difficult to construct DFA. • DFA requires more space
  • 5. Conversion of NFA TO DFA • Every DFA is an NFA But not vice versa DFA δ = Q x ∑ -> Q NFA δ = Q x ∑ -> 2Q • But there is an equivalent DFA For every NFA NFA ˜ DFA=
  • 6. Important point • In DFA we combine two state into single state. • In DFA there is only one transition to only one state
  • 7. EXAMPLE NO1 ON CONVERSION • L = {set of all strings over (0,1) that start with ‘0’} ∑ = {0,1) NFA: A B O,1 State 0 1 ->A B ɸ B B B
  • 8. NFA converter into DFA • DFA A B O,1 State 0 1 ->A B C B B B C C C O C 1
  • 9. EXAMPLE 2 • L = {set of all string over(0,1) that end with ‘1’} • ∑ = {0,1)1 A B State 0 1 ->A B {A,B} ɸ ɸ O,1 1 B
  • 10. NFA converted into DFA A AB State 0 1 ->A B {AB} A {AB} 1 O 1 O AB
  • 11. Example 3 • L = {Set of all string over(0,1) that end with ‘01’} • NFA A C O,1 State 0 1 ->A {A,B} A B ɸ C ɸ ɸ B O 1 C
  • 12. NFA converted into DFA A AB State 0 1 ->A AB A AB AB AC AB A 0 1 0 1 AB 0 1 AC
  • 13. Example 4 NFA • M= [ {A,B,C},(a,b), δ,A,{C}] • NFA AND DFA is represented by 5 tuple State a b ->A {A,B} C B A B ɸ {A,B} AB AB a A b a a b bb C
  • 14. NFA converted into DFA A BC State 0 1 ->A AB C AB AB BC A AB D AB D D D a b a a AB b b C D a a,b b BC C
  • 15. Assignment for home • Assignment : try to find out what type of string this NFA and Equivalent DFA accepted
  • 16. Transition Graph • Properties: • Can have more than one initial state • Empty transaction is allowed • We allow the machine to real move than one character at a time • If ∑ = {a,b} Draw TG for all string containing bbb or aaa • (a+b)* (aaa+bbb) (a+b)* • TG reduced the complexity of NFA and DFA
  • 18. MINIMIZATION OF DFA • Minimization of DFA is required to obtain the minimal version of any DFA which consists of the minimum number of states possible • DFA 5 state 4 state 00000 0000 These two are equivalent Two state ‘A’ and ‘B’ are said to be equivalent δ(A,X) -> F δ(A,X) -> F and and δ (B,X) ->F δ (B,X) -> F
  • 19. MINIMIZATION OF DFA • If |X| = 0, then A and B are said to be 0 equivalent • If |X| = 1, then A and B are said to be 1 equivalent • If |X| = 2, then A and B are said to be 2 equivalent . . . if|X| = n then A and B are said to be n equivalent We need these properties to combined two state and make one state to get minimal version DFA
  • 20. Example Part1 A C DB E 0 1 0 1 1 1 1 State 0 1 ->A B C B B D C B C D B E B CE
  • 21. Example Part1 • 0 equivalence {A,B,C,D} {E} • 1 equivalence {A,B,C) {D} {E} • 2 equivalence {A,C} {B} {D} {E} • 3 equivalence {A,C} {B} {D} {E} When you find two row gives consecutive result than it time to stop the process Result both are same
  • 23. Particle work to create NFA AND DFA IN JFLAP
  • 24. Particle work to create NFA AND DFA IN JFLAP