Fall 2003Costas Busch1 More Applications of The Pumping Lemma
Fall 2003Costas Busch2 The Pumping Lemma: there exists an integer such that for any string we can write For infinite context-free language with lengths and it must be:
Fall 2003Costas Busch3 Context-free languages Non-context free languages
Fall 2003Costas Busch4 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages
Fall 2003Costas Busch5 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma
Fall 2003Costas Busch6 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:
Fall 2003Costas Busch7 We can write: with lengths and Pumping Lemma says: for all
Fall 2003Costas Busch8 We examine all the possible locations of string in
Fall 2003Costas Busch9 Case 1: is within the first
Fall 2003Costas Busch10 Case 1: is within the first
Fall 2003Costas Busch11 Case 1: is within the first
Fall 2003Costas Busch12 Case 1: is within the first Contradiction!!! However, from Pumping Lemma:
Fall 2003Costas Busch13 is in the first Case 2:
Fall 2003Costas Busch14 is in the first Case 2:
Fall 2003Costas Busch15 is in the first Case 2:
Fall 2003Costas Busch16 is in the first Case 2: Contradiction!!! However, from Pumping Lemma:
Fall 2003Costas Busch17 is in the first overlaps the first Case 3:
Fall 2003Costas Busch18 is in the first overlaps the first Case 3:
Fall 2003Costas Busch19 is in the first overlaps the first Case 3:
Fall 2003Costas Busch20 is in the first overlaps the first Case 3: Contradiction!!! However, from Pumping Lemma:
Fall 2003Costas Busch21 Overlaps the first in the first Case 4: Analysis is similar to case 3
Fall 2003Costas Busch22 Other cases: is within or Analysis is similar to case 1:
Fall 2003Costas Busch23 More cases: overlaps or Analysis is similar to cases 2,3,4:
Fall 2003Costas Busch24 Since, it is impossible to overlap: There are no other cases to consider nor
Fall 2003Costas Busch25 In all cases we obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free
Fall 2003Costas Busch26 Context-free languages Non-context free languages
Fall 2003Costas Busch27 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages
Fall 2003Costas Busch28 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma
Fall 2003Costas Busch29 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:
Fall 2003Costas Busch30 We can write: with lengths and Pumping Lemma says: for all
Fall 2003Costas Busch31 We examine all the possible locations of string in There is only one case to consider
Fall 2003Costas Busch32
Fall 2003Costas Busch33
Fall 2003Costas Busch34
Fall 2003Costas Busch35
Fall 2003Costas Busch36 Since, for we have:
Fall 2003Costas Busch37
Fall 2003Costas Busch38 Contradiction!!! However, from Pumping Lemma:
Fall 2003Costas Busch39 We obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free
Fall 2003Costas Busch40 Context-free languages Non-context free languages
Fall 2003Costas Busch41 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages
Fall 2003Costas Busch42 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma
Fall 2003Costas Busch43 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:
Fall 2003Costas Busch44 We can write: with lengths and Pumping Lemma says: for all
Fall 2003Costas Busch45 We examine all the possible locations of string in
Fall 2003Costas Busch46 Most complicated case: is in
Fall 2003Costas Busch47
Fall 2003Costas Busch48 Most complicated sub-case:and
Fall 2003Costas Busch49 Most complicated sub-case:and
Fall 2003Costas Busch50 Most complicated sub-case:and
Fall 2003Costas Busch51 and
Fall 2003Costas Busch52
Fall 2003Costas Busch53 However, from Pumping Lemma: Contradiction!!!
Fall 2003Costas Busch54 When we examine the rest of the cases we also obtain a contradiction
Fall 2003Costas Busch55 In all cases we obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free