91.304 Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin [email protected] This work is licensed under the Creative Commons Attribution-ShareAlike License. To view a copy of this license, visit http://creativecommons.org/licenses/bysa/2.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA. 1 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 2 RPP 2 Unraveling RPP (repeat) Rephrasing L is a member of RPP if There exists p¸0 such that For every s2L satisfying |s|¸ p, There exist x,y,z 2 * such that 1. 2. 3. 4. s=xyz |y|>0 |xy|· p For all i ¸ 0, x yi z 2 L (9 p) (8 s) (9 x,y,z) (8 i) !!! Pretty complicated 3 Unraveling non-RPP Rephrasing L is not in RPP if For every p¸0 There exists some s2L satisfying |s| ¸ p such that For every x,y,z 2 * satisfying 1-3: 1. 2. 3. s=xyz, (8 p) (9 s) (8 x,y,z) (9 i) Still complicated — but you don't have |y|>0, and to use contradiction now |xy|· p There exists some i ¸ 0 for which x yi z 2 L 4 A direct proof of nonregularity 2 Let D={an | n¸0 } = {,a1,a4,a9, } ('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. 5 A direct proof of nonregularity 2 Let D={an | n¸0 } = {,a1,a4,a9, }. Then D is not in RPP and thus not regular. 2 (p+1) Proof Let p¸0 and set s=a . Then s2D and |s|>p (so such an s certainly exists). Now let x,y,z2* 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 xyiz 2 D 6 Direct proof continued (We'll actually show that xy0z 2 D) Observe that y=aj for some 1· j · p, so 2 |xy0z| = |a(p+1) -j| < (p+1)2 Since j · p we know that -j ¸ -p and thus |xy0z| = (p+1)2 - j ¸ (p+1)2 - p = p2 + p + 1 > p2 2 In other 2words, xy0z has > p characters and < (p+1) characters. So |xy0z| is not a perfect square and thus xy0z 2 D. QED 7 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 8 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 9 Game theory continued The game has just four steps. 1. Your opponent picks p¸0 2. You pick s2L 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 xyiz 2 L 10 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 11 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 12 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 13 A direct proof of nonregularity 2 Step 1, opponent's choice Step 2, your choice and reasoning 4 9 Let D={an | n¸0 } = {,a1,a ,a , }. Then D is not in RPP and thus not regular. 2 (p+1) Proof Let p¸0 and set s=a . Then s2D and |s|>p (so such an s certainly exists). Now let x,y,z2* be any strings satisfying 1. xyz = s = a(p+1)2 Step 3, opponent's 2. |y|>0, and choice 3. |xy|· p Our goal is to produce some i such that xyiz 2 D 14 Direct proof continued (We'll actually show that xy0z 2 D) Observe that y=aj for some 1· j · p, so 2 Step 2 4, |xy0z| = |a(p+1) -j| < (p+1) your Since j · p we know that -j ¸ -pchoice and thus |xy0z| = (p+1)2 - j ¸ (p+1)2 - p = p2 + p + 1 Step 4, 2 your >p 2 reasoning In other 2words, xy0z has > p characters and < (p+1) characters. So |xy0z| is not a perfect square and thus xy0z 2 D. QED 15 Unraveling RPP (repeat) Rephrasing L is a member of RPP if There exists p¸0 such that For every s2L satisfying |s|¸ p, There exist x,y,z 2 * such that 1. 2. 3. 4. s=xyz |y|>0 |xy|· p For all i ¸ 0, x yi z 2 L Theorem REG µ RPP 16 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 2 RPP(q) and q>p then L (contrapositive of 1) 2 RPP(p) Thus if you have a proof that establishes L 2 RPP(q) only when q¸5, that's good enough: it follows that L is not regular Relevant for “C is not regular” problem 17 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 2 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! 18 Unraveling non-RPP (repeat) L is not in RPP if For every p¸0 (opponent choice) There exists some s2L satisfying |s| ¸ p such that (your choice) For every x,y,z 2 * satisfying 1-3: 1. 2. 3. s=xyz, (opponent's) |y|>0, and |xy|· p There exists some i ¸ 0 for which (yours) x yi z 2 L 19 Another example Let C = {0m 1n | m n }. Is C regular? Try to prove it isn't: Set s=0p 12p. If opponent chooses x=, y=0p, z=12p, then we can set i=2 and win because xy2z=02p 12p 2 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 20 Direct proof? Hmmm 21 Using closure properties Can simplify argument a great deal Fact If L is not regular then Lc is not regular either. Proof If L is not regular but Lc were regular, c c then (L ) would also be regular because c REG is closed under complement. But (Lc) =L QED Recall the languages B = { 0m 1n | m = n } C = { 0m 1n | m n } C is similar to Bc... 22 Using closure properties Start over: B = { 0m 1n | m = n } C = { 0m 1n | m n } Certainly B µ Cc (known nonreg) (suspected nonreg) If m=n then it's true that (not m n) But B Cc Find example x 2 Cc - B... On the other hand, B = 0*1* Å Cc 23 Using closure properties Fact If L1ÅL2 2 REG and L1 2 REG, then L2 2 REG Proof Suppose (a) L1Å L2 2 REG and L12 REG and (b) L22REG. Since REG is closed under Å we know that L1ÅL2 2 REG, but that contradicts assumption (a). Thus (a) and (b) can't both be true. QED 24
© Copyright 2026 Paperzz