Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 91.304 Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under.

Similar presentations


Presentation on theme: "1 91.304 Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under."— Presentation transcript:

1 1 91.304 Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin dm@cs.uml.edu This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/by- sa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

2 2 Simplifying RPP proofs  I find it easier to forget about contradiction proofs and instead prove directly that a language is not in RPP  So we need a direct, formal version of of the statement that L RPP 2

3 3 Unraveling RPP (repeat) Rephrasing L is a member of RPP if  There exists p ¸ 0 such that For every s 2 L satisfying |s| ¸ p,  There exist x,y,z 2  * such that 1.s=xyz 2.|y|>0 3.|xy| · p 4.For all i ¸ 0, x y i z 2 L ( 9 p) ( 8 s) ( 9 x,y,z) ( 8 i) !!! Pretty complicated

4 4 Unraveling non-RPP Rephrasing L is not in RPP if  For every p ¸ 0 There exists some s 2 L satisfying |s| ¸ p such that  For every x,y,z 2  * satisfying 1-3: 1.s=xyz, 2.|y|>0, and 3.|xy| · p  There exists some i ¸ 0 for which x y i z L ( 8 p) ( 9 s) ( 8 x,y,z) ( 9 i) Still complicated — but you don't have to use contradiction now 2

5 5 A direct proof of nonregularity  Let D={a n 2 | n ¸ 0 } = {,a 1,a 4,a 9,  } ('a' is just some character). Then D is not regular. Proof idea The pumping lemma says there's a fixed-size loop in any DFA that accepts long strings. You can repeat the characters in that loop as many times as you want to get longer strings that the machine accepts. Each time you add a repetition you grow the pumped string by a constant length. But the spacing between strings in D above keeps changing; it's never constant. So D doesn't have the pumping property.

6 6 A direct proof of nonregularity  Let D={a n 2 | n ¸ 0 } = {,a 1,a 4,a 9,  }. Then D is not in RPP and thus not regular. Proof Let p ¸ 0 and set s=a (p+1) 2. Then s 2 D and |s|>p (so such an s certainly exists). Now let x,y,z 2  * be any strings satisfying 1.xyz = s = a (p+1) 2 2.|y|>0, and 3.|xy| · p Our goal is to produce some i such that xy i z D 2

7 7 Direct proof continued (We'll actually show that xy 0 z D) Observe that y=a j for some 1 · j · p, so |xy 0 z| = |a (p+1) 2 -j | < (p+1) 2 Since j · p we know that -j ¸ -p and thus |xy 0 z| = (p+1) 2 - j ¸ (p+1) 2 - p = p 2 + p + 1 > p 2 In other words, xy 0 z has > p 2 characters and < (p+1) 2 characters. So |xy 0 z| is not a perfect square and thus xy 0 z D. QED 2 2

8 8 Direct or contradiction proof?  Both work fine... it's your choice  But you must clearly state what you are doing If proof by contradiction, say so If direct proof, say so

9 9 Game theory formulation  The direct proof technique can be formulated as a two-player game You are the player who wants to establish that L is not pumpable Your opponent wants to make it difficult for you to succeed Both of you have to play by the rules

10 10 Game theory continued The game has just four steps. 1.Your opponent picks p ¸ 0 2. You pick s 2 L such that |s| ¸ p 3.Your opponent chooses x,y,z 2  * such that s=xyz, |y|>0, and |xy| · p 4. You produce some i ¸ 0 such that xy i z L 2

11 11 Game theory continued  If you are able to succeed through step 4, then you have won only one round of the game Like winning one round of Tic-tac-toe Do example for a member of D  To show that a language is not in RPP you must show that you can always win, regardless of your opponent's legal moves Realize that the opponent is free to choose the most inconvenient or difficult p and x,y,z imaginable that are consistent with the rules

12 12 Game theory continued  So you have to present a strategy for always winning — and convincingly argue that it will always win So your choices in steps 2 & 4 have to depend on the opponent's choices in steps 1 & 3 And you don't know what the opponent will choose So your choices need to be framed in terms of the variables p, x, y, z

13 13 Game theory continued  Ultimately it is not very different from the direct proof But it states clearly what choices you may make and what you may not — a common cause of errors in proofs Repeat previous proof in this framework

14 14 A direct proof of nonregularity  Let D={a n 2 | n ¸ 0 } = {,a 1,a 4,a 9,  }. Then D is not in RPP and thus not regular. Proof Let p ¸ 0 and set s=a (p+1) 2. Then s 2 D and |s|>p (so such an s certainly exists). Now let x,y,z 2  * be any strings satisfying 1.xyz = s = a (p+1) 2 2.|y|>0, and 3.|xy| · p Our goal is to produce some i such that xy i z D 2 Step 1, opponent's choice Step 2, your choice and reasoning Step 3, opponent's choice

15 15 Direct proof continued (We'll actually show that xy 0 z D) Observe that y=a j for some 1 · j · p, so |xy 0 z| = |a (p+1) 2 -j | < (p+1) 2 Since j · p we know that -j ¸ -p and thus |xy 0 z| = (p+1) 2 - j ¸ (p+1) 2 - p = p 2 + p + 1 > p 2 In other words, xy 0 z has > p 2 characters and < (p+1) 2 characters. So |xy 0 z| is not a perfect square and thus xy 0 z D. QED 2 2 Step 4, your choice Step 4, your reasoning

16 16 Unraveling RPP (repeat) Rephrasing L is a member of RPP if  There exists p ¸ 0 such that For every s 2 L satisfying |s| ¸ p,  There exist x,y,z 2  * such that 1.s=xyz 2.|y|>0 3.|xy| · p 4.For all i ¸ 0, x y i z 2 L Theorem REG µ RPP

17 17 Structural facts about RPP 1.If L 2 RPP(p) (meaning "strings in L with length ¸ p are pumpable") and q>p then L 2 RPP(q) 2.If L RPP(q) and q>p then L RPP(p) (contrapositive of 1)  Thus if you have a proof that establishes L RPP(q) only when q ¸ 5, that's good enough: it follows that L is not regular  Relevant for “C is not regular” problem 2 2 2

18 18 Structural facts about RPP 3.If L 2 FIN and the longest string in L has length n, then a)L 2 RPP(n+1) b)L RPP(q) for all q < n+1 Note RPP is a class of languages that's only interesting because of its relation to REG. It is not a reasonable proposal for a computation model! 2

19 19 Unraveling non-RPP (repeat) L is not in RPP if  For every p ¸ 0 (opponent choice) There exists some s 2 L satisfying |s| ¸ p such that (your choice)  For every x,y,z 2  * satisfying 1-3: 1.s=xyz, 2.|y|>0, and 3.|xy| · p  There exists some i ¸ 0 for which x y i z L 2 (opponent's) (yours)

20 20 Another example  Let C = {0 m 1 n | m  n }. Is C regular? Try to prove it isn't:  Set s=0 p 1 2p. If opponent chooses x=, y=0 p, z=1 2p, then we can set i=2 and win because xy 2 z=0 2p 1 2p C.  What if opponent chooses a shorter y? Looks like it's relatively easy to be a member of C and hard to not be a member of C Can force opponent to choose y 2 0 + So try to arrange it so that no matter what |y| is, some number of repetitions of it will match the target number of '1's 2

21 21 Direct proof?  Hmmm

22 22 Using closure properties  Can simplify argument a great deal Fact If L is not regular then L c is not regular either. Proof If L is not regular but L c were regular, then (L c ) c would also be regular because REG is closed under complement. But (L c ) c = L QED  Recall the languages B = { 0 m 1 n | m = n } C = { 0 m 1 n | m  n } C is similar to B c...

23 23 Using closure properties  Start over: B = { 0 m 1 n | m = n } (known nonreg) C = { 0 m 1 n | m  n } (suspected nonreg)  Certainly B µ C c If m=n then it's true that (not m  n)  But B  C c Find example x 2 C c - B...  On the other hand, B = 0*1* Å C c

24 24 Using closure properties Fact If L 1 Å L 2 REG and L 1 2 REG, then L 2 REG Proof Suppose (a) L 1 Å L 2 REG and L 1 2 REG and (b) L 2 2 REG. Since REG is closed under Å we know that L 1 Å L 2 2 REG, but that contradicts assumption (a). Thus (a) and (b) can't both be true. QED 2 2 2


Download ppt "1 91.304 Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under."

Similar presentations


Ads by Google