Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pumping Lemma Examples

Similar presentations


Presentation on theme: "Pumping Lemma Examples"— Presentation transcript:

1 Pumping Lemma Examples

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

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

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

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

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

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

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

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

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

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

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

13 L> = {aibj : i > j} L> is not regular.
Fix an arbitrary pumping length n>0. Choose a proper string s in L>. s = an+1bn ϵ L>. Consider all possible splittings of s in x,y,z with the desired properties: y = am, 1 ≤ m ≤ n. xz =an+1-mbn ∉ 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 L={ww : w in {a,b}*} First, figure out what this language is.
A string in the language? aabaab

17 L={ww : w in {a,b}*} 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 abaabba|abaabba 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}*} aaa…aaa|aaa…aaa
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 = a2n aaa…aaa|aaa…aaa n n

33 L={ww : w in {a,b}*} aaa…aaa|aaa…aaa
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 = a2n For x = ε, y = a2, z = a2n-2 y z aaa…aaa|aaa…aaa n n

34 L={ww : w in {a,b}*} aaaaa…aa|aaaa…aaa ϵ L
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 = a2n For x = ε, y = a2, z = a2n-2 y y z aaaaa…aa|aaaa…aaa ϵ L n+1 n+1

35 L={ww : w in {a,b}*} aaaaaaa…a|aaaaa…aaa ϵ L
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 = a2n For x = ε, y = a2, z = a2n-2 y y y z aaaaaaa…a|aaaaa…aaa ϵ L n+2 n+2

36 L={ww : w in {a,b}*} a…aaaa|aa…aaa ϵ L
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 = a2n For x = ε, y = a2, z = a2n-2 z a…aaaa|aa…aaa ϵ L n-1 n-1

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 = a2n For x = ε, y = a2, z = a2n-2, there is no i: xyiz ∉ 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 = a2n For x = ε, y = a2, z = a2n-2, there is no i: xyiz ∉ L! s = a2n doesn’t work!!!

39 L={ww : w in {a,b}*} abab…abab|abab…abab
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 n n

40 L={ww : w in {a,b}*} abab…abab|abab…abab
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 y z abab…abab|abab…abab n n

41 abababab…ab|ababab…abab
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 y y z abababab…ab|ababab…abab ϵ L n+1 n+1

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, xyiz = (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, xyiz = (ab)2i(ab)2n-2 = (ab)2(i-n-2) ϵ L! s = (ab)2n doesn’t work!

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

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

46 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 = anbanb For any splitting of s in x,y,z with the desired properties: y = am 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 = anbanb For any splitting of s in x,y,z with the desired properties: y = am with 1 ≤ m ≤ n. Observe that xy2z = am+nbanb is not in L QED

48 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular?

49 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? A first attempt to design a FA q10 a,b q11 a,b q12 a,b q13 a,b ... q1n ε q2n a,b a,b a,b a,b ... q20 q2n-1 q2n-2 q2n-3

50 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? A first attempt to design a FA fails! q10 a,b q11 a,b q12 a,b q13 a,b ... q1n Works for string sizes up to n! ε q2n a,b a,b a,b a,b ... q20 q2n-1 q2n-2 q2n-3

51 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}.

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

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

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

55 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}. 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. |y|≥1 and |xy|≤ 2 y z abbba…abb|bbaba…aaa n n

56 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}. 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. y z abbba…abb|bbaba…aaa n n

57 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}. 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. xy2z in L’. y y z ababbba…ab|bbbaba…aaa ϵ L’ n+1 n+1

58 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}. 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. xy3z in L’. y y y z abababbba…a|bbbbaba…aaa ϵ L’ n+2 n+2

59 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}. 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. xy0z in L’. z bba…abbb|baba…aaa ϵ L’ n-1 n-1

60 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Looks similar with L (L = {w1w2 : w1 = w2}. 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, xyiz in L’.

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

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

63 L’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
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’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
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’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
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’ = {w1w2 : w1,w2 ϵ {a,b}*,|w1|=|w2|}
Is it regular? Consider L’’ = {w : w has even length} L’ = L’’ A DFA for L’’: a,b even odd a,b

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


Download ppt "Pumping Lemma Examples"

Similar presentations


Ads by Google