# Summary Showing regular Showing non-regular construct DFA, NFA

## Presentation on theme: "Summary Showing regular Showing non-regular construct DFA, NFA"— Presentation transcript:

Summary Showing regular Showing non-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.

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. Q: Do we need both states? 0,1 b c 1 0,1 1 a d e 0,1 1 1 f g

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,1 1 1 a d 0,1 e cg 1 1 f

Example (cont) A: Yes, b and f. Notice that if you’re 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,1 1 1 a d 0,1 e cg 1 1 f

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 1 a d 0,1 e cg 0,1 1 bf

Example (cont) A: Get rid of d.
i.e. Getting rid of unreachable useless states doesn’t affect the accepted language. 0,1 a 0,1 e cg 0,1 1 bf

Equivalent States. Definition
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”.

Minimization of DFA’s Example: The DFA has equivalence classes
{{A,E}, {B,H}, {C}, {D,F}, {G}}

Equivalence Class Transitivity: If p ≡ q and q ≡ r, then p ≡ r
Proof: Suppose to the contrary that p ≢ r Then or vice versa. Now is either accepting or not If Otherwise The vice versa case is proved symmetrically

Minimization of DFA’s (cont)

Example Can be minimized to

Cannot apply the TF-algo to NFA’s
For Example, to minimize Simply remove state C However, A ≢ C

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 Also If we could distinguish successors then

Minimized DFA Cannot be Beaten (cont)
Claim: For each state p in B there is at least one state q in C, s.t. Proof: There are no inaccessible states, so Now and Since C has fewer states than B, there must be two states r & s of B s.t For some state t of C. But CONTRADICTION!!