Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
70 views9 pages

Pumping Lemma

Uploaded by

KS Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views9 pages

Pumping Lemma

Uploaded by

KS Reddy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Pumping Lemma

1) What is pumping Lemma?


The pumping lemma is a fundamental concept in the theory of
computation, specifically in the field of formal languages and automata
theory. It is used as a proof for irregularity of language as well as to examine
the structure and limitations of certain type of languages, particularly
context-free language. If a language is regular, it always satisfies pumping
lemma. If there exists at least one string made from pumping which is not
in L, then L is surely not regular.

a) Proof by Contradiction:

The Pumping Lemma is often applied in a proof by contradiction. To show


that a language is not context-free, one assumes, contrary to the claim, that
the language is context-free. Then, by applying the Pumping Lemma, a
contradiction is derived, demonstrating that the assumption of context-
freeness leads to an impossibility. This contradiction implies that the
language cannot be context-free, thus establishing the desired result.

b) Purpose and Significance:

The Pumping Lemma is a crucial tool for understanding the boundaries of


context-free languages. It helps identify languages that cannot be generated
by context-free grammars. While it does not provide a method to prove that
a language is context-free, it is highly effective in proving the non-context-
freeness of certain languages.

2) Versions of pumping lemma


There are several versions of pumping lemma, each tailored with different
classes of language. One of them is Pumping Lemma for Regular Languages
and another is Pumping Lemma for Context-Free Languages.

a) Pumping lemma for Regular Languages:


For any regular language L, there exists a constant p>0(the pumping
length) such that any string s in L with length of at least p can be split into
three parts, s=xyz, satisfying the following conditions:
i) For any i ≥ 0, xyi z in L.
ii) The length of xy is at most p.
iii) The length of y is greater than 0.

Application: This version of Pumping lemma s used for proving non


regularity, identifying non regular languages, understanding non regular
language limitation.

b) Pumping Lemma for Context-Free Languages:


For any regular language L, there exists a constant p>0(the pumping
length) such that any string s in L with length of at least p can be split into
five parts, s=uvwxy, satisfying the following conditions:
i) For any ≥ 0, uvi wxi y in L.
ii) The length of vxw is at most p.
iii) The length of vx is greater than 0.
Application: This version is used for non-context freeness, identifying
non context free languages, understanding context free language
limitations, algorithm design and parsing.

3) Limitations

i) Not All Non-Context-Free Languages Violate the Pumping Lemma:


There exist languages that are not context-free but still satisfy the
conditions of the Pumping Lemma for context-free languages. In other
words, the Pumping Lemma is not a complete characterization of non-
context-free languages. Therefore, a language may be non-context-free
even if it does not exhibit a violation of the Pumping Lemma.

ii) Context-Free Languages That Do Not Satisfy the Pumping Lemma:


There are context-free languages that do not conform to the conditions
of the Pumping Lemma. This means that the Pumping Lemma cannot
be used to prove that every language satisfying its conditions is context-
free.
iii) Sensitivity to the Choice of Decomposition:
The Pumping Lemma relies on decomposing a sufficiently long string
into five parts. The choice of how the string is decomposed can affect
the outcome of the lemma. Different decompositions may lead to
different conclusions about the context-freeness of the language.

iv) Proofs Are Non-Constructive:


The Pumping Lemma is often used in proof by contradiction, assuming
the language is context-free and deriving a contradiction. However, this
method is non-constructive and may not provide insights into how a
non-context-free language functions or how to recognize it.

v) Does Not Prove Context-Freeness:


The Pumping Lemma is a tool for proving that a language is not context-
free, but it does not provide a method for proving that a language is
context-free. There are context-free languages that do not satisfy the
Pumping Lemma, so it's not a complete characterization of context-free
languages.

vi) Limited to Formal Languages:


The Pumping Lemma is specifically designed for formal languages and
does not address more complex aspects of language structure or
semantics. It is a tool within the theoretical framework of formal
languages and automata.
4) Challenges
i) Proof by Contradiction:
The Pumping Lemma relies on a proof by contradiction. This means
assuming the negation of what you want to prove and then deriving a
contradiction. Some critics argue that this form of proof might not
provide as much insight into the structure of context-free languages
compared to constructive proofs.

ii) Complexity of Proofs:


Proving that a language is not context-free using the Pumping Lemma
can be intricate and may require careful analysis. The reasoning
involved in deriving a contradiction may not be straightforward, making
the proofs more challenging and less intuitive.

iii) Not a Complete Characterization:


The Pumping Lemma is a tool for showing that certain languages are
not context-free, but it does not provide a complete characterization
of context-free languages. There are context-free languages that do
not satisfy the conditions of the Pumping Lemma.

iv) Difficulty in Finding the Pumping Length:


Determining the pumping length (p) required by the Pumping Lemma
can be challenging. It often involves careful analysis and may not be
obvious for all languages. Choosing an appropriate pumping length
that works for all strings in a language can be non-trivial.

v) Specific to Context-Free Languages:


The Pumping Lemma is designed for context-free languages and is not
applicable to languages outside this class. It does not provide a direct
method for proving non-membership in other language classes, such as
context-sensitive or recursively enumerable languages.

vi) Not Applicable to All Non-Context-Free Languages:


While the Pumping Lemma is effective in proving the non-context-
freeness of certain languages, it does not work for all non-context-free
languages. There are non-context-free languages that satisfy the
conditions of the Pumping Lemma.

vii) Limited Insight into Context-Free Language Structure:


Critics argue that the Pumping Lemma may not provide deep insights
into the structure of context-free languages. It shows a limitation, but
it may not reveal much about the internal mechanisms or complexities
of context-free languages.

5) Main idea behind the Pumping Lemma

The main idea behind the Pumping Lemma, specifically for context-
free languages, is to establish a set of conditions that any sufficiently
long string in a context-free language must satisfy. The lemma asserts
that if a language is context-free, then for strings of a certain length or
beyond, there exists a pattern that can be "pumped" or repeated in a
way that still results in strings belonging to the language.

(i) Assumption of Context-Freeness: The Pumping Lemma assumes,


for the sake of contradiction, that a given language is context-free.
(ii) Existence of Pumping Length: It posits that for this assumed
context-free language, there exists a pumping length (p). This
means that beyond a certain length (p or more), strings in the
language can be decomposed into five parts (uvwxy) in a specific
way.
(iii) Repeated Pumping Property:The lemma asserts that, for any
string s in the language with a length of at least p, the middle part
(vwx) can be pumped (repeated) any number of times (i≥0),
resulting in strings uviwxiy that still belong to the language.
(iv) Bounded Length and Non-Empty Middle Part: The conditions
further state that the length of the middle part (vwx) is at most p,
and the middle part itself (vx) must have a length greater than 0,
ensuring that pumping can occur.
(v) Contradiction for Non-Context-Freeness: The main goal is to show
a contradiction. By assuming context-freeness and using the
conditions of the Pumping Lemma, a string is constructed or
identified that cannot be pumped in a way consistent with the
lemma. This contradiction implies that the initial assumption of
context-freeness must be false.
Example 1:
Let L={anbncn ∣ n≥0}, the language of strings with an equal number of
'a's, 'b's, and 'c's in the form anbncn
Claim:
The language L is not context-free.

Proof:
Assume, for the sake of contradiction, that L is context-free. According
to the Pumping Lemma for context-free languages, there exists a
pumping length p such that any string s in L with length at least p can be
decomposed into five parts s=uvwxy satisfying the conditions of the
Pumping Lemma.
Now, let's consider the string s=apbpcp. This string is in L because it
follows the pattern of anbncn. The length of s is clearly greater than p.

According to the Pumping Lemma, we can decompose s into five parts


uvwxy such that:
(1)For any ≥ 0, uvi wxi y in L.
(2)The length of vxw is at most p.
(3)The length of vx is greater than 0.

Consider the possible choices for s=apbpcp .Since s has equal numbers of
'a's, 'b's, and 'c's, the v and x parts can only consist of one type of
symbol (either 'a', 'b', or 'c'). Pumping by i>1 will disrupt the balance
between 'a's, 'b's, and 'c's.

Let's analyze the different cases:


If v and x both contain only 'a's, then pumping will introduce more 'a's,
violating the equal number of 'a's, 'b's, and 'c's.
Similarly, if v and x both contain only 'b's or 'c's, the balance will be
disrupted.
This contradicts the condition that uvwxy must remain in L for any i≥0.
Therefore, our assumption that L is context-free must be false.
Hence, we conclude that the language L={anbncn ∣n≥0} is not context-
free.
Example 2: Let L= {0n1n2n ∣n≥0}, the language of strings with an equal
number of '0's, '1's, and '2's in the form 0n1n 2n .

Claim: The language L is not context-free.


Proof: Assume, for the sake of contradiction, that L is context-free.
According to the Pumping Lemma for context-free languages, there
exists a pumping length p such that any string s in L with length at least
p can be decomposed into five parts s=uvwxy satisfying the conditions
of the Pumping Lemma.

Now, let's consider the string s=0p1p2p. This string is in L because it


follows the pattern of 0n1n2n. The length of s is clearly greater than p.

Now apply Pumping Lemma. Consider the possible choices for s=0p1p2p.
Since s has equal numbers of '0's, '1's, and '2's, the v and x parts can
only consist of one type of symbol (either '0', '1', or '2'). Pumping by i>1
will disrupt the balance between '0's, '1's, and '2's.
Let's analyze the different cases: If v and x both contain only '0's, then
pumping will introduce more '0's, violating the equal number of '0's,
'1's, and '2's.
Similarly, if v and x both contain only '1's or '2's, the balance will be
disrupted.
This contradicts the condition that uvwxy must remain in L for any i≥0.
Therefore, our assumption that L is context-free must be false. Hence,
we conclude that the language L= {0n1n2n ∣n≥0}, is not context-free.

You might also like