Lecture 10 Pumping Lemma A property of regular sets.

Slides:



Advertisements
Similar presentations
Chapter Eleven: Non-Regular Languages
Advertisements

CSCI 3130: Formal languages and automata theory Tutorial 5
1 Pumping Lemma –A technique for proving a language L is NOT regular –What does the Pumping Lemma mean? –Proof of Pumping Lemma.
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.
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
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.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
1 More Properties of Regular Languages. 2 We have proven Regular languages are closed under: Union Concatenation Star operation Reverse.
127 The Chomsky Hierarchy(review) Recursively Enumerable Sets Turing Machines Post System Markov Algorithms,  -recursive Functions Regular Expression.
Costas Busch - RPI1 Standard Representations of Regular Languages Regular Languages DFAs NFAs Regular Expressions Regular Grammars.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Limitations.
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.
Courtesy Costas Busch - RPI1 Non-regular languages.
Transparency No. 7-1 Formal Language and Automata Theory Chapter 7 Limitations of Finite Automata (lecture 11 and 12)
Homework 4 Solutions.
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.
Lecture 7UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 7.
1 Background Information for the Pumping Lemma for Context-Free Languages Definition: Let G = (V, T, P, S) be a CFL. If every production in P is of the.
Prof. Busch - LSU1 Non-regular languages (Pumping Lemma)
Prof. Busch - LSU1 More Applications of the Pumping Lemma.
1 Non-regular languages. 2 Regular languages Non-regular languages.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 5 School of Innovation, Design and Engineering Mälardalen University 2012.
Tutorial CSC3130 : Formal Languages and Automata Theory Haifeng Wan ( )
Introduction to CS Theory
Solution Exercise 1.43 a A r r s q q > b b e b s’ q r q’ b r’ a A’
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
Class Discussion Can you draw a DFA that accepts the language {a k b k | k = 0,1,2,…} over the alphabet  ={a,b}?
1 Recap lecture 27 Pumping lemma version II, proof, examples, Myhill Nerode theorem, examples.
Chapter 6 Properties of Regular Languages. 2 Regular Sets and Languages  Claim(1). The family of languages accepted by FSAs consists of precisely the.
Context Free Pumping Lemma. CFL Pumping Lemma A CFL pump consists of two non-overlapping substrings that can be pumped simultaneously while staying in.
Conversions & Pumping Lemma CPSC 388 Fall 2001 Ellen Walker Hiram College.
CS 203: Introduction to Formal Languages and Automata
CSCI 3130: Formal languages and automata theory Tutorial 3 Chin.
1 Applications of pumping lemma(Dr. Torng) Applications of Pumping Lemma –General proof template What is the same in every proof What changes in every.
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.
Cs466(Prasad)L11PLEG1 Examples Applying Pumping Lemma.
Lecture 8UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 8.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Pumping Lemma.
Non-regular languages
Standard Representations of Regular Languages
CSE322 PUMPING LEMMA FOR REGULAR SETS AND ITS APPLICATIONS
Lecture 15 Pumping Lemma.
Nonregular Languages Section 2.4 Wed, Oct 5, 2005.
Pumping Lemma for Regular Languages some languages are not regular!
Properties of Regular Languages
Infiniteness Test The Pumping Lemma Nonregular Languages
Definition: Let G = (V, T, P, S) be a CFL
Hopcroft, Motawi, Ullman, Chap 4, sections 4.1 and 4.2
Properties of Regular Languages
Elementary Questions about Regular Languages
Non-regular languages
Properties of Context-Free Languages
Pumping Lemma September 29, 2006
Pumping Lemma.
Chapter 4 Properties of Regular Languages
Non-Regular Languages
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
More Applications of the Pumping Lemma
Non-regular languages
Non-regular languages
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
CHAPTER 1 Regular Languages
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Lecture 10 Pumping Lemma A property of regular sets

Weak version Strong version Applications

Pumping Lemma (weak) If a language L is accepted by a DFA M with m states, then any string x in L with |x| > m can be written as x = uvw such that (1) v ≠ε, and (2) uv*w is a subset of L (i.e., for any n> 0, uv w in L). n

Proof Consider the path associated with x (|x| > m). x Since |x| > m, # of nodes on the path is At least m+1. Therefore, there is a state Appearing twice.

u v w v ≠ εbecause M is DFA uw in L because there is a path associated with uw from initial state to a final state. uv w in L n due to the same reason as above

L={0 | n is a prime} is not regular. Proof. For contradiction, suppose L is regular. So, L=L(M) for some DFA M. Let m be the number of states of M. Consider a prime p > m. By Pumping Lemma, 0 = uvw such that v≠ε and uv*w is a subset of L. Thus, p = |u| + |v| + |w| and for any k > 0, |u|+k|v|+|w| is a prime. n p

For k =0, |u|+|w| is a prime. For k=|u|+|w|, |u|+k|v|+|w| = (|u|+|w|)(1+|v|) is a prime. (-><-)

L={0 1 | i > 0 } is not regular. Proof. For contradiction, suppose L is regular. So, L= L(M) for some DFA M. Suppose M has m states. Consider 0 1. mm By Pumping Lemma, 0 1 = uvw such that v ≠ ε and for n > 0, uv w in L. m m n Case 1. v is a substring of 0. m uw in L, but uw contains less 0’s than 1’s. (-><-) Case 2. v is a substring of 1. m uw in L, but uw contains less 1’s than 0’s. (-><-) ii

Case 3. v contains both 0 and 1. uvvw in L, but uvvw contains 10. (-><-)

Pumping Lemma (strong) If a language L is accepted by a DFA M with m states, then any string xyz in L with |y| > m can be written as y = uvw such that (1) v ≠ ε, and (2) xuv*wz is a subset of L. (for n>0, xuv wy in L) n

Proof Since M is DFA, there is a path from initial state to a final state, associated with xyz. x yz pq Since |y|>m, there are at least m+1 nodes between p and q. Hence, there is a state r appearing twice.

p q r xz u v w v≠εbecause M is DFA (without ε-move). xuwz in L because a path associated with xuwz exists from initial state to a final state. xuvvwz in L because a path associated with xuvvwz exists from initial state to a final state. xuv wz in L n

L={0 1 | i > 0 } is not regular. Proof. For contradiction, suppose L is regular. So, L= L(M) for some DFA M. Suppose M has m states. Consider 0 1. mm By Pumping Lemma, 0 = uvw such that v ≠ ε and for n > 0, uv w1 in L. m nm uw1 in L, but uw contains less than m 0’s. (-><-) ii m

L={x in (0+1)* | # 1 (x) = # 0 (x) } is not regular. Proof. For contradiction, suppose L is regular. So, L= L(M) for some DFA M. Suppose M has m states. Consider 0 1. mm By Pumping Lemma, 0 = uvw such that v ≠ ε and for n > 0, uv w1 in L. m nm uw1 in L, but uw contains less than m 0’s. (-><-) m

L={0 1 | i > j > 0 } is not regular. Proof. For contradiction, suppose L is regular. So, L= L(M) for some DFA M. Suppose M has m states. Consider 0 1. mm By Pumping Lemma, 0 = uvw such that v ≠ ε and for n > 0, uv w1 in L. m nm uw1 in L, but uw contains less than m 0’s. (-><-) ij m

L={0 1 | i > j > 0 } is not regular. Proof. For contradiction, suppose L is regular. So, L= L(M) for some DFA M. Suppose M has m states. Consider mm By Pumping Lemma, 0 = uvw such that v ≠ ε and for n > 0, 0uv w1 in L. m n m 0uw1 in L, but uw contains less than m 0’s. (-><-) ij m

L={a b c | i + j = k, i > 0, j > 0, k > 0 } is not regular. Proof. For contradiction, suppose L is regular. So, L= L(M) for some DFA M. Suppose M has m states. Consider b c. mm By Pumping Lemma, b = uvw such that v ≠ ε and for n > 0, uv wc in L. m nm uwc in L, but uw contains less than m b’s. (-><-) ij m k

L = { 0 | i > 0 } is not regular. i Proof. For contradiction, suppose L is regular. So, L=L(M) for some DFA M. Suppose M has m states. Consider 0. 2 m 2 By Pumping Lemma, 0 = uvw such that v ≠ ε and for n > 0, uv w in L. m 2 n Set a=|v| and b=|uw|. Then a > 0 and for n > 0, an+b is a square. Specially, when n=0, b is a square. Set b = cc. When n = a+2c, an+cc = (a+c). 2

Now, consider n=a+2c+1. Note that an+b = (a+c) +a. 2 But, (a+c+1) = (a+c) + 2(a+c) + 1 > (a+c) + a. 2 2 Hence, (a+c) +a cannot be a square. (-><-) 2 2

Puzzle