Pumping Lemma
www.bau.edu.lb 1
Finite Automata
2
How did we prove that a language is Regular?
If we can draw a finite automaton then it will be Regular
Finite means that it contains a finite number of states  every finite automata is Regular
Example of infinite language:
L={w|w contains an even number of symbols}
L={ɛ,00,01,11,10,0000,…}
0,1
0,1 Repeated states
An infinite language has to be accepted by a
machine that is called a finite automata, then
there should be a loop or repeated states and
inside the loop there should be a specific pattern.
Infinite Languages
3
Each state represents a memory, its memorizing a specific property.
All finite languages are Regular but not necessarily all the infinite languages are not Regular
Suppose we have L={ an | n>=1}
L={ɛ, a, aa, aaa, aaaa, …}
a
a
Repeated states
Infinite Languages
4
Let L={anbm | n,m>=1}
The property of this language is that all a’s should come before all b’s
a
a
Repeated states
b
b
Infinite Languages
5
What if we have L={anbn | n>=1}
Here the count factor is important as I can have the number of a’s less than or greater
than the number of b’s
Is it a Regular language?
What if L={anbn | n<=100999}
It becomes a regular language because it is finite and every finite language is Regular.
How to prove that a specific language is Regular/ not Regular.
Pumping Lemma
6
How can we prove that a language L
is not regular?
Prove that there is no DFA or NFA or RE
that accepts L
Difficulty: this is not easy to prove
(since there is an infinite number of them)
Solution: use the Pumping Lemma !!!
Pumping Lemma
7
• In the theory of formal languages, the pumping lemma for regular languages is
a lemma that describes an essential property of all regular languages.
• Informally, it says that all sufficiently long strings in a regular language may
be pumped—that is, have a middle section of the string repeated an arbitrary
number of times—to produce a new string that is also part of the language.
Pumping Lemma
8
• Specifically, the pumping lemma says that for any regular language L
• There exists a constant P such that any string w in L with length at least P
can be split into three substrings x,y and z (w=xyz, with y > 0, such that the
strings xz, xyz, xyyz, xyyyz, … constructed by repeating y zero or more times
are still in L
• This process of repetition is known as "pumping".
• Moreover, the pumping lemma guarantees that the length of xy will be at
most p, imposing a limit on the ways in which w may be split.
Pumping Lemma (For Regular
Languages)
9
• Pumping Lemma is used to prove that a Language is NOT
REGULAR
• It cannot be used to prove that a Language is Regular
• If A is a Regular Language, then A has a Pumping Length 'P' such
that any string 'S' may be divided into 3 parts S = xyz such that
the following conditions must be true:
1. x yi z ∈ A for every i > 0
2. |y| > 0
3. |xy| < P
Pumping Lemma (For non
Regular Languages)
10
To prove that a language is not Regular using PUMPING LEMMA, follow the below
steps: (We prove using Contradiction)
• Assume that A is Regular
• It has to have a Pumping Length (say P)
• All strings longer than P can be pumped |S|>= P
• Now find a string 'S' in A such that ISI>=P
• Divide S into x y z
• Show that xyiz ∉ A for some i
• Then consider all ways that S can be divided into x y z
• Show that none of these can satisfy all the 3 pumping conditions at the same time
• S cannot be Pumped == CONTRADICTION
EXAMPLE 1
11
Pumping Lemma (For Regular Languages)
Using Pumping Lemma prove that the
language A = {an bn | n >= 0} is Not Regular
Proof:
Assume that A is Regular
Pumping length = P
S = ap bp
Assume p = 7
Then,
S = aaaaaaabbbbbbb
X Y Z
EXAMPLE 1
12
Case 1: the Y is in ‘a’ part
Z
Y
X
Case 2: the Y is in ‘b’ part
Z
Y
X
Case 3: the Y is in the ‘a’ and in the ‘b’ part
Z
Y
X
xyiz => xy2z
aa aaaa aaaa abbbbbbb
xyiz => xy2z
aaaaaaabb bbbb bbbb b
xyiz => xy2z
aaaaa aabb aabb bbbbb
#a’s ≠ #b’s
7 11
#a’s ≠ #b’s
11 7
#a’s ≠ #b’s
11 11
Still doesn’t satisfy anbn
√
√
√
√
X
X
X
X
X
EXAMPLE 2
13
Pumping Lemma (For Regular Languages) -
Using pumping lemma prove that the language A= {yy|y ∈ {0,1}*} is Not Regular
X Y Z
X Y Z
xyiz = xy2z
00 0000 0000 0100000001
 A is not Regular
X
√
X
Proof:
Assume that A is Regular
Then it must have a
pumping length = P
S = 0p 1 0p 1
Closure Property
14
101010 is an accepted string in this
language
000111 is also accepted string
0*1*
L1 = { w ∈ ∑* | w contains zero
or more 0’s followed by zero or
more 1’s}
This language is Regular
L2 = {0n 1n | n >= 0}
This language is not Regular
L3 = { w ∈ ∑* | w has an equal number of 0’s
and 1’s}
all strings in L2
are contained in L3
all strings in L2
are contained in this language
L1 ∩ L3 = L2
L1 is Regular
L2 is not Regular (proved)
Based on Closure property
the intersection of 2 Regular
languages is regular
 L3 is not Regular

More Related Content

PDF
Pumping lema topic of theory of automata
PPT
non regular language updated theory of automata.ppt
PPT
hop-chap4.ppt
PPTX
RegularLanguageProperties.pptx
PPTX
pumping lemma Subject Theory of Automata.pptx
PPTX
Pumping lemma for regular set h1
PPTX
AUTOMATA AUTOMATA Automata5Chapter4.pptx
PDF
Mba ebooks ! Edhole
Pumping lema topic of theory of automata
non regular language updated theory of automata.ppt
hop-chap4.ppt
RegularLanguageProperties.pptx
pumping lemma Subject Theory of Automata.pptx
Pumping lemma for regular set h1
AUTOMATA AUTOMATA Automata5Chapter4.pptx
Mba ebooks ! Edhole

Similar to Lecture-8-Pumpdndndndndnddndning Lemma.pdf (20)

PDF
Free Ebooks Download ! Edhole
PDF
Regular pumping examples
PDF
09.LearningMaterial_Sample.pdf
PPT
Theory of computing pdf
PPT
non regular language and pumping lemma toc
PPTX
Pumping Lemma________________________________________________________________...
PDF
Pumping lemma
PPTX
pumpexamples.pptx
PDF
PRESENTATION ON NON REGULAR LANGUAGE.pdf
PPT
Mba admission in india
PPT
Class6
PPT
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
PPT
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
PPT
Theory of Computation - Lectures 6 & 7
PPT
06_PumpingLemma compiler design of chapter 4.ppt
PPTX
Pumping lemma Theory Of Automata
PPTX
toc Properties of Regular Languages .pptx
PPTX
10 Regular VS Non Regular Language.pptx
PPTX
Pumming Lemma
PDF
Regular pumping
Free Ebooks Download ! Edhole
Regular pumping examples
09.LearningMaterial_Sample.pdf
Theory of computing pdf
non regular language and pumping lemma toc
Pumping Lemma________________________________________________________________...
Pumping lemma
pumpexamples.pptx
PRESENTATION ON NON REGULAR LANGUAGE.pdf
Mba admission in india
Class6
xcjkfvhdfjlkghfkjbnfkbnfgbnklnbknbmcvbnlkcnb
PPT 2.1.1(The Pumping Lemma for Regular sets, Application of the Pumping Lemm...
Theory of Computation - Lectures 6 & 7
06_PumpingLemma compiler design of chapter 4.ppt
Pumping lemma Theory Of Automata
toc Properties of Regular Languages .pptx
10 Regular VS Non Regular Language.pptx
Pumming Lemma
Regular pumping
Ad

Recently uploaded (20)

PPTX
Capital Investment in IS Infrastracture and Innovation (SDG9)
PDF
The Influence of Historical Figures on Legal Communication (www.kiu.ac.ug)
PDF
HQ #118 / 'Building Resilience While Climbing the Event Mountain
PDF
The Impact of Policy Changes on Legal Communication Strategies (www.kiu.ac.ug)
PPTX
Supply Chain under WAR (Managing Supply Chain Amid Political Conflict).pptx
PDF
The Impact of Immigration on National Identity (www.kiu.ac.ug)
PDF
The Evolution of Legal Communication through History (www.kiu.ac.ug)
DOCX
“Strategic management process of a selected organization”.Nestle-docx.docx
PPTX
Oracle Cloud Infrastructure Overview July 2020 v2_EN20200717.pptx
PPTX
IndustrialAIGuerillaInnovatorsARCPodcastEp3.pptx
PDF
Handouts for Housekeeping.pdfhsjsnvvbdjsnwb
PDF
El futuro empresarial 2024 una vista gen
PPTX
UNIT 3 INTERNATIONAL BUSINESS [Autosaved].pptx
PDF
The Role of School Boards in Educational Management (www.kiu.ac.ug)
PDF
The Impact of Historical Events on Legal Communication Styles (www.kiu.ac.ug)
PPTX
PwC consulting Powerpoint Graphics 2014 templates
PPTX
003 seven PARTS OF SPEECH english subject.pptx
PDF
The Future of Marketing: AI, Funnels & MBA Careers | My Annual IIM Lucknow Talk
PDF
109422672-Doc-8973-05-Security-Manual-Seventh-Edition.pdf
PDF
France's Top 5 Promising EdTech Companies to Watch in 2025.pdf
Capital Investment in IS Infrastracture and Innovation (SDG9)
The Influence of Historical Figures on Legal Communication (www.kiu.ac.ug)
HQ #118 / 'Building Resilience While Climbing the Event Mountain
The Impact of Policy Changes on Legal Communication Strategies (www.kiu.ac.ug)
Supply Chain under WAR (Managing Supply Chain Amid Political Conflict).pptx
The Impact of Immigration on National Identity (www.kiu.ac.ug)
The Evolution of Legal Communication through History (www.kiu.ac.ug)
“Strategic management process of a selected organization”.Nestle-docx.docx
Oracle Cloud Infrastructure Overview July 2020 v2_EN20200717.pptx
IndustrialAIGuerillaInnovatorsARCPodcastEp3.pptx
Handouts for Housekeeping.pdfhsjsnvvbdjsnwb
El futuro empresarial 2024 una vista gen
UNIT 3 INTERNATIONAL BUSINESS [Autosaved].pptx
The Role of School Boards in Educational Management (www.kiu.ac.ug)
The Impact of Historical Events on Legal Communication Styles (www.kiu.ac.ug)
PwC consulting Powerpoint Graphics 2014 templates
003 seven PARTS OF SPEECH english subject.pptx
The Future of Marketing: AI, Funnels & MBA Careers | My Annual IIM Lucknow Talk
109422672-Doc-8973-05-Security-Manual-Seventh-Edition.pdf
France's Top 5 Promising EdTech Companies to Watch in 2025.pdf
Ad

Lecture-8-Pumpdndndndndnddndning Lemma.pdf

  • 2. Finite Automata 2 How did we prove that a language is Regular? If we can draw a finite automaton then it will be Regular Finite means that it contains a finite number of states  every finite automata is Regular Example of infinite language: L={w|w contains an even number of symbols} L={ɛ,00,01,11,10,0000,…} 0,1 0,1 Repeated states An infinite language has to be accepted by a machine that is called a finite automata, then there should be a loop or repeated states and inside the loop there should be a specific pattern.
  • 3. Infinite Languages 3 Each state represents a memory, its memorizing a specific property. All finite languages are Regular but not necessarily all the infinite languages are not Regular Suppose we have L={ an | n>=1} L={ɛ, a, aa, aaa, aaaa, …} a a Repeated states
  • 4. Infinite Languages 4 Let L={anbm | n,m>=1} The property of this language is that all a’s should come before all b’s a a Repeated states b b
  • 5. Infinite Languages 5 What if we have L={anbn | n>=1} Here the count factor is important as I can have the number of a’s less than or greater than the number of b’s Is it a Regular language? What if L={anbn | n<=100999} It becomes a regular language because it is finite and every finite language is Regular. How to prove that a specific language is Regular/ not Regular.
  • 6. Pumping Lemma 6 How can we prove that a language L is not regular? Prove that there is no DFA or NFA or RE that accepts L Difficulty: this is not easy to prove (since there is an infinite number of them) Solution: use the Pumping Lemma !!!
  • 7. Pumping Lemma 7 • In the theory of formal languages, the pumping lemma for regular languages is a lemma that describes an essential property of all regular languages. • Informally, it says that all sufficiently long strings in a regular language may be pumped—that is, have a middle section of the string repeated an arbitrary number of times—to produce a new string that is also part of the language.
  • 8. Pumping Lemma 8 • Specifically, the pumping lemma says that for any regular language L • There exists a constant P such that any string w in L with length at least P can be split into three substrings x,y and z (w=xyz, with y > 0, such that the strings xz, xyz, xyyz, xyyyz, … constructed by repeating y zero or more times are still in L • This process of repetition is known as "pumping". • Moreover, the pumping lemma guarantees that the length of xy will be at most p, imposing a limit on the ways in which w may be split.
  • 9. Pumping Lemma (For Regular Languages) 9 • Pumping Lemma is used to prove that a Language is NOT REGULAR • It cannot be used to prove that a Language is Regular • If A is a Regular Language, then A has a Pumping Length 'P' such that any string 'S' may be divided into 3 parts S = xyz such that the following conditions must be true: 1. x yi z ∈ A for every i > 0 2. |y| > 0 3. |xy| < P
  • 10. Pumping Lemma (For non Regular Languages) 10 To prove that a language is not Regular using PUMPING LEMMA, follow the below steps: (We prove using Contradiction) • Assume that A is Regular • It has to have a Pumping Length (say P) • All strings longer than P can be pumped |S|>= P • Now find a string 'S' in A such that ISI>=P • Divide S into x y z • Show that xyiz ∉ A for some i • Then consider all ways that S can be divided into x y z • Show that none of these can satisfy all the 3 pumping conditions at the same time • S cannot be Pumped == CONTRADICTION
  • 11. EXAMPLE 1 11 Pumping Lemma (For Regular Languages) Using Pumping Lemma prove that the language A = {an bn | n >= 0} is Not Regular Proof: Assume that A is Regular Pumping length = P S = ap bp Assume p = 7 Then, S = aaaaaaabbbbbbb X Y Z
  • 12. EXAMPLE 1 12 Case 1: the Y is in ‘a’ part Z Y X Case 2: the Y is in ‘b’ part Z Y X Case 3: the Y is in the ‘a’ and in the ‘b’ part Z Y X xyiz => xy2z aa aaaa aaaa abbbbbbb xyiz => xy2z aaaaaaabb bbbb bbbb b xyiz => xy2z aaaaa aabb aabb bbbbb #a’s ≠ #b’s 7 11 #a’s ≠ #b’s 11 7 #a’s ≠ #b’s 11 11 Still doesn’t satisfy anbn √ √ √ √ X X X X X
  • 13. EXAMPLE 2 13 Pumping Lemma (For Regular Languages) - Using pumping lemma prove that the language A= {yy|y ∈ {0,1}*} is Not Regular X Y Z X Y Z xyiz = xy2z 00 0000 0000 0100000001  A is not Regular X √ X Proof: Assume that A is Regular Then it must have a pumping length = P S = 0p 1 0p 1
  • 14. Closure Property 14 101010 is an accepted string in this language 000111 is also accepted string 0*1* L1 = { w ∈ ∑* | w contains zero or more 0’s followed by zero or more 1’s} This language is Regular L2 = {0n 1n | n >= 0} This language is not Regular L3 = { w ∈ ∑* | w has an equal number of 0’s and 1’s} all strings in L2 are contained in L3 all strings in L2 are contained in this language L1 ∩ L3 = L2 L1 is Regular L2 is not Regular (proved) Based on Closure property the intersection of 2 Regular languages is regular  L3 is not Regular