尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
PUMPING LEMMA
There are two Pumping Lemmas, which are defined for
1. Regular Languages, and
2. Context – Free Languages
APPLICATIONS OF PUMPING LEMMA
Pumping Lemma is to be applied to show that certain
languages are not regular.
It should never be used to show a language is regular.
 If L is regular, it satisfies Pumping Lemma.
 If L does not satisfy Pumping Lemma, it is non-
regular.
FORMAL STATEMENT
Pumping Lemma for Regular Languages
For any regular language L, there exists an integer n, such that for all w ∈
L with
|w| ≥ n, there exists (x, y, z ∈ Σ∗), such that w = xyz, and
(1) |xy| ≤ n
(2) |y| ≥ 1
(3) for all i ≥ 0: xyiz ∈ L
In simple terms, this means that if a string y is ‘pumped’, i.e., if y is
inserted any number of times, the resultant string still remains in L.
FORMAL STATEMENT
Pumping Lemma for Context-free Languages (CFL)
Pumping Lemma for CFL states that for any Context Free Language L, it is
possible to find two substrings that can be ‘pumped’ any number of times
and still be in the same language. For any language L, we break its strings
into five parts and pump second and fourth substring.
Pumping Lemma, here also, is used as a tool to prove that a language is not
CFL. Because, if any one string does not satisfy its conditions, then the
language is not CFL.
| w| n
The Pumping Lemma:
For infinite context-free language L
there exists an integer n such that
for any string
we can write
with lengths and |vy |1
w L,
w =uvxyz
| vxy | n
for all i  0
and it must be:
uvi xyiz  L,
TAKE AN INFINITE CONTEXT-FREE
LANGUAGE
Example: S → AB
A →aBb
B → Sb
B → b
Generates an infinite number
of different strings
S → AB
A →
ABB B
→ SB B
→B
A derivation:
S  AB  aBbB abbB
 abbSb  abbABb  abbaBbBb 
 abbabbBb  abbabbbb
In a derivation of a long string,
variables are repeated
S
A B
bBa
b
bS
A B
bBa
b
b
Derivation tree string abbabbbb
S
A B
bBa
b
bS
A B
bBa
b
b
repeated
Derivation tree string abbabbbb
B
bS
A B
bBa b
B  Sb  ABb 
 aBbBb  aBbbb
B b
b
*
BaBbbb
B
bS
A B
bBa b
Repeated Part
*
BaBbbb
B
bS
A B
ba bB
bS
A B
bBa b
* *
BaBbbbaaBbbbbbb
Another possible
*
BaBbbb
derivation from B
B
bS
A B
ba bB
bS
A B
bBa b
22
* *
B (a)B(bbb)(a) B(bbb)
*
BaBbbb
22
*
S  abb(a) b(bbb)
abb(a)2b(bbb)2 L(G)
*
B aBbbb B b
*
SabbBb
S
A B
bBa
b
*
BaBbbb
B  b
*
SabbBb
S abbBb  abbbb
*
b
= abb(a)0b(bbb)0
00
*
S  abb(a) b(bbb)
abb(a)0b(bbb)0 L(G)
*
B aBbbb B b
*
SabbBb
33 3 3
*
S  abb(a) B(bbb)  abb(a) b(bbb)
S
A B
B ba
b
bS
A B
ba bB
bS
A B
B ba b
bS
A B
bBa b
b
*
BaBbbb
B  b
*
S  abbBb
33
*
S  abb(a) b(bbb)
abb(a)3b(bbb)3 L(G)
*
B aBbbb B b
*
SabbBb
ii
*
S abb(a) b(bbb)
abb(a)ib(bbb)i L(G)
*
B aBbbb B b
*
SabbBb
In General:
i 0
S
A
x
u
Last repeated variable
z
v y
w =uvxyz
u,v, x, y, z :
repeated A
Strings of terminals
DERIVATION TREE OF
STRING W
S
A
A
x
u z
v y

SuAz

AvAy

Ax
Possible
derivations:
 
S uAz AvAy

Ax
We know:
This string is also generated:
 *
S uAzuxz
uv0xy0z
This string is also generated:
 * *
S uAzuvAyzuvxyz
The original w =uv1xy1z
 
S uAz AvAy

Ax
We know:
This string is also generated:
 * * *
S uAzuvAyzuvvAyyzuvvxyyz
uv2xy2z
 
S uAz AvAy

Ax
We know:
This string is also generated:
 * *
S uAz  uvAyzuvvAyyz
* *
uvvvAyyyzuvvvxyyyz
uv3xy3z
 
S uAz AvAy

Ax
We know:
We know:
  
S uAz AvAy A x
This string is also generated:
S  uAz  uvAyz  uvvAyyz 
 uvvvAyyyz …
 u v v v v A y yyyz 
 u v v v v x y yyyz
uvi xyiz
Therefore, any string of the form
uvixyiz
is generated by the grammar G
i 0
knowing that uvxyz  L(G)
we also know that uvixyiz L(G)
Therefore,
L(G) = L−{}
uvi xyiz L
S
A
A
u z
v y
x
| vxy |  mObservation:
Since A is the last repeated variable
S
A
u z
v y
A
x
Observation: | vy |  1
Since there are no unit or -productions
| w| n
The Pumping Lemma:
For infinite context-free language L
there exists an integer n such that
for any string
we can write
with lengths and |vy |1
w L,
w =uvxyz
| vxy | n
for all i  0
and it must be:
uvi xyiz  L,

More Related Content

What's hot

Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
arunsingh660
 
Chomsky Hierarchy.ppt
Chomsky Hierarchy.pptChomsky Hierarchy.ppt
Chomsky Hierarchy.ppt
AayushSingh233965
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
Mohammad Ilyas Malik
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
ASHOK KUMAR REDDY
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
shah zeb
 
Parse Tree
Parse TreeParse Tree
Parse Tree
A. S. M. Shafi
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
Animesh Chaturvedi
 
Types of grammer - TOC
Types of grammer - TOCTypes of grammer - TOC
Types of grammer - TOC
AbhayDhupar
 
1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa
Sampath Kumar S
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
SOMNATHMORE2
 
Turing machine
Turing machineTuring machine
Turing machine
HimanshuSirohi6
 
recursive transition_networks
recursive transition_networksrecursive transition_networks
recursive transition_networks
Rajendran
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
Mukesh Tekwani
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
Akila Krishnamoorthy
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
shah zeb
 
4.6 halting problem
4.6 halting problem4.6 halting problem
4.6 halting problem
Sampath Kumar S
 
3.4 deterministic pda
3.4 deterministic pda3.4 deterministic pda
3.4 deterministic pda
Sampath Kumar S
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
Shiraz316
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
MAHASREEM
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
shah zeb
 

What's hot (20)

Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
 
Chomsky Hierarchy.ppt
Chomsky Hierarchy.pptChomsky Hierarchy.ppt
Chomsky Hierarchy.ppt
 
Context free grammar
Context free grammar Context free grammar
Context free grammar
 
Top down parsing
Top down parsingTop down parsing
Top down parsing
 
Lecture 3,4
Lecture 3,4Lecture 3,4
Lecture 3,4
 
Parse Tree
Parse TreeParse Tree
Parse Tree
 
Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)Deterministic Finite Automata (DFA)
Deterministic Finite Automata (DFA)
 
Types of grammer - TOC
Types of grammer - TOCTypes of grammer - TOC
Types of grammer - TOC
 
1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa1.7. eqivalence of nfa and dfa
1.7. eqivalence of nfa and dfa
 
Decision properties of reular languages
Decision properties of reular languagesDecision properties of reular languages
Decision properties of reular languages
 
Turing machine
Turing machineTuring machine
Turing machine
 
recursive transition_networks
recursive transition_networksrecursive transition_networks
recursive transition_networks
 
Finite Automata
Finite AutomataFinite Automata
Finite Automata
 
Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)Automata theory - Push Down Automata (PDA)
Automata theory - Push Down Automata (PDA)
 
Lecture 6
Lecture 6Lecture 6
Lecture 6
 
4.6 halting problem
4.6 halting problem4.6 halting problem
4.6 halting problem
 
3.4 deterministic pda
3.4 deterministic pda3.4 deterministic pda
3.4 deterministic pda
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design Syntax Analysis in Compiler Design
Syntax Analysis in Compiler Design
 
Lecture 1,2
Lecture 1,2Lecture 1,2
Lecture 1,2
 

Similar to Pumping lemma for cfl

Pumping lemma
Pumping lemmaPumping lemma
Pumping lemma
sanjeevtmk
 
pumpexamples.pptx
pumpexamples.pptxpumpexamples.pptx
pumpexamples.pptx
UniversityHacks
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
RaviAr5
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
dawod yimer
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! Edhole
Edhole.com
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
Edhole.com
 
Hw2 2017-spring
Hw2 2017-springHw2 2017-spring
Hw2 2017-spring
奕安 陳
 
RegularLanguageProperties [Autosaved].pptx
RegularLanguageProperties [Autosaved].pptxRegularLanguageProperties [Autosaved].pptx
RegularLanguageProperties [Autosaved].pptx
RaviAr5
 
Normal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.pptNormal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.ppt
Karthik Rohan
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
VenkataRaoS1
 
Conteext-free Grammer
Conteext-free GrammerConteext-free Grammer
Conteext-free Grammer
HASHIR RAZA
 
Top school in ghaziabad
Top school in ghaziabadTop school in ghaziabad
Top school in ghaziabad
Edhole.com
 
Context free grammar
Context free grammarContext free grammar
Context free grammar
Radhakrishnan Chinnusamy
 
Module 1 TOC.pptx
Module 1 TOC.pptxModule 1 TOC.pptx
Module 1 TOC.pptx
MohitJain21BCE1523
 
Context free langauges
Context free langaugesContext free langauges
Context free langauges
sudhir sharma
 
hop-chap4.ppt
hop-chap4.ppthop-chap4.ppt
hop-chap4.ppt
UniversityHacks
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
ReehaamMalikArain
 
Class7
 Class7 Class7
Class7
issbp
 
Introduction to Theory of computations:-
Introduction to Theory of computations:-Introduction to Theory of computations:-
Introduction to Theory of computations:-
sivamathi12
 
9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx
mainakmail2585
 

Similar to Pumping lemma for cfl (20)

Pumping lemma
Pumping lemmaPumping lemma
Pumping lemma
 
pumpexamples.pptx
pumpexamples.pptxpumpexamples.pptx
pumpexamples.pptx
 
Mod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptxMod 2_RegularExpressions.pptx
Mod 2_RegularExpressions.pptx
 
Chapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdfChapter 3 REGULAR EXPRESSION.pdf
Chapter 3 REGULAR EXPRESSION.pdf
 
Free Ebooks Download ! Edhole
Free Ebooks Download ! EdholeFree Ebooks Download ! Edhole
Free Ebooks Download ! Edhole
 
Mba ebooks ! Edhole
Mba ebooks ! EdholeMba ebooks ! Edhole
Mba ebooks ! Edhole
 
Hw2 2017-spring
Hw2 2017-springHw2 2017-spring
Hw2 2017-spring
 
RegularLanguageProperties [Autosaved].pptx
RegularLanguageProperties [Autosaved].pptxRegularLanguageProperties [Autosaved].pptx
RegularLanguageProperties [Autosaved].pptx
 
Normal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.pptNormal-forms-for-Context-Free-Grammars.ppt
Normal-forms-for-Context-Free-Grammars.ppt
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
Conteext-free Grammer
Conteext-free GrammerConteext-free Grammer
Conteext-free Grammer
 
Top school in ghaziabad
Top school in ghaziabadTop school in ghaziabad
Top school in ghaziabad
 
Context free grammar
Context free grammarContext free grammar
Context free grammar
 
Module 1 TOC.pptx
Module 1 TOC.pptxModule 1 TOC.pptx
Module 1 TOC.pptx
 
Context free langauges
Context free langaugesContext free langauges
Context free langauges
 
hop-chap4.ppt
hop-chap4.ppthop-chap4.ppt
hop-chap4.ppt
 
L_2_apl.pptx
L_2_apl.pptxL_2_apl.pptx
L_2_apl.pptx
 
Class7
 Class7 Class7
Class7
 
Introduction to Theory of computations:-
Introduction to Theory of computations:-Introduction to Theory of computations:-
Introduction to Theory of computations:-
 
9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx9781284077247_PPTx_CH01.pptx
9781284077247_PPTx_CH01.pptx
 

Recently uploaded

Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
EducationNC
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
Kalna College
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
Celine George
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
Nguyen Thanh Tu Collection
 
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
biruktesfaye27
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
Celine George
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
Infosec
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
Kalna College
 
(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"
MJDuyan
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
PJ Caposey
 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
MattVassar1
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
sanamushtaq922
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
Celine George
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
MattVassar1
 
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
yarusun
 
The basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptxThe basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Opportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive themOpportunity scholarships and the schools that receive them
Opportunity scholarships and the schools that receive them
 
220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology220711130097 Tulip Samanta Concept of Information and Communication Technology
220711130097 Tulip Samanta Concept of Information and Communication Technology
 
Post init hook in the odoo 17 ERP Module
Post init hook in the  odoo 17 ERP ModulePost init hook in the  odoo 17 ERP Module
Post init hook in the odoo 17 ERP Module
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
 
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
 
What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17What are the new features in the Fleet Odoo 17
What are the new features in the Fleet Odoo 17
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...How to stay relevant as a cyber professional: Skills, trends and career paths...
How to stay relevant as a cyber professional: Skills, trends and career paths...
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
 
(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"(T.L.E.) Agriculture: "Ornamental Plants"
(T.L.E.) Agriculture: "Ornamental Plants"
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
 
Creativity for Innovation and Speechmaking
Creativity for Innovation and SpeechmakingCreativity for Innovation and Speechmaking
Creativity for Innovation and Speechmaking
 
Observational Learning
Observational Learning Observational Learning
Observational Learning
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
 
Talking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual AidsTalking Tech through Compelling Visual Aids
Talking Tech through Compelling Visual Aids
 
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
Get Success with the Latest UiPath UIPATH-ADPV1 Exam Dumps (V11.02) 2024
 
The basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptxThe basics of sentences session 8pptx.pptx
The basics of sentences session 8pptx.pptx
 

Pumping lemma for cfl

  • 1.
  • 2. PUMPING LEMMA There are two Pumping Lemmas, which are defined for 1. Regular Languages, and 2. Context – Free Languages
  • 3. APPLICATIONS OF PUMPING LEMMA Pumping Lemma is to be applied to show that certain languages are not regular. It should never be used to show a language is regular.  If L is regular, it satisfies Pumping Lemma.  If L does not satisfy Pumping Lemma, it is non- regular.
  • 4. FORMAL STATEMENT Pumping Lemma for Regular Languages For any regular language L, there exists an integer n, such that for all w ∈ L with |w| ≥ n, there exists (x, y, z ∈ Σ∗), such that w = xyz, and (1) |xy| ≤ n (2) |y| ≥ 1 (3) for all i ≥ 0: xyiz ∈ L In simple terms, this means that if a string y is ‘pumped’, i.e., if y is inserted any number of times, the resultant string still remains in L.
  • 5. FORMAL STATEMENT Pumping Lemma for Context-free Languages (CFL) Pumping Lemma for CFL states that for any Context Free Language L, it is possible to find two substrings that can be ‘pumped’ any number of times and still be in the same language. For any language L, we break its strings into five parts and pump second and fourth substring. Pumping Lemma, here also, is used as a tool to prove that a language is not CFL. Because, if any one string does not satisfy its conditions, then the language is not CFL.
  • 6. | w| n The Pumping Lemma: For infinite context-free language L there exists an integer n such that for any string we can write with lengths and |vy |1 w L, w =uvxyz | vxy | n for all i  0 and it must be: uvi xyiz  L,
  • 7. TAKE AN INFINITE CONTEXT-FREE LANGUAGE Example: S → AB A →aBb B → Sb B → b Generates an infinite number of different strings
  • 8. S → AB A → ABB B → SB B →B A derivation: S  AB  aBbB abbB  abbSb  abbABb  abbaBbBb   abbabbBb  abbabbbb In a derivation of a long string, variables are repeated
  • 11. B bS A B bBa b B  Sb  ABb   aBbBb  aBbbb B b b * BaBbbb
  • 12. B bS A B bBa b Repeated Part * BaBbbb
  • 13. B bS A B ba bB bS A B bBa b * * BaBbbbaaBbbbbbb Another possible * BaBbbb derivation from B
  • 14. B bS A B ba bB bS A B bBa b 22 * * B (a)B(bbb)(a) B(bbb) * BaBbbb
  • 15. 22 * S  abb(a) b(bbb) abb(a)2b(bbb)2 L(G) * B aBbbb B b * SabbBb
  • 16. S A B bBa b * BaBbbb B  b * SabbBb S abbBb  abbbb * b = abb(a)0b(bbb)0
  • 17. 00 * S  abb(a) b(bbb) abb(a)0b(bbb)0 L(G) * B aBbbb B b * SabbBb
  • 18. 33 3 3 * S  abb(a) B(bbb)  abb(a) b(bbb) S A B B ba b bS A B ba bB bS A B B ba b bS A B bBa b b * BaBbbb B  b * S  abbBb
  • 19. 33 * S  abb(a) b(bbb) abb(a)3b(bbb)3 L(G) * B aBbbb B b * SabbBb
  • 20. ii * S abb(a) b(bbb) abb(a)ib(bbb)i L(G) * B aBbbb B b * SabbBb In General: i 0
  • 21. S A x u Last repeated variable z v y w =uvxyz u,v, x, y, z : repeated A Strings of terminals DERIVATION TREE OF STRING W
  • 23.   S uAz AvAy  Ax We know: This string is also generated:  * S uAzuxz uv0xy0z
  • 24. This string is also generated:  * * S uAzuvAyzuvxyz The original w =uv1xy1z   S uAz AvAy  Ax We know:
  • 25. This string is also generated:  * * * S uAzuvAyzuvvAyyzuvvxyyz uv2xy2z   S uAz AvAy  Ax We know:
  • 26. This string is also generated:  * * S uAz  uvAyzuvvAyyz * * uvvvAyyyzuvvvxyyyz uv3xy3z   S uAz AvAy  Ax We know:
  • 27. We know:    S uAz AvAy A x This string is also generated: S  uAz  uvAyz  uvvAyyz   uvvvAyyyz …  u v v v v A y yyyz   u v v v v x y yyyz uvi xyiz
  • 28. Therefore, any string of the form uvixyiz is generated by the grammar G i 0
  • 29. knowing that uvxyz  L(G) we also know that uvixyiz L(G) Therefore, L(G) = L−{} uvi xyiz L
  • 30. S A A u z v y x | vxy |  mObservation: Since A is the last repeated variable
  • 31. S A u z v y A x Observation: | vy |  1 Since there are no unit or -productions
  • 32. | w| n The Pumping Lemma: For infinite context-free language L there exists an integer n such that for any string we can write with lengths and |vy |1 w L, w =uvxyz | vxy | n for all i  0 and it must be: uvi xyiz  L,
  翻译: