PlanetMath (more info)
 Math for the people, by the people. Sponsor PlanetMath
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: Very high Entry average rating: No information on entry rating
pumping lemma (context-free languages) (Theorem)

Let $L$ be a context-free language (a.k.a. type 2 language). Then there exist two integers $m$ and $n$ such that, if the length of a word $W$ is greater than $m$ , then $W = ABCDE$ where $A,B,C,D,E$ are subwords such that

  1. The length of the subword $BCD$ is less than $n$ .
  2. $BD$ is not be empty.
  3. For all integers $k > 0$ , it is the case that $AB^kCD^kE$ belongs to $L$ , where exponentiation denotes repetition of a subword $k$ times.

An important use of this lemma is that it allows one to show that a language is not context-free. (Remember, just because a language happens to be described in terms of a context-sensitive grammar does not automatically preclude the possibility of describing the same language also by a context-free language.) The idea is to assume that the language is context-free, then arrive at a contradiction via this lemma.

As an illustrative example, consider the following language, which consists of but one terminal symbol, `x' and which consists of all strings of `x' 's whose length is a perfect square. Were this a context-free language, there would exist integers $m$ and $n$ as above. Choose an integer $h$ such that $h^2 > m$ . Then the word $x^{h^2}$ belongs to our language and the lemma tells us that it can be written as $ABCDE$ so as to satisfy the conditions enumerated above. Write $A = x^a$ , $B = x^b$ , $C = x^c$ , $D = x^d$ , $E = x^e$ for suitable nonnegative integers $a,b,c,d,e$ . Then we have $a + b + c + d + e = k^2$ ; by condition , $b + d > 0$ and, by condition , $a + kb + c + kd + e$ would have to be a perfect square because $AB^kCD^kE$ would be a word of the language. This, however, leads to a contradiction: $h^2 + k (b + d)$ could not possibly be a perfect square for all $k$ unless $b + d = 0$ .

As an exercise, the reader may consider constructing a context-sensitive grammar for this language and posting it as an attachment to this entry (at which time this sentence will come down).




"pumping lemma (context-free languages)" is owned by rspuzio. [ full author list (3) ]
(view preamble | get metadata)

View style:

See Also: pumping lemma (regular languages)

Other names:  pumping lemma
Log in to rate this entry.
(view current ratings)

Cross-references: sentence, perfect square, strings, terminal symbol, contradiction, context-sensitive grammar, terms, context-free, belongs, length, subwords, length of a word, integers, language, type, context-free language
There are 2 references to this entry.

This is version 5 of pumping lemma (context-free languages), born on 2006-10-28, modified 2009-05-15.
Object id is 8487, canonical name is PumpingLemma.
Accessed 3193 times total.

Classification:
AMS MSC68Q42 (Computer science :: Theory of computing :: Grammars and rewriting systems)

Pending Errata and Addenda
None.
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | prove | add result | add corollary | add example | add (any)