Presentation on theme: "Reducing DFA’s Section 2.4. Reduction of DFA For any language, there are many DFA’s that accept the language Why would we want to find the smallest? Algorithm:"— Presentation transcript:
Reducing DFA’s Section 2.4
Reduction of DFA For any language, there are many DFA’s that accept the language Why would we want to find the smallest? Algorithm: Finds smallest equivalent DFA
Distinguishable States A state p is indistinguishable from another q if, for all walks w, δ*(p,w) F implies δ*(q,w) F and δ*(p,w) F implies δ*(q,w) F Otherwise, they are distinguishable
Two Step Algorithm First, mark all pairs of states as distinguishable or indistinguishable Then, merge indistinguishable states into one state for the smaller graph
Mark Algorithm 1.Remove inaccessible states 2.Mark all states in F as distinguishable from those not in F. 3.Repeat until all pairs are marked: For all pairs (p,q) and all symbols (a), if δ(p,a) is distinguishable from δ(q,a), then p is distinguishable from q.
Reduce Algorithm Create a state for each set of indistinguishable states from the Mark algorithm. Rewrite transitions between states. If δ(p,a) = q, then make a transition from the node containing the original p to the node containing the original q and label it a.