Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pumping Lemma Examples. L > = {a i b j : i > j} L > is not regular. We prove it using the Pumping Lemma.

Similar presentations


Presentation on theme: "Pumping Lemma Examples. L > = {a i b j : i > j} L > is not regular. We prove it using the Pumping Lemma."— Presentation transcript:

1 Pumping Lemma Examples

2 L > = {a i b j : i > j} L > is not regular. We prove it using the Pumping Lemma.

3 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0.

4 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >.

5 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. |s|≥ n

6 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. aaa…aabb…b n n+1

7 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties. aaa…aabb…b n n+1

8 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties. |xy|≤ n |y|≥ 1 aaa…aabb…b n n+1

9 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties. |xy|≤ n |y|≥ 1 aaa…aabb…b n n+1

10 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties. |xy|≤ n |y|≥ 1 aaa…aabb…b nn+1

11 L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties: y = a m, 1 ≤ m ≤ n. aaa…aabb…b L > = {a i b j : i > j} nn+1

12 aaabb…b nn+1-m L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties: y = a m, 1 ≤ m ≤ n. xz =a n+1-m b n ∉ L >. L > = {a i b j : i > j} n

13 L > is not regular. Fix an arbitrary pumping length n>0. Choose a proper string s in L >. s = a n+1 b n ϵ L >. Consider all possible splittings of s in x,y,z with the desired properties: y = a m, 1 ≤ m ≤ n. xz =a n+1-m b n ∉ L >. So L > is not regular!

14 L= { ww : w in { a,b } * } First, figure out what this language is.

15 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language?

16 First, figure out what this language is. A string in the language? aabaab L= { ww : w in { a,b } * }

17 First, figure out what this language is. A string in the language? aabaab Another string in the language?

18 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa

19 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language?

20 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb

21 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb Is ε in the language?

22 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb Is ε in the language? YES! (ε = εε)

23 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb Is ε in the language? YES! (ε = εε) Is aa in the language?

24 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb Is ε in the language? YES! (ε = εε) Is aa in the language? YES!

25 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb Is ε in the language? YES! (ε = εε) Is aa in the language? YES! Is a in the language?

26 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? aabaab Another string in the language? aaaaaa A string not in the language? abbb Is ε in the language? YES! (ε = εε) Is aa in the language? YES! Is a in the language? NO!

27 L= { ww : w in { a,b } * } First, figure out what this language is. L = {ε, aa, bb, aaaa, abab, baba, bbbb, aaaaaa …} abaabba|abaabba

28 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma.

29 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. First fix an arbitrary number n>0 to be the pumping length.

30 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language

31 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Choose wisely!!!

32 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n aaa…aaa|aaa…aaa nn

33 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n For x = ε, y = a 2, z = a 2n-2 z y nn

34 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n For x = ε, y = a 2, z = a 2n-2 aaaaa…aa|aaaa…aaa z y n+1 y ϵ L

35 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n For x = ε, y = a 2, z = a 2n-2 aaaaaaa…a|aaaaa…aaa z y n+2 y ϵ L y

36 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n For x = ε, y = a 2, z = a 2n-2 a…aaaa|aa…aaa z n-1 ϵ L

37 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n For x = ε, y = a 2, z = a 2n-2, there is no i: xy i z ∉ L!

38 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = a 2n For x = ε, y = a 2, z = a 2n-2, there is no i: xy i z ∉ L! s = a 2n doesn’t work!!!

39 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = (ab) 2n abab…abab|abab…abab nn

40 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = (ab) 2n For x = ε, y = abab, z = (ab) 2n-2 abab…abab|abab…abab nn z y

41 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = (ab) 2n For x = ε, y = abab, z = (ab) 2n-2 abababab…ab|ababab…abab n+1 y z y ϵ L

42 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = (ab) 2n For x = ε, y = abab, z = (ab) 2n-2 For any i, xy i z = (ab) 2i (ab) 2n-2 = (ab) 2(i-n-2) ϵ L!

43 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Example: For s = (ab) 2n For x = ε, y = abab, z = (ab) 2n-2 For any i, xy i z = (ab) 2i (ab) 2n-2 = (ab) 2(i-n-2) ϵ L! s = (ab) 2n doesn’t work!

44 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Use s = a n ba n b aaaa…aab|aaaa...aab nn

45 We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language. Use s = a n ba n b For any splitting of s in x,y,z with the desired properties: L= { ww : w in { a,b } * } nn

46 We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language Use s = a n ba n b For any splitting of s in x,y,z with the desired properties: y = a m with 1 ≤ m ≤ n.

47 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Pumping length: n Choose a proper string in the language Use s = a n ba n b For any splitting of s in x,y,z with the desired properties: y = a m with 1 ≤ m ≤ n. Observe that xy 2 z = a m+n ba n b is not in L QED

48 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular?

49 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? A first attempt to design a FA q 10 q 11 q 12 q 13 q 2n a,b q 2n-1 q 2n-2 q 2n-3 q 1n q 20 a,b ε...

50 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? A first attempt to design a FA fails! q 10 q 11 q 12 q 13 q 2n a,b q 2n-1 q 2n-2 q 2n-3 q 1n q 20 a,b ε...

51 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }.

52 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds!

53 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length k=2.

54 Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length k=2. – For every proper string s in L’, L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } abbba…abb|bbaba…aaa nn 2n≥2

55 abbba…abb|bbaba…aaa L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length k=2. – For every proper string s in L’, – split s in x, y, z with the desired properties. zy nn |y|≥1 and |xy|≤ 2

56 abbba…abb|bbaba…aaa L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length k=2. – For every proper string s in L’, – split s in x = ε,y = first two symbols of s, z = rest. zy nn

57 ababbba…ab|bbbaba…aaa L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length k=2. – For every proper string s in L’, – split s in x = ε,y = first two symbols of s, z = rest. – xy 2 z in L’. n+1 ϵ L’ zyy n+1

58 abababbba…a|bbbbaba…aaa L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length k=2. – For every proper string s in L’, – split s in x = ε,y = first two symbols of s, z = rest. – xy 3 z in L’. n+2 ϵ L’ zyyy n+2

59 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length n=2. – For every proper string s in L’, – split s in x = ε,y = first two symbols of s, z = rest. – xy 0 z in L’. bba…abbb|baba…aaa ϵ L’ z n-1

60 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Looks similar with L (L = {w 1 w 2 : w 1 = w 2 }. But the pumping lemma holds! – Fix pumping length n=2. – For every proper string s in L’, – split s in x = ε,y = first two symbols of s, z = rest. – For every i ≥ 0, xy i z in L’.

61 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Consider L’’ = {w : w has even length}.

62 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Consider L’’ = {w : w has even length}. Every string of even length abbbaabb….…bbabaaaa 2n

63 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Consider L’’ = {w : w has even length}. Every string of even length can be split into two parts of equal length abbbaabb… …bbabaaaa n | n

64 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Consider L’’ = {w : w has even length}. Every string of even length can be split into two parts of equal length and vice versa. abbbaabb….…bbabaaaa 2n

65 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Consider L’’ = {w : w has even length}. L’ = L’’ Every string of even length can be split into two parts of equal length and vice versa.

66 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? Consider L’’ = {w : w has even length} L’ = L’’ A DFA for L’’: odd a,b even a,b

67 L’ = { w 1 w 2 : w 1,w 2 ϵ {a,b} *,|w 1 |=|w 2 | } Is it regular? YES!!! L’ = L’’ A DFA for L’: odd a,b even


Download ppt "Pumping Lemma Examples. L > = {a i b j : i > j} L > is not regular. We prove it using the Pumping Lemma."

Similar presentations


Ads by Google