0% found this document useful (0 votes)
55 views11 pages

Dfa Minimization: Cs466 (Prasad) L13Dfamin 1

The document discusses DFA minimization by collapsing equivalent states in a DFA. It explains that two states are equivalent if for every string, either both states accept or both reject. The document shows an example DFA and refines the state partitions to identify equivalent states that can be collapsed to produce a minimum DFA with the fewest number of states.

Uploaded by

Rahul Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views11 pages

Dfa Minimization: Cs466 (Prasad) L13Dfamin 1

The document discusses DFA minimization by collapsing equivalent states in a DFA. It explains that two states are equivalent if for every string, either both states accept or both reject. The document shows an example DFA and refines the state partitions to identify equivalent states that can be collapsed to produce a minimum DFA with the fewest number of states.

Uploaded by

Rahul Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 11

DFA Minimization

cs466(Prasad) L13DFAMin 1
Strings over {a,b} with even number of a’s
*

Ea Oa
Eb Ob Eb Ob

b
[Ea,Eb] [Ea,Ob]
b
a a a a
b
[Oa,Eb] [Oa,Ob]
b

cs466(Prasad) L13DFAMin 2
Strings over {a,b} with even number of a’s
*

Ea Oa

a
[Ea] [Oa]
a

b b

cs466(Prasad) L13DFAMin 3
Observation

• The states among the state sets {[Ea,Eb],


[Ea,Ob]} and {[Oa,Eb], [Oa,Ob]} differ on
aspect immaterial for the problem at hand.
• Why not collapse these state sets into one
state each, to get a smaller DFA?

cs466(Prasad) L13DFAMin 4
Equivalent or Indistinguishable States

• Recall that a DFA state summarizes the substring


consumed so far (that is, the past history).
• Two states qi and qj are equivalent or
indistinguishable (for the future), if, when started
in these states, every string causes the machine to
either end up in an accepting state for both or end
up in a non-accepting state for both.
• In other words, there is no string that can tell the
equivalent states apart for the given language.
cs466(Prasad) L13DFAMin 5
Main Idea
qi qm
a

qj qn
a

If qm and qn are distinguishable, then so are qi and qj

cs466(Prasad) L13DFAMin 6
Example DFA
b

a a b
q0 q1 q2 q3
a,b a
b
a,b
q4 a q5 q7

a,b
b q6 a
(a u b)(a u b*)
b

cs466(Prasad) L13DFAMin 7
Refinement of State Partitions

• { {q0,q7} , {q1,q2,q3,q4,q5,q6} }
• { {q0},{q7}, {q1,q2,q3,q4,q5,q6} }
• On any transition
• { {q0},{q7}, {q1,q2,q3,q4,q5,q6} }
• { {q0},{q7}, {q1,q4}, {q2,q3,q5,q6} }
• On “a” transition
• { {q0},{q7}, {q1,q4}, {q2,q5},{q3,q6} }
• On “b” transition

cs466(Prasad) L13DFAMin 8
Example DFA showing equivalent states
b

a a b
q0 q1 q2 q3
a,b a
b
a,b
q4 a q5 q7

a,b
b q6 a
(a u b)(a u b*)
b

cs466(Prasad) L13DFAMin 9
Example Minimum DFA

q0

a,b
a,b
q1,q4
a q2,q5 q7

a,b
b q3,q6
a
(a u b)(a u b*)
b

cs466(Prasad) L13DFAMin 10
• For an efficient way of determining
minimal DFA, see the details in Algorithm
5.7.2

cs466(Prasad) L13DFAMin 11

You might also like