THE PUMPING LEMMA PROVING A LANGUAGE IS NOT REGULAR Dr. Cynthia Lee - UCSD - Spring 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia.

Slides:



Advertisements
Similar presentations
Pumping Lemma Problem: Solution:
Advertisements

Introducing DFA Formal Description Using Peer Instruction Cynthia Bailey Lee UCSD 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia.
3.2 Pumping Lemma for Regular Languages Given a language L, how do we know whether it is regular or not? If we can construct an FA to accept the language.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
1 Introduction to Computability Theory Discussion3: Uses of the Pumping Lemma Prof. Amos Israeli.
CS21 Decidability and Tractability
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
Lecture 15UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 15.
Automata and Formal Languages Tim Sheard 1 Lecture 8 Pumping Lemma & Distinguishability Jim Hook Tim Sheard Portland State University.
Courtesy Costas Busch - RPI1 More Applications of the Pumping Lemma.
Foundations of (Theoretical) Computer Science Chapter 1 Lecture Notes (more on Section 1.4) David Martin This work is licensed under.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
Courtesy Costas Busch - RPI1 The Pumping Lemma for Context-Free Languages.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
1 Introduction to Computability Theory Lecture4: Non Regular Languages Prof. Amos Israeli.
1 The Pumping Lemma for Context-Free Languages. 2 Take an infinite context-free language Example: Generates an infinite number of different strings.
1 Module 36 Non context-free languages –Examples and Intuition Pumping lemma for CFL’s –Pumping condition –No proof of pumping lemma –Applying pumping.
1 More Applications of the Pumping Lemma. 2 The Pumping Lemma: Given a infinite regular language there exists an integer for any string with length we.
Fall 2004COMP 3351 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
Fall 2006Costas Busch - RPI1 More Applications of the Pumping Lemma.
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
1 Non-regular languages. 2 Regular languages Non-regular languages.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Extra on Regular Languages and Non-Regular Languages
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Announcements Homework – HW8 due Tues 5/29 11am – HW5 grades are out Monday is Memorial Day; no office hours, etc. – Go see a parade, or some fireworks,
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Tutorial: Reduction from A TM Proofs Dr. Cynthia Lee CSE 105, UCSD Spring 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee,
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
CS 3240 – Chapter 4.  Closure Properties  Algorithms for Elementary Questions:  Is a given word, w, in L?  Is L empty, finite or infinite?  Are L.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Introduction to Programming in MATLAB Intro. MATLAB Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
Cs3102: Theory of Computation Class 5: Non-Regular Languages Spring 2010 University of Virginia David Evans TexPoint fonts used in EMF. Read the TexPoint.
CS355 - Theory of Computation Regular Expressions.
Non-Context-Free Languages Section 2.3 CSC 4170 Theory of Computation.
Theory of Computation 1 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike.
1 Find as many examples as you can of w, x, y, z so that w is accepted by this DFA, w = x y z, y ≠ ε, | x y | ≤ 7, and x y n z is in L for all n ≥ 0.
CS 173, Lecture B August 27, 2015 Tandy Warnow. Proofs You want to prove that some statement A is true. You can try to prove it directly, or you can prove.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
 2004 SDU Lecture8 NON-Context-free languages.  2004 SDU 2 Are all languages context free? Ans: No. # of PDAs on  < # of languages on  Pumping lemma:
Lecture 8UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8.
Complexity and Computability Theory I Lecture #12 Instructor: Rina Zviel-Girshin Lea Epstein.
CSE 105 Theory of Computation Alexander Tsiatas Spring 2012 Theory of Computation Lecture Slides by Alexander Tsiatas is licensed under a Creative Commons.
Dept. of Computer Science & IT, FUUAST Automata Theory 2 Automata Theory III Properties of Regular Languages 1.Closure 2.Union 3.Concatenation 4.Complement(Negation)
CSE 105 theory of computation
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
CS 154, Lecture 4: Limitations on DFAs (I),
Elementary Questions about Regular Languages
Non-regular languages
CS21 Decidability and Tractability
More Applications of the Pumping Lemma
COSC 3340: Introduction to Theory of Computation
CSCI 2670 Introduction to Theory of Computing
Intro to Theory of Computation
Presentation transcript:

THE PUMPING LEMMA PROVING A LANGUAGE IS NOT REGULAR Dr. Cynthia Lee - UCSD - Spring 2011 Theory of Computation Peer Instruction Lecture Slides by Dr. Cynthia Lee, UCSD are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. Based on a work at Cynthia Lee, UCSDCreative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported Licensewww.peerinstruction4cs.org

The Pumping Lemma: A One-Act Play Your Script “I’m giving you a language L.” “Uh…sure…let’s just say it’s Regular.” “Excellent. I’m giving you this string s that I made using your p. It is in L and |s| >= p. I think you’ll really like it.” “Hm. I followed your directions for xyz, but when I [copy y N times or delete y], the new string is NOT is L! What happened to your 100% Warranty??!” Pumping Lemma’s Script “Is L Regular? In this shop I only work on Regular Languages.” “Thanks. For the language L that you’ve given me, I pick this nice pumping length I call p.” “Great string, thanks. I’ve cut s up into parts xyz for you. I won’t tell you what they are exactly, but I will say this: |y| > 0 and |xy| <= p. Also, I make you this 100% Lifetime Warranty: you can remove y, or copy it as many times as you like, and the new string will still be in L, I promise!” “Well, then L wasn’t a Regular Language. Since you lied, the Warranty was void. Thanks for playing.”

How to use the Pumping Lemma Script to write a Pumping Lemma Proof (1) Let’s look at the parts of your script: – Picking language L: Done—given to you in the homework/exam problem – Start the proof: Proof by contradiction: Assume L is regular – Picking s: Here you need to get creative Try several things, remember: – s must be in L – |s| must be >= p (often do this by making some pattern repeat p times, e.g., s = “0 p 1 p ” is clearly of length >= p)

The Pumping Lemma: A One-Act Play Your Script “I’m giving you a language L.” “Uh…sure…let’s just say it’s Regular.” “Excellent. I’m giving you this string s that I made using your p. It is in L and |s| >= p. I think you’ll really like it.” “Hm. I followed your directions for xyz, but when I [copy y N times or delete y], the new string is NOT is L! What happened to your 100% Warranty??!” Pumping Lemma’s Script “Is L Regular? In this shop I only work on Regular Languages.” “Thanks. For the language L that you’ve given me, I pick this nice pumping length I call p.” “Great string, thanks. I’ve cut s up into parts xyz for you. I won’t tell you what they are exactly, but I will say this: |y| > 0 and |xy| <= p. Also, I make you this 100% Lifetime Warranty: you can remove y, or copy it as many times as you like, and the new string will still be in L, I promise!” “Well, then L wasn’t a Regular Language. Since you lied, the Warranty was void. Thanks for playing.”

How to use the Pumping Lemma Script to write a Pumping Lemma Proof (2) Let’s look at the parts of your script: – Picking i (the number of times to copy part y): For many problems, two main ways to go: i = big: (say, 3 or p), or i = 0 (delete y) Try both and see if either “breaks” s (makes a string not in L) If several tries don’t work, you may need to design a different s – End the proof: Once you find an i/s pair that “breaks” the warranty, this is a contradiction, and so the assumption is false, and L is not Regular. QED.

Pumping Lemma Practice Thm. L = {O n 1 m O n | m,n >= 0} is not regular. Proof (by contradiction): Assume (towards contradiction) that L is regular. Then the pumping lemma applies to L. Let p be the pumping length. Choose s to be the string _________. The pumping lemma guarantees s can be divided into parts xyz s.t. for any i>=0, xy i z is in L, and that |y|>0 and |xy|<=p. But if we let i = ____, we get the string XXXX, which is not in L, a contradiction. Therefore the assumption is false, and L is not regular. Q.E.D. a)s = , i = 5 b)s = 0 p 10 p, i=0 c)s = (010) p, i=5 d)None or more than one of the above e)I don’t understand this at all

Pumping Lemma Practice Thm. L = {O n 1 n | n >= 0} is not regular. Proof (by contradiction): Assume (towards contradiction) that L is regular. Then the pumping lemma applies to L. Let p be the pumping length. Choose s to be the string _________. The pumping lemma guarantees s can be divided into parts xyz s.t. for any i>=0, xy i z is in L, and that |y|>0 and |xy|<=p. But if we let i = ____, we get the string XXXX, which is not in L, a contradiction. Therefore the assumption is false, and L is not regular. Q.E.D. a)s = , i = 0 b)s = , i=6 c)s = 0 p 1 p, i=1 d)s = 0 i 1 i, i=5 e)None or more than one of the above

Pumping Lemma Practice Thm. L = {ww r | w r is the reverse of w} is not regular. Proof (by contradiction): Assume (towards contradiction) that L is regular. Then the pumping lemma applies to L. Let p be the pumping length. Choose s to be the string _________. The pumping lemma guarantees s can be divided into parts xyz s.t. for any i>=0, xy i z is in L, and that |y|>0 and |xy|<=p. But if we let i = ____, we get the string XXXX, which is not in L, a contradiction. Therefore the assumption is false, and L is not regular. Q.E.D. a)s = , i=6 b)s = 0 p 0 p, i=2 c)s = 0 p 110 p, i = 2 d)None or more than one of the above