Notes-SecBX - COT 4210 The Minimal State DFA Section BX...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
COT 4210 Section BX Summer 2006 The Minimal State DFA We have characterized Regular languages in terms of NFAs (DFAs) and RLGs (LLGs). Throughout our discussions we have continually drawn an analogy between grammars and programs and DFAs and programs. In this section we begin to address for formal systems an issue that is always of concern for real programs, namely, “how can we make programs more efficient?” Specifically, we consider the problem of reducing the number of states in a DFA, M = (Q, Σ , δ , q 0 , A). In more colloquial terms, “can I design a DFA with fewer states that will do the same thing?” We know intuitively that not all equivalent DFAs have the same number of states. This is demonstrated by trivial examples. Consider M and M' illustrated in the figure below. It is clear that L(M) = L(M') = Σ *. In Figure A M has two reachable states, both of which are accept states. Clearly, this machine accepts all strings and is equivalent to the one- state DFA, M’; observe that M’ can be obtained from M by simply redirecting the transition, δ (1,b), from state 2 back to state 1, and eliminating 2 which, after this change, would no longer be reachable. In Figure B, we see that state 2 is unreachable in M. Thus the smaller, more efficient, M’, can be constructed by removing state 2. Figure A. Figure B. These simple examples introduce two key ideas that will be exploited in the state minimization algorithm we present later: (a) the elimination of unreachable states , and (b) removing redundant or indistinguishable states . The first concept is obvious. The second notion is more vague and needs a formal introduction. For any DFA, M, and any state q Q, we can define two sets of strings determined by q. The first set we shall denote as R q = { x | δ * (q 0 ,x) = q }. This is just the strings that leave M in state q. The second set determined by q is S q and is given by S q = {y | δ * (q, y) A }. These are the strings that would allow M to accept, once M has reached state q. Sets Rq and Sq are illustrated graphically in Figure C. June 14, 2006 Page 48
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COT 4210 Section BX Summer 2006 Figure C. A typical x R q and a typical y S q . Given these sets, the following is true about L(M). Now suppose that S q = S q' for two distinct state q and q'. To see that this is possible, refer to our machine M in Figure A. Clearly S 1 = S 2 = Σ *. However, assuming q and q' are both reachable states of M, then it is never true that R q = R q' , in fact R q R q' = Φ . For suppose that x R q R q' . Because δ M is a function we have δ M (q 0 ,x) = q = q', contradicting our assumption that q
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

Notes-SecBX - COT 4210 The Minimal State DFA Section BX...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online