DFA-> MINIMUM DFA
Module 05.4
COP4020 –
Programming Language
Concepts
Dr. Manuel E. Bermudez
DFA-> MINIMUM DFA
RGR
RGL
Minimum
DFA
Now
RE
NFA
Done
Soon
DFA
DFA-> MINIMUM DFA
Given a DFA M, there exists an equivalent minimal
DFA M’: no other equivalent DFA exists with fewer
states than M’.
State Minimization:
• Will build MDFA from DFA (not “surgery”).
• Start with two states: final and non-final.
• Split states only if necessary: minimum # of states.
DFA-> MINIMUM DFA
Definition: A partition of a set S is a set of subsets
of S so that every element of S appears in exactly one
of the subsets.
Example: S = {1, 2, 3, 4, 5}
Π1 = { {1, 2, 3, 4}, {5} }
Π2 = { {1, 2, 3,}, {4}, {5} }
Π3 = { {1, 3}, {2}, {4}, {5} }
Π2 is a refinement of Π1 , and Π3 is a refinement of Π2.
DFA-> MINIMUM DFA
Minimization Algorithm:
1. Remove all undefined transitions by introducting a
TRAP state, from which no final state is reachable.
2. Partition all states into two groups (final states and
non-final states).
3. Complete the “Next State” table for each group, by
specifying transitions from group to group.
4. Form the next partition: split groups in which Next
State table entries differ.
5. Repeat 3,4 until no further splitting is possible.
6. Determine start and final states.
DFA-> MINIMUM DFA
a
Example:
a
Π0 = { {1, 2, 3, 4}, {5} }
St.
a
1
1234
b
1
b
2
4
a
a
b
b
3
b
a
5
1234
2
1234
1234
3
1234
1234
4
1234
5
5
1234
1234
b
Split {4} from partition {1,2,3,4}:
Π1 = { {1, 2, 3},{4}, {5} }
DFA-> MINIMUM DFA
a
a
Π1 = { {1, 2, 3},{4}, {5} }
St.
a
b
1
123
123
2
123
4
3
123
123
4
123
5
5
123
123
1
b
2
4
a
a
b
b
3
b
a
5
b
Split {2} from partition {1,2,3}
Π2 = { {1, 3}, {2}, {4}, {5} }
DFA-> MINIMUM DFA
a
a
1
Π2 = { {1, 3},{2},{4}, {5} }
St.
a
b
1
2
13
3
2
13
2
2
4
4
2
5
5
2
13
b
2
4
a
a
b
a
b
3
b
5
b
b
13
No more splitting !
b
5
Minimal DFA:
a
a
b
a
2
a
b
4
DFA-> MINIMUM DFA
RGR
RGL
Minimum
DFA
RE
NFA
Done !!
DFA
SUMMARY
Summary of Regular Languages
• Smallest class in the Chomsky hierarchy.
• Appropriate for lexical analysis.
• Four representations: RGR , RGL , RE and FSA.
• All four are equivalent; algorithms to perform
transformations among them.
• Various advantages and disadvantages among these
four, for language designer, implementer, and user.
• FSA’s can be made deterministic, and minimal.
© Copyright 2026 Paperzz