Download presentation

Presentation is loading. Please wait.

1
Fall 2003Costas Busch1 More Applications of The Pumping Lemma

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

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

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

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

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

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

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

9
Fall 2003Costas Busch9 Case 1: is within the first

10
Fall 2003Costas Busch10 Case 1: is within the first

11
Fall 2003Costas Busch11 Case 1: is within the first

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

13
Fall 2003Costas Busch13 is in the first Case 2:

14
Fall 2003Costas Busch14 is in the first Case 2:

15
Fall 2003Costas Busch15 is in the first Case 2:

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

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

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

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

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

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

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

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

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

25
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

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

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

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

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

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

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

32
Fall 2003Costas Busch32

33
Fall 2003Costas Busch33

34
Fall 2003Costas Busch34

35
Fall 2003Costas Busch35

36
Fall 2003Costas Busch36 Since, for we have:

37
Fall 2003Costas Busch37

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

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

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

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

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

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

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

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

46
Fall 2003Costas Busch46 Most complicated case: is in

47
Fall 2003Costas Busch47

48
Fall 2003Costas Busch48 Most complicated sub-case:and

49
Fall 2003Costas Busch49 Most complicated sub-case:and

50
Fall 2003Costas Busch50 Most complicated sub-case:and

51
Fall 2003Costas Busch51 and

52
Fall 2003Costas Busch52

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

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

55
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

Similar presentations

© 2021 SlidePlayer.com Inc.

All rights reserved.

To make this website work, we log user data and share it with processors. To use this website, you must agree to our Privacy Policy, including cookie policy.

Ads by Google