Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

CPS 140 - Mathematical Foundations of CS

Dr. Susan Rodger


Section: Minimizing Finite Automata (Ch. 2.5) (handout)

State Minimization (Ch. 2.5)


Why?

Algorithm



Remove states that are not reachable


Identify states that are indistinguishable
These states form a new state

De nition Two states p and q are indistinquishable if for all w 2 


  (q; w) 2 F )   (p; w) 2 F
  (p; w) 62 F )   (q; w) 62 F

De nition Two states p and q are distinquishable if 9 w 2  s.t.


  (q; w) 2 F )   (p; w) 2
6 F
  (q; w) 62 F )   (p; w) 2 F

OR

Algorithm for Minimizing Number of States in DFA


1.
2.
3.
4.

Remove states that are not reachable.


Group all non nal states together as indistinquishable
Group all nal states together as indistinquishable
Repeat til no more states are distinquishable
(a) Apply symbol to a group and split group if states are distinquishable

Example:


a
A
 b

b
D

a





)


Z
Z

Z
Z




b
B
C



a
a
b
a



b
a
E
F
G



b
@

}
Z
S Z
S Z
S



Z
Z


Z J 
ZJ 
>



ZZ
~
-


@


@
J 

@
R J 



SS
o

S
S

S
S

#
#

Example:



a
b
I
H a


b
a
a




b
b
A
B
C

 b a 
a
b
b
a   

b 
a 
D
E
F
G
 b  



a
,

>
,

,

C


C


CCW 


)


P
P

..
.......
.......
*


,

,

,

Z
-

Z
@
SS
o
6J


] Z
@

J Z
S
@
A
J ZZ
S
A
@
J
Z


A
S
@

Z
J
JJ 
A
S
@
Z
R
~
Z
J


J
J
.
...
...
J
...
 S



S

Analysis of Algorithms: (Ch 2.6)


1. Given DFA M and string w, is w 2 L(M )?

2. Given NFA M and string w, is w 2 L(M )?

3. Given an NFA M1 , create a DFA M2 s.t. L(M1 ) = L(M2 )

4. Given a DFA M1 , create a minimal state DFA M2 s.t. L(M1 ) = L(M2 )

5. Given a NFA M1 , create a minimal state DFA M2 s.t. L(M1 ) = L(M2 )

You might also like