theory of computation (fall 2014): beyond regularity: proofs by contradiction, pumping lemma proofs,...
out of 21
Post on 13-Dec-2014
Embed Size (px)
- 1. Theory of Computation Beyond Regularity: Proofs by Contradiction, Pumping Lemma Proofs, Pumping Lemma & Finite Languages Vladimir Kulyukin
- 2. Outline Proofs by Contradiction Detailed Pumping Lemma Proofs Pumping Lemma & Finite Languages
- 3. Beyond Regularity Are there languages that cannot be recognized by finite state automata? Yes, there are: anbn is one of the languages that cannot be recognized by any FSA In general, any language whose strings have symbolic dependencies (the number of some symbol depends on the number of some other symbol) cannot be recognized by an FSA
- 4. Proof by Contradiction Pumping Lemma applications are examples of a proof technique known as proof by contradiction Proof by contradiction is used to prove statements of the form IF A THEN B A typical use of this technique consists of two steps: Assume that A is true and B is false Find a contradiction, i.e., a statement that contradicts another statement known to be true; that statement can be A itself, which is assumed to be true
- 5. Proof by Contradiction Why does proof by contradiction works? It works because the statement IF A THEN B is true in all cases except when A is true and B is false Proof by contradiction allows us to rule out that case by finding a contradiction It is this contradiction that proves the original statement IF A THEN B because it excludes the only case under which this statement can be false
- 6. Three Questions about Proof by Contradiction What contradictions can/should we look for? No general answer but experience, intuition, and insight How can we use the assumptions that A is true and B is false to reach a contradiction? Work forward from both assumptions and see what shakes loose When can/should we use proof by contradiction? A reliable indicator is the word not in the statement B
- 7. Proof by Contradiction: Example If r is a real number such that r2 = 2, then r is not rational (irrational) A: r is a real number such that r2 = 2 B: r is not rational (irrational)
- 8. Proof by Contradiction: Example Assume A and NOT B: A: r is a real number such that r2 = 2 NOT B: r is rational Now we have to find a contradiction
- 9. Proof by Contradiction: Example If r is rational (remember that NOT B is assumed to be true), then r = p/q, q != 0 We can assume that p and q have no common divisors (aka mutually prime); if they had, they could be divided out.
- 10. Proof by Contradiction: Example Since r = p/q, r2 = (p/q)2. Since r2 = 2, then 2 = (p/q)2. Since 2 = (p/q)2, 2q2 = p2. Since p2 = 2q2, p2 is even. Since p2 is even, p is even.
- 11. Proof by Contradiction: Example Since p is even, p = 2k, where k is an integer. Since 2q2 = p2, 2q2 = (2k)2 = 4k2. Since 2q2 = (2k)2 = 4k2, q2 = 2k2. Since q2 = 2k2, then q is even. But then, since both p and q are even, they have at least one common divisor. We found a contradiction because p and q were assumed to have no common divisors.
- 12. Proof by Contradiction: Example Since p is even, p = 2k, where k is an integer. Since 2q2 = p2, 2q2 = (2k)2 = 4k2. Since 2q2 = (2k)2 = 4k2, q2 = 2k2. Since q2 = 2k2, then q is even. But then, since both p and q are even, they have at least one common divisor. We found a contradiction because p and q were assumed to have no common divisors.
- 13. Pumping Lemma Examples
- 14. Review: Pumping Lemma L L M M n Let , where is a DFA with states. x L x n x uvw Let and . Then we can write , i where 1 and , for 0. v uv w L i
- 15. Review: Pictorial Insight q0 q q M u v w x uvw, x n
- 16. Pumping Lemma Use Pumping Lemma is not used to prove that languages are regular Pumping Lemma states that if a language is regular, then its strings have a specific property (pumping property) Pumping Lemma is used to show that languages are not regular: assume that a language is regular and then show that a specific string does not satisfy the pumping property
- 17. Pumping Lemma Example: Proof 1 L a b k N Claim: | is not regular. Proof 1: Let be the constant of the Pumping Lemma. z L z n z uvw v Let ,| | . Then , 1 . Then z a b m v v a , 0. There are 3 choices for : ; 0 k m v a b v b v a uv w a b k m ; . If , , . Thus, 0 2 uv w L v a b uv w a . If , is a string where 's follow b uv w L v b uv w a b m k 's. Thus, . If , , . Thus, . In each of the 3 cases, we achieve a contradiction. 0 2 0 uv w L n m k m m k k
- 18. Pumping Lemma Example: Proof 1 k k L a b k N Claim: | is not regular. n Proof 2 : Let be the constant of the Pumping Lemma. n n z a b z L z n Let . Then ,| | . By the Pumping Lemma, n z uvw v a n ,1 . To process , the DFA with states needs n v a a processing sequence of 1 states. Thus, is the only 2 v y uv w uvvw v a choice for . Consider . Since , y L a , because the number of 's in y is strictly greater than b L the number of 's. Hence, is not regular.
- 19. Pumping Lemma & Finite Languages Any finite language is regular We can construct a finite automaton for each individual string (that automaton will accept that string and only that string) The individual automaton can then be compiled into one union automaton that accepts all strings in that language
- 20. Pumping Lemma & Finite Languages Does the Pumping Lemma contradict the regularity of finite languages? No, because for any finite language we can find the length of the longest string (say n) The Pumping Lemma's statement is vacuously true for all strings whose length is greater than n, because there are no such strings in the language So we do not get any contradiction out of the Pumping Lemma for finite languages
- 21. References & Reading Suggestions Davis, Weyuker, Sigal. Computability, Complexity, and Languages, 2nd Edition, Academic Press Brooks Webber. Formal Language: A Practical Introduction, Franklin, Beedle & Associates, Inc Hopcroft and Ullman. Introduction to Automata Theory, Languages, and Computation, Narosa Publishing House D. Solow. How to Read & Do Proofs, Wiley & Sons
View more >