Consider running string w through machine M = (Q,Σ,Δ,s,W). Write out the computation as a sequence of states separated by the input symbol read (or λ) as we did last class. Now, circle the initial state in the list, and all states directly preceeded by reading a symbol - i.e. not λ. There must be more than |Q| circled states in the list, so we can find repetitions. The whole subsequence between these repeated occurences is a loop in the computation, and the loop contains at lease one non-λ-transition. After all, the last state in the loop is circled, and that means it is immediately proceeded by a symbol from the alphabet, i.e. not λ!
The Pumping Lemma (Machine Version 2.0)This new, stronger version of the Pumping Lemma makes it a whole bunch easier to prove that languages can't be accepted by FAs.
For any finite automaton M, for all w ∈ L(M) of length greater than or equal to the number of states in M, there exist x,y,z ∈Σ*, where w = xyz and y ≠ λ and |xy| ≤ the number of states in M, such that xykz ∈ L(M) for all k.
Theorem: There is no deterministic finite automaton
accepting L = {anbn| n ≥
0}.
| Proof with Version 1.0 | Proof with Version 2.0 |
Consider the following algorithm:
Algorithm AWe claim that w' is misclassified by M with respect to L. Why? First note that w ∈ L, and |w| ≥ |Q|. If w ∉ L(M) then M clearly misclassifies w and we set w' = w. Otherwise, we satisfy the first two conditions in the Pumping Lemma v1.0, so we get our x, y and z and set w' = xy2z. By the Pumping Lemma, M accepts w'. However, w' ∉ L. Why?
|
Consider the following algorithm:
Algorithm AWe claim that w' is misclassified by M with respect to L. Why? First note that w ∈ L, and |w| ≥ |Q|. If w ∉ L(M) then M clearly misclassifies w and we set w' = w. Otherwise, we satisfy the first two conditions in the Pumping Lemma v2.0, so we get our x, y and z and set w' = xy2z. By the Pumping Lemma, M accepts w' and since |xy| ≤ |Q|, y consists solely of a's. Thus, xy2z has more a's than b's, and therefore is not in L. |
Here the big benefit of using V2.0 is that that justification for the algorithm is easier. Why? Because we don't have as many cases to consider. In other problems, V2.0 even makes the algorithms themselves easier.
Input: machine M = (Q,Σ,δ,s,W)The existence of such an algorithm proves that $L_p$ can't be accepted by a finite automaton.
Output: string w' such that either w' ∈ $L_p$ but w' ∉ L(M), or w' ∉ $L_p$ but w' ∈ L(M).
Note: In class we tried this same thing with
$w = a^{\lfloor |Q|/2 \rfloor}b^{\lfloor |Q|/2 \rfloor}$
and we found that, running it on the example machine below, the
algorithm did not always produce counterexamples. That
was a very important (and hopefully illuminating) exercise!
Input: machine M = (Q,Σ,δ,s,W)The existence of such an algorithm proves that L can't be accepted by a finite automaton.
Output: string w' such that either w' ∈ $L_s$ but w' ∉ L(M), or w' ∉ $L_s$ but w' ∈ L(M).
+ * c - a c b is valid, whereas
- a b c + d * is not.]
Using the Pumping Lemma Version 2.0, design an algorithm
with the following specification:
Input: machine M = (Q,Σ,δ,s,W)The existence of such an algorithm proves that L can't be accepted by a finite automaton.
Output: string w' such that either w' ∈ $L_X$ but w' ∉ L(M), or w' ∉ $L_X$ but w' ∈ L(M).