SlideShare a Scribd company logo
NFA to Minimized DFA
RE to DFA
• To convert RE to NFA use – Thompson’s algorithm
• To convert NFA to DFA use – Subset Construction algorithm
• To minimize the obtained DFA use – Tabulation method (also called
Mark/Reduce procedure)
Subset construction algorithm
Step 1: Find the λ-closure of all the states
Step 2: Let the λ-closure of the initial state be named as A
Step 3: Now find the transitions of each input symbol on this state A.
Then, find the λ-closure of the above set and name it as A if it appears
to be same otherwise give a new name as B.
Step 4: Repeat Step 3 for each of the new states added until there are
no new states in the queue.
Step 5: Convert the above representation to a DFA. The initial state of
the DFA will be A. Mark the final states of DFA.
Example 1
• Convert the RE (a+b)*abb to a minimized DFA
λ-closure(0) = {0, 1, 2, 4, 7} λ-closure(4) = {4} λ-closure(8) = {8}
λ-closure(1) = {1, 2, 4} λ-closure(5) = {1, 2, 4, 5, 6, 7} λ-closure(9) = {9}
λ-closure(2) = {2} λ-closure(6) = {1, 2, 4, 6, 7} λ-closure(10) = {10}
λ-closure(3) = {1, 2, 3, 4, 6, 7} λ-closure(7) = {7}
Example 1
λ-closure(0) = {0, 1, 2, 4, 7} – A
λ-closure(ẟ(A, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B
λ-closure(ẟ(A, b)) = λ-closure(5) = {1, 2, 4, 5, 6, 7} – C
λ-closure(ẟ(B, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B
λ-closure(ẟ(B, b)) = λ-closure(5, 9) = {1, 2, 4, 5, 6, 7, 9} – D
λ-closure(ẟ(C, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B
λ-closure(ẟ(C, b)) = λ-closure(5) = {1, 2, 4, 5, 6, 7} – C
λ-closure(ẟ(D, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B
λ-closure(ẟ(D, b)) = λ-closure(5, 10) = {1, 2, 4, 5, 6, 7, 10} – E
λ-closure(ẟ(E, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B
λ-closure(ẟ(E, b)) = λ-closure(5) = {1, 2, 4, 5, 6, 7} – C
Example 1 – Final DFA
States a b
-> A B C
B B D
C B C
D B E
* E B C
A
B
C
D
E
E
a
a
a
a
a
b
b
b
b
b
DFA Minimization – Tabulation Method
States a b
-> A B C
B B D
C B C
D B E
* E B C
B
C
D
E
A B C D
Mark/Reduce Procedure
Pair – (AC)
Minimized DFA
States a b
-> A B C
B B D
C B C
D B E
* E B C
States a b
-> A B A
B B D
D B E
* E B A
A
B D
E
E
b b
b
b
a
a
a
a
Mark/Reduce Procedure
Example 2
• Find the minimal DFA for abb(a+b)*
Example 2
λ-closure(0) = {0} λ-closure(1) = {1} λ-closure(2) = {2}
λ-closure(3) = {3, 4, 5, 7, 10} λ-closure(4) = {4, 5, 7} λ-closure(5) = {5}
λ-closure(6) = {4, 5, 6, 7, 9, 10} λ-closure(7) = {7} λ-closure(8) = {4, 5, 7, 8, 9, 10}
λ-closure(9) = {4, 5, 7, 9, 10} λ-closure(10) = {10}
Example 2 – Subset Alg.
• λ-closure(0) = {0} - A
• λ-closure(ẟ(A, a)) = λ-closure(1) = {1} – B
• λ-closure(ẟ(A, b)) = φ
• λ-closure(ẟ(B, a)) = φ
• λ-closure(ẟ(B, b)) = λ-closure(2) = {2} – C
• λ-closure(ẟ(C, a)) = φ
• λ-closure(ẟ(C, b)) = λ-closure(3) = {3, 4, 5, 7, 10} – D
Example 2
• λ-closure(ẟ(D, a)) = λ-closure(6) = {4, 5, 6, 7, 9, 10} – E
• λ-closure(ẟ(D, b)) = λ-closure(8) = {4, 5, 7, 8, 9, 10} – F
• λ-closure(ẟ(E, a)) = λ-closure(6) = {4, 5, 6, 7, 9, 10} – E
• λ-closure(ẟ(E, b)) = λ-closure(8) = {4, 5, 7, 8, 9, 10} – F
• λ-closure(ẟ(F, a)) = λ-closure(6) = {4, 5, 6, 7, 9, 10} – E
• λ-closure(ẟ(F, b)) = λ-closure(8) = {4, 5, 7, 8, 9, 10} – F
Example 2 - Minimization
States a b
-> A B φ
B φ C
C φ D
* D E F
* E E F
* F E F
B
C
D
E
F
A B C D E
Pairs
{{DE}{DF}}
{EF} => {DEF}
Example 2 – Minimized DFA
States a b
-> A B φ
B φ C
C φ D
* D D D
A B C D
D
T
a
b
a
b
a
b
a, b
a, b
Example 3
• Convert to minimized DFA
• λ-closure(q0) = {q0}
• λ-closure(q1) = {q1}
• λ-closure(q2) = {q2}
q0 q1
q1 q2
0
0, 1 0, 1
1
Example 3
• λ-closure(q0) = {q0} – A
• λ-closure(ẟ(A, 0)) = λ-closure(q0,q1} = {q0,q1} – B
• λ-closure(ẟ(A, 1)) = λ-closure(q1} = {q1} – C
• λ-closure(ẟ(B, 0)) = λ-closure(q0,q1,q2} = {q0,q1,q2} – D
• λ-closure(ẟ(B, 1)) = λ-closure(q1,q2} = {q1,q2} – E
• λ-closure(ẟ(C, 0)) = λ-closure(q2} = {q2} – F
• λ-closure(ẟ(C, 1)) = λ-closure(q2} = {q2} – F
• λ-closure(ẟ(D, 0)) = λ-closure(q0,q1,q2} = {q0,q1,q2} – D
• λ-closure(ẟ(D, 1)) = λ-closure(q1,q2} = {q1,q2} - E
Example 3
• λ-closure(ẟ(E, 0)) = λ-closure(q2} = {q2} – F
• λ-closure(ẟ(E, 1)) = λ-closure(q2} = {q2} – F
• λ-closure(ẟ(F, 0)) = φ
• λ-closure(ẟ(F, 1)) = λ-closure(q2} = {q2} - F
States 0 1
-> A B C
*B D E
*C F F
*D D E
*E F F
F φ F
Example 3
B
C
D
E
F
A B C D E
States 0 1
-> A B C
*B D E
*C F F
*D D E
*E F F
F φ F
Pairs:
(BD), (CE)
Example 3 – Minimized DFA
• Let (BD) be X
• Let (CE) be Y
States 0 1
-> A B C
*B D E
*C F F
*D D E
*E F F
F φ F
States 0 1
-> A X Y
*X X Y
*Y F F
F φ F
A
X
Y
F
X
Y
1
0
1
0
0, 1
0, 1
0
Example 4
• Find the minimized DFA for the given NFA
• λ-closure(q0) = {q0, q1}
• λ-closure(q1) = {q1}
• λ-closure(q2) = {q2}
q0 q1 q2
q1
0
0, λ
1
0, 1
1
Example 4
• λ-closure(q0) = {q0, q1} - A
• λ-closure(ẟ(A, 0)) = λ-closure(q0, q1, q2) = {q0, q1, q2} – B
• λ-closure(ẟ(A, 1)) = λ-closure(q1, q2) = {q1, q2} – C
• λ-closure(ẟ(B, 0)) = λ-closure(q0, q1, q2) = {q0, q1, q2} – B
• λ-closure(ẟ(B, 1)) = λ-closure(q1, q2) = {q1, q2} – C
• λ-closure(ẟ(C, 0)) = λ-closure(q0, q2) = {q0, q1, q2} – B
• λ-closure(ẟ(C, 1)) = λ-closure(q1, q2) = {q1, q2} - C
Example 4
B
C
A B
States 0 1
->* A B C
*B B C
*C B C
All pairs are
indistinguishable
So, {ABC} is a single
state
X
X
0, 1
Example 5 - Minimize the given DFA
• First draw the DFA and check if all
the states are reachable from start
state
• The sets are {q1, q2, q3} and {q2,
q3}.
• So, {q1, q2, q3} can be combined
into one state
States 0 1
-> q0 q1 q3
q1 q2 q4
q2 q1 q4
q3 q2 q4
*q4 q4 q4
q1
q2
q3
q4
q0 q1 q2 q3
States 0 1
-> q0 X X
X X q4
*q4 q4 q4
Exercises – NFA to Minimized DFA
1.
2.
A B X
C
a
b c
λ λ
A B C
B
0 1
0,1 0,1
Exercises – NFA to Minimized DFA
3.
4. RE ab*a(a+b)
5. RE (0+1)+(0+1)*
6. 𝐿 = 𝑎𝑛𝑏𝑚 ∶ n ≥ 1, m ≥ 2
7. 𝐿 = 𝑎𝑛b: n ≥ 1} ⋃ {𝑏𝑛a ∶ n ≥ 1
A B X
C
a
b a, b
a, λ b, λ
b, λ
Exercises – Minimize the DFA
8. 9.
States 0 1
-> A B F
B G C
*C A C
D C G
E H F
F C G
G G E
H G C
Exercises
10.

More Related Content

What's hot

Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
Akhil Kaushik
 
0/1 knapsack
0/1 knapsack0/1 knapsack
0/1 knapsack
Amin Omi
 
Knapsack problem
Knapsack problemKnapsack problem
Knapsack problem
Vikas Sharma
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
Madhu Bala
 
Module 11
Module 11Module 11
Module 11
bittudavis
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
Zahid Parvez
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
Mohamed Loey
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
NFA & DFA
NFA & DFANFA & DFA
NFA & DFA
Akhil Kaushik
 
5.2 primitive recursive functions
5.2 primitive recursive functions5.2 primitive recursive functions
5.2 primitive recursive functions
Sampath Kumar S
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
Protap Mondal
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - Notes
Omprakash Chauhan
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
meresie tesfay
 
Generalized transition graphs
Generalized transition graphsGeneralized transition graphs
Generalized transition graphsArham Khan G
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
Rajendran
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsEhtisham Ali
 
N queen problem
N queen problemN queen problem
N queen problem
Ridhima Chowdhury
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Mohanlal Sukhadia University (MLSU)
 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
rajshreemuthiah
 
Insertion sort bubble sort selection sort
Insertion sort bubble sort  selection sortInsertion sort bubble sort  selection sort
Insertion sort bubble sort selection sort
Ummar Hayat
 

What's hot (20)

Parsing in Compiler Design
Parsing in Compiler DesignParsing in Compiler Design
Parsing in Compiler Design
 
0/1 knapsack
0/1 knapsack0/1 knapsack
0/1 knapsack
 
Knapsack problem
Knapsack problemKnapsack problem
Knapsack problem
 
Greedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack ProblemGreedy Algorithm - Knapsack Problem
Greedy Algorithm - Knapsack Problem
 
Module 11
Module 11Module 11
Module 11
 
CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR CONTEXT FREE GRAMMAR
CONTEXT FREE GRAMMAR
 
Algorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms IAlgorithms Lecture 2: Analysis of Algorithms I
Algorithms Lecture 2: Analysis of Algorithms I
 
Optimal binary search tree dynamic programming
Optimal binary search tree   dynamic programmingOptimal binary search tree   dynamic programming
Optimal binary search tree dynamic programming
 
NFA & DFA
NFA & DFANFA & DFA
NFA & DFA
 
5.2 primitive recursive functions
5.2 primitive recursive functions5.2 primitive recursive functions
5.2 primitive recursive functions
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - Notes
 
Ch3 4 regular expression and grammar
Ch3 4 regular expression and grammarCh3 4 regular expression and grammar
Ch3 4 regular expression and grammar
 
Generalized transition graphs
Generalized transition graphsGeneralized transition graphs
Generalized transition graphs
 
Recursion tree method
Recursion tree methodRecursion tree method
Recursion tree method
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
N queen problem
N queen problemN queen problem
N queen problem
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
Hashing in datastructure
Hashing in datastructureHashing in datastructure
Hashing in datastructure
 
Insertion sort bubble sort selection sort
Insertion sort bubble sort  selection sortInsertion sort bubble sort  selection sort
Insertion sort bubble sort selection sort
 

Similar to 7-NFA to Minimized DFA.pptx

Automata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA ConversionAutomata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA Conversion
Akila Krishnamoorthy
 
12 white box testing-fixed
12 white box testing-fixed12 white box testing-fixed
12 white box testing-fixed
Jasmine Tulin
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
eugenesri
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
parmeet834
 
PushdownAutomata.ppt
PushdownAutomata.pptPushdownAutomata.ppt
PushdownAutomata.ppt
RSRS39
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
Sahil Kumar
 
A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...
A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...
A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...
Federico Cerutti
 
Math
MathMath
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
Amit Kumar Rathi
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
shruti533256
 
SMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last versionSMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last versionLilyana Vankova
 
Algebra and function
Algebra and functionAlgebra and function
Algebra and function
Azlan Ahmad
 
Lex analysis
Lex analysisLex analysis
Lex analysis
Suhit Kulkarni
 
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
BGS Institute of Technology, Adichunchanagiri University (ACU)
 
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
venkatapranaykumarGa
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
mihir jain
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examplesankitamakin
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
ankitamakin
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuacionesNatalia
 

Similar to 7-NFA to Minimized DFA.pptx (20)

Automata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA ConversionAutomata theory - NFA ε to DFA Conversion
Automata theory - NFA ε to DFA Conversion
 
Finite automata
Finite automataFinite automata
Finite automata
 
12 white box testing-fixed
12 white box testing-fixed12 white box testing-fixed
12 white box testing-fixed
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
 
Pushdown automata
Pushdown automataPushdown automata
Pushdown automata
 
PushdownAutomata.ppt
PushdownAutomata.pptPushdownAutomata.ppt
PushdownAutomata.ppt
 
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
ADA - Minimum Spanning Tree Prim Kruskal and Dijkstra
 
A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...
A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...
A SCC Recursive Meta-Algorithm for Computing Preferred Labellings in Abstract...
 
Math
MathMath
Math
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf6-Nfa & equivalence with RE.pdf
6-Nfa & equivalence with RE.pdf
 
SMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last versionSMB_2012_HR_VAN_ST-last version
SMB_2012_HR_VAN_ST-last version
 
Algebra and function
Algebra and functionAlgebra and function
Algebra and function
 
Lex analysis
Lex analysisLex analysis
Lex analysis
 
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
4th Semeste Electronics and Communication Engineering (June-2016) Question Pa...
 
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
4-Regular expression to Deterministic Finite Automata (Direct method)-05-05-2...
 
KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)KARNAUGH MAP(K-MAP)
KARNAUGH MAP(K-MAP)
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Finite automata examples
Finite automata examplesFinite automata examples
Finite automata examples
 
Raices de ecuaciones
Raices de ecuacionesRaices de ecuaciones
Raices de ecuaciones
 

Recently uploaded

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
ArianaBusciglio
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
taiba qazi
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
IreneSebastianRueco1
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 

Recently uploaded (20)

Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Group Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana BuscigliopptxGroup Presentation 2 Economics.Ariana Buscigliopptx
Group Presentation 2 Economics.Ariana Buscigliopptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
DRUGS AND ITS classification slide share
DRUGS AND ITS classification slide shareDRUGS AND ITS classification slide share
DRUGS AND ITS classification slide share
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
RPMS TEMPLATE FOR SCHOOL YEAR 2023-2024 FOR TEACHER 1 TO TEACHER 3
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 

7-NFA to Minimized DFA.pptx

  • 2. RE to DFA • To convert RE to NFA use – Thompson’s algorithm • To convert NFA to DFA use – Subset Construction algorithm • To minimize the obtained DFA use – Tabulation method (also called Mark/Reduce procedure)
  • 3. Subset construction algorithm Step 1: Find the λ-closure of all the states Step 2: Let the λ-closure of the initial state be named as A Step 3: Now find the transitions of each input symbol on this state A. Then, find the λ-closure of the above set and name it as A if it appears to be same otherwise give a new name as B. Step 4: Repeat Step 3 for each of the new states added until there are no new states in the queue. Step 5: Convert the above representation to a DFA. The initial state of the DFA will be A. Mark the final states of DFA.
  • 4. Example 1 • Convert the RE (a+b)*abb to a minimized DFA λ-closure(0) = {0, 1, 2, 4, 7} λ-closure(4) = {4} λ-closure(8) = {8} λ-closure(1) = {1, 2, 4} λ-closure(5) = {1, 2, 4, 5, 6, 7} λ-closure(9) = {9} λ-closure(2) = {2} λ-closure(6) = {1, 2, 4, 6, 7} λ-closure(10) = {10} λ-closure(3) = {1, 2, 3, 4, 6, 7} λ-closure(7) = {7}
  • 5. Example 1 λ-closure(0) = {0, 1, 2, 4, 7} – A λ-closure(ẟ(A, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B λ-closure(ẟ(A, b)) = λ-closure(5) = {1, 2, 4, 5, 6, 7} – C λ-closure(ẟ(B, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B λ-closure(ẟ(B, b)) = λ-closure(5, 9) = {1, 2, 4, 5, 6, 7, 9} – D λ-closure(ẟ(C, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B λ-closure(ẟ(C, b)) = λ-closure(5) = {1, 2, 4, 5, 6, 7} – C λ-closure(ẟ(D, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B λ-closure(ẟ(D, b)) = λ-closure(5, 10) = {1, 2, 4, 5, 6, 7, 10} – E λ-closure(ẟ(E, a)) = λ-closure(3, 8) = {1, 2, 3, 4, 6, 7, 8} – B λ-closure(ẟ(E, b)) = λ-closure(5) = {1, 2, 4, 5, 6, 7} – C
  • 6. Example 1 – Final DFA States a b -> A B C B B D C B C D B E * E B C A B C D E E a a a a a b b b b b
  • 7. DFA Minimization – Tabulation Method States a b -> A B C B B D C B C D B E * E B C B C D E A B C D Mark/Reduce Procedure Pair – (AC)
  • 8. Minimized DFA States a b -> A B C B B D C B C D B E * E B C States a b -> A B A B B D D B E * E B A A B D E E b b b b a a a a
  • 10. Example 2 • Find the minimal DFA for abb(a+b)*
  • 11. Example 2 λ-closure(0) = {0} λ-closure(1) = {1} λ-closure(2) = {2} λ-closure(3) = {3, 4, 5, 7, 10} λ-closure(4) = {4, 5, 7} λ-closure(5) = {5} λ-closure(6) = {4, 5, 6, 7, 9, 10} λ-closure(7) = {7} λ-closure(8) = {4, 5, 7, 8, 9, 10} λ-closure(9) = {4, 5, 7, 9, 10} λ-closure(10) = {10}
  • 12. Example 2 – Subset Alg. • λ-closure(0) = {0} - A • λ-closure(ẟ(A, a)) = λ-closure(1) = {1} – B • λ-closure(ẟ(A, b)) = φ • λ-closure(ẟ(B, a)) = φ • λ-closure(ẟ(B, b)) = λ-closure(2) = {2} – C • λ-closure(ẟ(C, a)) = φ • λ-closure(ẟ(C, b)) = λ-closure(3) = {3, 4, 5, 7, 10} – D
  • 13. Example 2 • λ-closure(ẟ(D, a)) = λ-closure(6) = {4, 5, 6, 7, 9, 10} – E • λ-closure(ẟ(D, b)) = λ-closure(8) = {4, 5, 7, 8, 9, 10} – F • λ-closure(ẟ(E, a)) = λ-closure(6) = {4, 5, 6, 7, 9, 10} – E • λ-closure(ẟ(E, b)) = λ-closure(8) = {4, 5, 7, 8, 9, 10} – F • λ-closure(ẟ(F, a)) = λ-closure(6) = {4, 5, 6, 7, 9, 10} – E • λ-closure(ẟ(F, b)) = λ-closure(8) = {4, 5, 7, 8, 9, 10} – F
  • 14. Example 2 - Minimization States a b -> A B φ B φ C C φ D * D E F * E E F * F E F B C D E F A B C D E Pairs {{DE}{DF}} {EF} => {DEF}
  • 15. Example 2 – Minimized DFA States a b -> A B φ B φ C C φ D * D D D A B C D D T a b a b a b a, b a, b
  • 16. Example 3 • Convert to minimized DFA • λ-closure(q0) = {q0} • λ-closure(q1) = {q1} • λ-closure(q2) = {q2} q0 q1 q1 q2 0 0, 1 0, 1 1
  • 17. Example 3 • λ-closure(q0) = {q0} – A • λ-closure(ẟ(A, 0)) = λ-closure(q0,q1} = {q0,q1} – B • λ-closure(ẟ(A, 1)) = λ-closure(q1} = {q1} – C • λ-closure(ẟ(B, 0)) = λ-closure(q0,q1,q2} = {q0,q1,q2} – D • λ-closure(ẟ(B, 1)) = λ-closure(q1,q2} = {q1,q2} – E • λ-closure(ẟ(C, 0)) = λ-closure(q2} = {q2} – F • λ-closure(ẟ(C, 1)) = λ-closure(q2} = {q2} – F • λ-closure(ẟ(D, 0)) = λ-closure(q0,q1,q2} = {q0,q1,q2} – D • λ-closure(ẟ(D, 1)) = λ-closure(q1,q2} = {q1,q2} - E
  • 18. Example 3 • λ-closure(ẟ(E, 0)) = λ-closure(q2} = {q2} – F • λ-closure(ẟ(E, 1)) = λ-closure(q2} = {q2} – F • λ-closure(ẟ(F, 0)) = φ • λ-closure(ẟ(F, 1)) = λ-closure(q2} = {q2} - F States 0 1 -> A B C *B D E *C F F *D D E *E F F F φ F
  • 19. Example 3 B C D E F A B C D E States 0 1 -> A B C *B D E *C F F *D D E *E F F F φ F Pairs: (BD), (CE)
  • 20. Example 3 – Minimized DFA • Let (BD) be X • Let (CE) be Y States 0 1 -> A B C *B D E *C F F *D D E *E F F F φ F States 0 1 -> A X Y *X X Y *Y F F F φ F A X Y F X Y 1 0 1 0 0, 1 0, 1 0
  • 21. Example 4 • Find the minimized DFA for the given NFA • λ-closure(q0) = {q0, q1} • λ-closure(q1) = {q1} • λ-closure(q2) = {q2} q0 q1 q2 q1 0 0, λ 1 0, 1 1
  • 22. Example 4 • λ-closure(q0) = {q0, q1} - A • λ-closure(ẟ(A, 0)) = λ-closure(q0, q1, q2) = {q0, q1, q2} – B • λ-closure(ẟ(A, 1)) = λ-closure(q1, q2) = {q1, q2} – C • λ-closure(ẟ(B, 0)) = λ-closure(q0, q1, q2) = {q0, q1, q2} – B • λ-closure(ẟ(B, 1)) = λ-closure(q1, q2) = {q1, q2} – C • λ-closure(ẟ(C, 0)) = λ-closure(q0, q2) = {q0, q1, q2} – B • λ-closure(ẟ(C, 1)) = λ-closure(q1, q2) = {q1, q2} - C
  • 23. Example 4 B C A B States 0 1 ->* A B C *B B C *C B C All pairs are indistinguishable So, {ABC} is a single state X X 0, 1
  • 24. Example 5 - Minimize the given DFA • First draw the DFA and check if all the states are reachable from start state • The sets are {q1, q2, q3} and {q2, q3}. • So, {q1, q2, q3} can be combined into one state States 0 1 -> q0 q1 q3 q1 q2 q4 q2 q1 q4 q3 q2 q4 *q4 q4 q4 q1 q2 q3 q4 q0 q1 q2 q3 States 0 1 -> q0 X X X X q4 *q4 q4 q4
  • 25. Exercises – NFA to Minimized DFA 1. 2. A B X C a b c λ λ A B C B 0 1 0,1 0,1
  • 26. Exercises – NFA to Minimized DFA 3. 4. RE ab*a(a+b) 5. RE (0+1)+(0+1)* 6. 𝐿 = 𝑎𝑛𝑏𝑚 ∶ n ≥ 1, m ≥ 2 7. 𝐿 = 𝑎𝑛b: n ≥ 1} ⋃ {𝑏𝑛a ∶ n ≥ 1 A B X C a b a, b a, λ b, λ b, λ
  • 27. Exercises – Minimize the DFA 8. 9. States 0 1 -> A B F B G C *C A C D C G E H F F C G G G E H G C