Minimizing DFAs
Minimizing DFAs
Lecture 11
Exercise 7.40
Robb T. Koether
Hampden-Sydney College
Fri, Sep 21, 2012
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 1 / 26
Outline
1
Equivalent States
2
n-Equivalence
3
Minimization Examples
4
Assignment
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 2 / 26
Outline
1
Equivalent States
2
n-Equivalence
3
Minimization Examples
4
Assignment
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 3 / 26
Equivalent States
To minimize a DFA, we must identify states that are equivalent.
When two states are equivalent, one of them may be eliminated.
Denition (Equivalent states)
Two states in a DFA are equivalent if, for any input, the decision of
whether to accept or reject it will be the same regardless of which of
the two states we are currently in.
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 4 / 26
Example
Example (Equivalent states)
Clearly, states 2 and 3 are equivalent and states 4 and 5 are
equivalent.
5 3
4 2
1
a
a
a
a
a
b
b
b b
b
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 5 / 26
Example
Example (Equivalent states)
Clearly, states 2 and 3 are equivalent and states 4 and 5 are
equivalent.
5 3
4 2
1
a
a
a
a
a
b
b
b b
b
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 6 / 26
Example
Example (Equivalent states)
Clearly, states 2 and 3 are equivalent and states 4 and 5 are
equivalent.
a, b
a
b
a b
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 7 / 26
Outline
1
Equivalent States
2
n-Equivalence
3
Minimization Examples
4
Assignment
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 8 / 26
Equivalence of States
Denition (0-equivalence of states)
Two states q and q
are 0-equivalent if
Both are accepting states, or
Both are rejecting states.
Denition (n-equivalence of states)
Let n be a positive integer. Two states q and q
where
L
1
= {w | w starts with a and has an even number of symbols}
L
2
= {w | w starts with b and has an odd number of symbols}.
Robb T. Koether (Hampden-Sydney College) Minimizing DFAs Fri, Sep 21, 2012 26 / 26