Pumping Lemma Examples

Slides:



Advertisements
Similar presentations
Properties of Regular Languages
Advertisements

MULTIPLYING MONOMIALS TIMES POLYNOMIALS (DISTRIBUTIVE PROPERTY)
Chapter Eleven: Non-Regular Languages
Chapter 6 Languages: finite state machines
L ECTURE 3 T HEORY OF AUTOMATA. E QUIVALENT R EGULAR E XPRESSIONS Definition Two regular expressions are said to be equivalent if they generate the same.
Lecture 9,10 Theory of AUTOMATA
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY
CSCI 2670 Introduction to Theory of Computing September 13, 2005.
1 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY (For next time: Read Chapter 1.3 of the book)
1 Lecture 22 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
CS 310 – Fall 2006 Pacific University CS310 Pumping Lemma Sections:1.4 page 77 September 27, 2006.
Strings and Languages Operations
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
CS5371 Theory of Computation Lecture 5: Automata Theory III (Non-regular Language, Pumping Lemma, Regular Expression)
1 1. Show the result of each of the following set operations in terms of set property. Write your sets as simple as possible. (a) L 0  L 4 (b) L 0  L.
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
LING 438/538 Computational Linguistics Sandiway Fong Lecture 12: 10/5.
Transparency No. 7-1 Formal Language and Automata Theory Chapter 7 Limitations of Finite Automata (lecture 11 and 12)
Homework 4 Solutions.
FSA Lecture 1 Finite State Machines. Creating a Automaton  Given a language L over an alphabet , design a deterministic finite automaton (DFA) M such.
CS 3240 – Chuck Allison.  A model of computation  A very simple, manual computer (we draw pictures!)  Our machines: automata  1) Finite automata (“finite-state.
1 Module 24 Myhill-Nerode Theorem –distinguishability –equivalence classes of strings –designing FSA’s –proving a language L is not regular.
Second lecture REGULAR EXPRESSION. Regular Expression.
1 Welcome to ! Theory Of Automata. 2 Text and Reference Material 1.Introduction to Computer Theory, by Daniel I. Cohen, John Wiley and Sons, Inc., 1991,
Formal Methods in SE Theory of Automata Qasiar Javaid Assistant Professor Lecture # 06.
Lecture Two: Formal Languages Formal Languages, Lecture 2, slide 1 Amjad Ali.
1 Language Definitions Lecture # 2. Defining Languages The languages can be defined in different ways, such as Descriptive definition, Recursive definition,
Recap Lecture-2 Kleene Star Closure, Plus operation, recursive definition of languages, INTEGER, EVEN, factorial, PALINDROME, {anbn}, languages of strings.
Module 2 How to design Computer Language Huma Ayub Software Construction Lecture 8.
L ECTURE 3 Chapter 4 Regular Expressions. I MPORTANT T ERMS Regular Expressions Regular Languages Finite Representations.
Recursive Definitions & Regular Expressions (RE)
Chapter 4 Pumping Lemma Properties of Regular Languages Decidable questions on Regular Languages.
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.
Lecture 02: Theory of Automata:08 Theory of Automata.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 2 Mälardalen University 2010.
CSC312 Automata Theory Lecture # 3 Languages-II. Formal Language A formal language is a set of words—that is, strings of symbols drawn from a common alphabet.
CS 203: Introduction to Formal Languages and Automata
Homework 4 due 11/25.
Figure **: Adjusted average student learning score against unit cost Unit Cost (fcfa) Average adjusted student learning score.
Lecture # 4.
Mathematical Foundations of Computer Science Chapter 3: Regular Languages and Regular Grammars.
Lecture 03: Theory of Automata:2014 Asif Nawaz Theory of Automata.
1 1. Eliminate all  -transitions from the following FA without changing the number of states and the language accepted by the automaton. You should also.
CHAPTER TWO LANGUAGES By Dr Zalmiyah Zakaria.
Lecture # 8 (Transition Graphs). Example Consider the language L of strings, defined over Σ={a, b}, having (containing) triple a or triple b. Consider.
1 Advanced Theory of Computation Finite Automata with output Pumping Lemma Theorem.
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Page 1. 1)Let B n = { a k | where k is a multiple of n}. I.e. B 1 = { a k | where k is a multiple of 1} = { a k | k Є {0,1,2,3,…}} = {‘’, a, aa, aaa, aaaa,
Non-regular languages - The pumping lemma
Pumping Lemma.
Theory of Computation Lecture #
Lecture # 2.
Regular Languages, Regular Operations, Closure
Theory of Automata.
Regular Expressions (Examples)
PROGRAMMING LANGUAGES
Lecture5 Non-regular languages
Recap lecture 29 Example of prefixes of a language, Theorem: pref(Q in R) is regular, proof, example, Decidablity, deciding whether two languages are equivalent.
Pumping Lemma.
MA/CSSE 474 Theory of Computation Minimizing DFSMs.
Recap lecture 26 Example of nonregular language, pumping lemma version I, proof, examples,
Instructor: Aaron Roth
Instructor: Aaron Roth
Recap lecture 25 Intersection of two regular languages is regular, examples, non regular languages, example.
CSC312 Automata Theory Lecture # 5 Chapter # 4 Cont…
CSC312 Automata Theory Lecture # 3 Languages-II.
Welcome to ! Theory Of Automata Irum Feroz
Recap Lecture 3 RE, Recursive definition of RE, defining languages by RE, { x}*, { x}+, {a+b}*, Language of strings having exactly one aa, Language of.
Prepared by- Patel priya( ) Guided by – Prof. Archana Singh Gandhinagar Institute of Technology SUBJECT - CD ( ) Introcution to Regular.
Finite Automata Part Three
Presentation transcript:

Pumping Lemma Examples

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.

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

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

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

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

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

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

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

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

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

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

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!

L={ww : w in {a,b}*} First, figure out what this language is.

L={ww : w in {a,b}*} First, figure out what this language is. A string in the language?

L={ww : w in {a,b}*} First, figure out what this language is. A string in the language? aabaab

L={ww : w in {a,b}*} First, figure out what this language is. A string in the language? aabaab Another string in the language?

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

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?

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

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?

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! (ε = εε)

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?

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!

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?

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!

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

L={ww : w in {a,b}*} We prove that L is not regular by using the pumping lemma.

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.

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

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!!!

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

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

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

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

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

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!

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!!!

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

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

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

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!

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!

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

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

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.

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

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

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

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

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

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

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.

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

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

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

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

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

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

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’.

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

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

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

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

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.

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

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