Download presentation
Presentation is loading. Please wait.
1
More on DFA minimization and DFA equivalence
The Chinese University of Hong Kong Fall 2008 CSC 3130: Automata theory and formal languages More on DFA minimization and DFA equivalence Andrej Bogdanov
2
Example Construct a DFA over alphabet {0, 1} that accepts those strings that end in 111 This is big, isn’t there a smaller DFA for this? q000 1 q00 1 q001 q0 1 … q01 … qe 1 q101 q10 … 1 q1 … 1 q11 1 q111 1
3
Smaller DFA Yes, we can do it with 4 states: 1 q0 q1 q2 q3
4
No smaller DFA! Last time we saw that
In fact, it is also true that There is no DFA with 3 states for L This is the unique 4-state DFA for L 1 q0 q1 q2 q3
5
Theorem The DFA M found by the minimization algorithm is the unique minimal DFA for L Proof outline Suppose there are two minimal DFAs M, M’ for L In both M and M’, every pair of states is distinguishable M M’ q0 q0’
6
Proof outline for uniqueness
If M and M’ are not the same, there must be states q1, q2 of M and q’ of M’ like this: For some strings u and v M M’ u q1 q’ q0 q0’ u, v v q2
7
Proof outline for uniqueness
Since q1 and q2 are distinguishable, there is a string w such that But in M’ this cannot happen! M’ M’’ u q1 w q’ w ? u, v v q2 w
8
Testing equivalence of DFAs
Two DFAs are called equivalent if they accept the same language q00 q0 1 1 q01 qe 1 q10 1 1 q1 1 q11 1 1 1 qA qB qC 1
9
Testing equivalence of DFAs
How can we tell if M and M’ are equivalent? Algorithm for testing DFA equivalence: Run DFA minimization algorithm on M Run DFA minimization algorithm on M’ Check that M and M’ are the same
10
Example Do the following two NFAs accept the same language? 0,1 0,1 1
1 q0 q1 q0 1 1 q1
11
Answer We cannot run minimization procedure on NFAs
But we can convert both NFAs to DFA and test equivalence regular expression NFA DFA
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.