You are on page 1of 17

Summary Showing regular

construct DFA, NFA construct regular expression show L is the union, concatenation, intersection (regular operations) of regular languages.

Showing non-regular
pumping lemma assume regular, apply closure properties of regular languages and obtain a known non-regular language.
1

Equivalence & Minimization of Automata

Outline
Equivalence of a state in a DFA regular languages Minimization of DFA smallest possible DFA for a given regular language

Equivalent States. Example


Consider the accept states c and g. They are both sinks meaning that any string which ever reaches them is guaranteed to be accepted later. 0,1 Q: Do we need both states?
b 0 a 1 f 0 d 1 1 1 0 0 0,1 e 0,1 g
4

Example (cont)
A: No, they can be unified as illustrated below. Q: Can any other states be unified because any subsequent string suffixes produce identical results?
b 0 a 1 f 0 d 1 1 0
5

1 e

0 0,1

0,1 cg

Example (cont)
A: Yes, b and f. Notice that if youre in b or f then: if string ends, reject in both cases if next character is 0, forever accept in both cases if next character is 1, forever reject in both cases So unify b with f. b
0 a 1 f 0 d 1 1 0
6

1 e

0 0,1

0,1 cg

Example (cont)
Intuitively two states are equivalent if all subsequent behavior from those states is the same. Come up with a formal characterization of state equivalence. Q: Any other ways to simplify the automaton?
0,1 a 0,1 bf 0 d 1 1 0
7

0,1

cg

Example (cont)
A: Get rid of d. i.e. Getting rid of unreachable useless states doesnt affect the accepted language.

0,1 a 0,1 bf 1 0
8

0,1

cg

Equivalent States. Definition


DEF: Two states q and q in a DFA M = (Q, , , q0, F ) are said to be equivalent (or indistinguishable) if for all strings u *, the states on which u ends on when read from q and q are both accept, or both non-accept. Equivalent states may be glued together without affecting M s behavior.

Minimization Algorithm. Goals


DEF: An automaton is irreducible if it contains no useless states, and no two distinct states are equivalent. The goal of minimization algorithm is to create irreducible automata from arbitrary ones. Later: remarkably, the algorithm actually produces smallest possible DFA for the given language, hence the name minimization.

10

Minimization of DFAs

Example:

The DFA has equivalence classes {{A,E}, {B,H}, {C}, {D,F}, {G}}
11

Equivalence Class

Transitivity: If p q and q r, then p r Proof: Suppose to the contrary that p r Then w : H * ( p, w) F & H * ( r , w) F or vice versa. Now H * ( q, w) is either accepting or not If H * ( q, w) F q | r  Otherwise H * ( q, w) F p | q  The vice versa case is proved symmetrically

@p|r
12

Minimization of DFAs (cont)

13

Example

Can be minimized to
K ({ A, E},0} ! B / | ! H / | ! {B, H } 3 H ( A,0) ! B H ( E ,0) ! H & K ({ A, E},1} ! D / | ! F / | ! {D, F } 3 H ( A,1) ! F H ( E ,1) ! F
14

Cannot apply the TF-algo to NFAs For Example, to minimize

Simply remove state C However, A C


15

Minimized DFA Cannot be Beaten


Let B be the minimized DFA obtained by applying the TF-Algo to DFA A. We know that L(A) = L(B) What if there existed a DFA C with L(C) = L(B) and fewer states than B? If we run the TF-Algo on B union C

q | q 3 L( B) ! L(C ) B C Also H ( q0 , a ) | H ( q0 , a ), a

B 0

C 0

 If we could distinguish successors then q | q

B 0

C 0

16

Minimized DFA Cannot be Beaten (cont)


Claim: For each state p in B there is at least one state q in C, s.t. p | q Proof: There are no inaccessible states, so B

p ! H * (q0 , a1a2 . ak ) C Now q ! H * ( q0 , a1a2 . ak ) and p | q B C B C 3 q0 | q0 @ H (q0 , a1 ) | H (q0 , a1 )


B C H * (q0 , a1a2 ) | H * (q0 , a1a2 )

Since C has fewer states than B, there must be two states r & s of B s.t. r | t | s For some state t of C. But r | s CONTRADICTION!!
17

You might also like