You are on page 1of 3

Discussion Problems: DFAs

Can a DFA have zero states? Solution. No. Though Q is allowed to be nite, it must posses at least one member, q0 , the initial state Does there have to be an outgoing arrow for each input character from each state in a transition graph? Solution. Yes. is a total function, meaning that for every character in , there must be a transition from every state to another state (even itself) on that letter. Can a DFA have zero nal states? If so, what is the language accepted by a DFA with zero nal states? Solution. Yes. It accepts no strings (and thus its language is ).

Complete Machine Language Proof


Here is an example proof for what language a machine accepts. Consider the machine Mawa = {Q, , , q0 , F } where: Q = {q0 , q1 , q2 , q3 } = {a, b} is summarized as follows:
b q1 a,b q2 a b

q0 q1 q2 q3

a q1 q3 q2 q3

b q2 q2 q2 q1

a q0 b

q3

F = {q3 } We seek to prove the following: Claim 1. L (Mawa ) = {awa : w } In otherwords, that the language of Mawa is all words that start and end with a. To do so, we must prove two separate casesif w L, then M accepts it; otherwise, M rejects it. In this rst case, we use explicit induction to construct valid certicates. In the second proof, we use implicit induction in our construction of rejecting certicates. Claim 1.1. w L M accepts w Proof. To prove that M accepts w, we must generate a certicate (r0 , , rn ) where n = |w| that demonstrates ws acceptance according to the rules outlined in class. Rewrite w = axa where x : Well induct on the length of x to show that Mawa accepts all w of this type. Base Case: x = and w = aa. Our certicate is then (q0 , q1 , q3 ). Starting in q0 , we read the rst a and transition to q1 . The next a transitions us to q3 . Since we have read the entire word and since q3 F is an accepting state, we accept w = aa. Induction Step: Assume for all n k , w = axa is accepted by Mawa where |x| = n. We now show that this statement holds for k + 1. Our certicate starts with r0 = q0 and r1 = q1 as usual; the rest of the certicate r2 . . . rk follows the transition function as appropriate for each character in x. When we read the last character in x, we either end up in q1 or q3 : There are no transitions in from these states that include another state. If rn = q1 (the last character in x was a b), then (q1 , a) = q3 , the last element in our certicate is rk+1 = q3 F , and the word is accepted; similarly, if rn = q3 (the last character in x was an a), then (q3 , a) = q3 , rk+1 = q3 F , and we also accept the word. Therefore, M accepts any w = axa L for any length of x.

Claim 1.2. w 6 L M rejects w Proof. To prove this statement, we need to show that we cannot construct a certicate for w that accepts the word; all paths reject. If w 6 L, then one of two cases have occurred: w does not start with an a w starts with an a but does not end with an a In the rst case, we start in q0 and transition to q2 as (q0 , b) = q2 . If w = b, we reject because q2 6 F . If w = bx for any x , we note that (q2 , ) = q2 for all : We never leave q2 for any added characters. Thus, our certicate of computation always ends with q2 and we reject all w = bx for x . In the second case, we either have w = a or w = axb where x . In the rst case, we reject: The certicate is (q0 , q1 ) and q1 6 F . In the second case, we use the logic outlined in Claim 1.1 to posit that after processing ax, we end up in state q1 or q3 . In either case, after reading the nal b, we transition to q1 and reject. Thus, we reject any word starting in a and not ending in an a. Since M rejects both possible forms of w when w 6 L, M rejects any w not in L. The above proof used implicit induction on the length of x for its claims; the induction is a generalization of the type performed in the rst Claim. Note, that instead of proving the Claim 1.2 as we did, we could also have proven that if M accepts w, then w L; these are equivalent statements (one is the contrapositive of the other). Regardless, now we can claim our original statement has been proven since we have proved both portions of the statement.

You might also like