Title: More Applications of
1More Applications of The Pumping Lemma Slides
based on RPI CSCI 2400 Thanks to Petros Drineas
2The Pumping Lemma
For infinite context-free language
there exists an integer such that
for any string
we can write
with lengths
and it must be
3Non-context free languages
Context-free languages
4Theorem
The language
is not context free
Proof
Use the Pumping Lemma for context-free languages
5Assume for contradiction that
is context-free
Since is context-free and infinite we can
apply the pumping lemma
6Pumping Lemma gives a magic number such that
Pick any string of with length at least
we pick
7We can write
with lengths and
Pumping Lemma says
for all
8We examine all the possible locations of string
in
9Case 1
is within the first
10Case 1
is within the first
11Case 1
is within the first
12Case 1
is within the first
However, from Pumping Lemma
Contradiction!!!
13Case 2
is in the first
is in the first
14Case 2
is in the first
is in the first
15Case 2
is in the first
is in the first
16Case 2
is in the first
is in the first
However, from Pumping Lemma
Contradiction!!!
17Case 3
overlaps the first
is in the first
18Case 3
overlaps the first
is in the first
19Case 3
overlaps the first
is in the first
20Case 3
overlaps the first
is in the first
However, from Pumping Lemma
Contradiction!!!
21Case 4
in the first
Overlaps the first
Analysis is similar to case 3
22Other cases
is within
or
or
Analysis is similar to case 1
23More cases
overlaps
or
Analysis is similar to cases 2,3,4
24There are no other cases to consider
Since , it is impossible for
to overlap
or
or
25Example of a substring vxy gt m that allows
pumping within L?
26In all cases we obtained a contradiction
Therefore
The original assumption that
is context-free must be wrong
Conclusion
is not context-free
27Non-context free languages
Context-free languages
28Theorem
The language
is not context free
Proof
Use the Pumping Lemma for context-free languages
29Assume for contradiction that
is context-free
Since is context-free and infinite we can
apply the pumping lemma
30Pumping Lemma gives a magic number such that
Pick any string of with length at least
we pick
31We can write
with lengths and
Pumping Lemma says
for all
32We examine all the possible locations of string
in
There is only one case to consider
33(No Transcript)
34(No Transcript)
35(No Transcript)
36(No Transcript)
37Since , for we have
38(No Transcript)
39However, from Pumping Lemma
Contradiction!!!
40We obtained a contradiction
Therefore
The original assumption that
is context-free must be wrong
Conclusion
is not context-free
41Non-context free languages
Context-free languages
42Theorem
The language
is not context free
Proof
Use the Pumping Lemma for context-free languages
43Assume for contradiction that
is context-free
Since is context-free and infinite we can
apply the pumping lemma
44Pumping Lemma gives a magic number such that
Pick any string of with length at least
we pick
45We can write
with lengths and
Pumping Lemma says
for all
46We examine all the possible locations of string
in
47Most complicated case
is in
is in
48(No Transcript)
49Most complicated sub-case
and
50Most complicated sub-case
and
51Most complicated sub-case
and
52and
53(No Transcript)
54However, from Pumping Lemma
Contradiction!!!
55When we examine the rest of the cases we also
obtain a contradiction
56In all cases we obtained a contradiction
Therefore
The original assumption that
is context-free must be wrong
Conclusion
is not context-free