Presentation is loading. Please wait.

Presentation is loading. Please wait.

Costas Busch1 More Applications of The Pumping Lemma.

Similar presentations


Presentation on theme: "Costas Busch1 More Applications of The Pumping Lemma."— Presentation transcript:

1 Costas Busch1 More Applications of The Pumping Lemma

2 Costas 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:

3 Costas Busch3 Context-free languages Non-context free languages

4 Costas Busch4 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages

5 Costas Busch5 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma

6 Costas Busch6 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:

7 Costas Busch7 We can write: with lengths and Pumping Lemma says: for all

8 Costas Busch8 We examine all the possible locations of string in

9 Costas Busch9 Case 1: is within the first

10 Costas Busch10 Case 1: is within the first

11 Costas Busch11 Case 1: is within the first

12 Costas Busch12 Case 1: is within the first Contradiction!!! However, from Pumping Lemma:

13 Costas Busch13 is in the first Case 2:

14 Costas Busch14 is in the first Case 2:

15 Costas Busch15 is in the first Case 2:

16 Costas Busch16 is in the first Case 2: Contradiction!!! However, from Pumping Lemma:

17 Costas Busch17 is in the first overlaps the first Case 3:

18 Costas Busch18 is in the first overlaps the first Case 3:

19 Costas Busch19 is in the first overlaps the first Case 3:

20 Costas Busch20 is in the first overlaps the first Case 3: Contradiction!!! However, from Pumping Lemma:

21 Costas Busch21 Overlaps the first in the first Case 4: Analysis is similar to case 3

22 Costas Busch22 Other cases: is within or Analysis is similar to case 1:

23 Costas Busch23 More cases: overlaps or Analysis is similar to cases 2,3,4:

24 Costas Busch24 Since, it is impossible to overlap: There are no other cases to consider nor

25 Costas Busch25 In all cases we obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free

26 Costas Busch26 Context-free languages Non-context free languages

27 Costas Busch27 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages

28 Costas Busch28 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma

29 Costas Busch29 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:

30 Costas Busch30 We can write: with lengths and Pumping Lemma says: for all

31 Costas Busch31 We examine all the possible locations of string in There is only one case to consider

32 Costas Busch32

33 Costas Busch33

34 Costas Busch34

35 Costas Busch35

36 Costas Busch36 Since, for we have:

37 Costas Busch37

38 Costas Busch38 Contradiction!!! However, from Pumping Lemma:

39 Costas Busch39 We obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free

40 Costas Busch40 Context-free languages Non-context free languages

41 Costas Busch41 Theorem: The language is not context free Proof: Use the Pumping Lemma for context-free languages

42 Costas Busch42 Assume for contradiction that is context-free Since is context-free and infinite we can apply the pumping lemma

43 Costas Busch43 Pumping Lemma gives a magic number such that: Pick any string of with length at least we pick:

44 Costas Busch44 We can write: with lengths and Pumping Lemma says: for all

45 Costas Busch45 We examine all the possible locations of string in

46 Costas Busch46 Most complicated case: is in

47 Costas Busch47

48 Costas Busch48 Most complicated sub-case:and

49 Costas Busch49 Most complicated sub-case:and

50 Costas Busch50 Most complicated sub-case:and

51 Costas Busch51 and

52 Costas Busch52

53 Costas Busch53 However, from Pumping Lemma: Contradiction!!!

54 Costas Busch54 When we examine the rest of the cases we also obtain a contradiction

55 Costas Busch55 In all cases we obtained a contradiction Therefore: The original assumption that is context-free must be wrong Conclusion:is not context-free


Download ppt "Costas Busch1 More Applications of The Pumping Lemma."

Similar presentations


Ads by Google