# pumping lemma examples. l > = {a i b j : i > j} l > is not regular. we prove it using the pumping...

Post on 31-Mar-2015

217 views

Embed Size (px)

TRANSCRIPT

- Slide 1

Pumping Lemma Examples Slide 2 L > = {a i b j : i > j} L > is not regular. We prove it using the Pumping Lemma. Slide 3 L > = {a i b j : i > j} L > is not regular. Fix an arbitrary pumping length n>0. Slide 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 >. Slide 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 Slide 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 >. aaaaabbb n n+1 Slide 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. aaaaabbb n n+1 Slide 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 aaaaabbb n n+1 Slide 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 aaaaabbb n n+1 Slide 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 aaaaabbb nn+1 Slide 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. aaaaabbb L > = {a i b j : i > j} nn+1 Slide 12 aaabbb 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 Slide 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! Slide 14 L= { ww : w in { a,b } * } First, figure out what this language is. Slide 15 L= { ww : w in { a,b } * } First, figure out what this language is. A string in the language? Slide 16 First, figure out what this language is. A string in the language? aabaab L= { ww : w in { a,b } * } Slide 17 First, figure out what this language is. A string in the language? aabaab Another string in the language? Slide 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 Slide 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? Slide 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 Slide 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? Slide 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! ( = ) Slide 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? Slide 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! Slide 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? Slide 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! Slide 27 L= { ww : w in { a,b } * } First, figure out what this language is. L = {, aa, bb, aaaa, abab, baba, bbbb, aaaaaa } abaabba|abaabba Slide 28 L= { ww : w in { a,b } * } We prove that L is not regular by using the pumping lemma. Slide 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. Slide 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 Slide 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!!! Slide 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 aaaaaa|aaaaaa nn Slide 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 Slide 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 aaaaaaa|aaaaaaa z y n+1 y L Slide 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 aaaaaaaa|aaaaaaaa z y n+2 y L y Slide 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 aaaaa|aaaaa z n-1 L Slide 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! Slide 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 doesnt work!!! Slide 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 abababab|abababab nn Slide 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 abababab|abababab nn z y Slide 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 ababababab|ababababab n+1 y z y L Slide 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! Slide 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 doesnt work! Slide 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 aaaaaab|aaaa...aab nn Slide 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 Slide 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. Slide 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 Slide 48 L = { w 1 w 2 : w 1,w 2 {a,b} *,|w 1 |=|w 2 | } Is it regular? Slide 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 ... Slide 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 ... Slide 51 L = { w 1 w 2 : w 1,w 2 {a,b} *,|w 1 |=|w 2 | } Is i

Recommended