1 / 67

Pumping Lemma Examples

Pumping Lemma Examples. L > = { a i b j : i > j}. L > is not regular. We prove it using the Pumping Lemma. L > = { a i b j : i > j}. L > is not regular. Fix an arbitrary pumping length n>0. L > = { a i b j : i > j}. L > is not regular. Fix an arbitrary pumping length n>0.

giza
Download Presentation

Pumping Lemma Examples

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pumping LemmaExamples

  2. 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 properstring s in L>. |s|≥ n

  6. 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>. aaa…aabb…b n n+1

  7. 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. aaa…aabb…b n n+1

  8. 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. |xy|≤ n |y|≥ 1 aaa…aabb…b n n+1

  9. 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. |xy|≤ n |y|≥ 1 aaa…aabb…b n n+1

  10. 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. |xy|≤ n |y|≥ 1 Y aaa…aabb…b n+1 n

  11. 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. Y aaa…aabb…b n+1 n

  12. 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>. 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. 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 = a2n aaa…aaa|aaa…aaa n n

  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 = a2n • For x = ε,y = a2, z = a2n-2 y z aaa…aaa|aaa…aaa n n

  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 = 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}*} 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}*} 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}*} 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}*} 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. 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}*} 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. 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 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 ... a,b q10 q11 a,b q12 a,b q13 a,b q1n ε ... a,b a,b a,b a,b q2n 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! ... a,b q10 q11 a,b q12 a,b q13 a,b q1n Works for string sizes up to n! ε ... a,b a,b a,b a,b q2n q20 q2n-1 q2n-2 q2n-3

More Related