Pumping lemma | Theory of Computation - Computer Science Engineering (CSE) PDF Download

Pumping Lemma

There are two Pumping Lemmas, which are defined for
1. Regular Languages, and
2. Context – Free Languages
 
Pumping Lemma for Regular Languages

For any regular language L, there exists an integer n, such that for all x ∈ L with |x| ≥ n, there exists u, v, w ∈ Σ∗, such that x = uvw, and
(1) |uv| ≤ n
(2) |v| ≥ 1
(3) for all i ≥ 0: uviw ∈ L

In simple terms, this means that if a string v is ‘pumped’, i.e., if v is inserted any number of times, the resultant string still remains in L.

Pumping Lemma is used as a proof for irregularity of a language. Thus, 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.
The opposite of this may not always be true. That is, if Pumping Lemma holds, it does not mean that the language is regular.

Pumping lemma | Theory of Computation - Computer Science Engineering (CSE)

For example, let us prove L01 = {0n1n | n ≥ 0} is irregular.
Let us assume that L is regular, then by Pumping Lemma the above given rules follow.
Now, let x ∈ L and |x| ≥ n. So, by Pumping Lemma, there exists u, v, w such that (1) – (3) hold.
 
We show that for all u, v, w, (1) – (3) does not hold.
If (1) and (2) hold then x = 0n1n = uvw with |uv| ≤ n and |v| ≥ 1.
So, u = 0a, v = 0b, w = 0c1n where : a + b ≤ n, b ≥ 1, c ≥ 0, a + b + c = n
But, then (3) fails for i = 0
uv0w = uw = 0a0c1n = 0a + c1n ∉ L, since a + c ≠ n.

Pumping lemma | Theory of Computation - Computer Science Engineering (CSE)

For above example, 0n1n is CFL, as any string can be the result of pumping at two places, one for 0 and other for 1.
Let us prove, L012 = {0n1n2n | n ≥ 0} is not Context-free.
Let us assume that L is Context-free, then by Pumping Lemma, the above given rules follow.
Now, let x ∈ L and |x| ≥ n. So, by Pumping Lemma, there exists u, v, w, x, y such that (1) – (3) hold.
We show that for all u, v, w, x, y (1) – (3) do not hold.

If (1) and (2) hold then x = 0n1n2n = uvwxy with |vwx| ≤ n and |vx| ≥ 1.
(1) tells us that vwx does not contain both 0 and 2. Thus, either vwx has no 0’s, or vwx has no 2’s. Thus, we have two cases to consider.
Suppose vwx has no 0’s. By (2), vx contains a 1 or a 2. Thus uwy has ‘n’ 0’s and uwy either has less than ‘n’ 1’s or has less than ‘n’ 2’s.
But (3) tells us that uwy = uv0wx0y ∈ L.
So, uwy has an equal number of 0’s, 1’s and 2’s gives us a contradiction. The case where vwx has no 2’s is similar and also gives us a contradiction. Thus L is not context-free.

The document Pumping lemma | Theory of Computation - Computer Science Engineering (CSE) is a part of the Computer Science Engineering (CSE) Course Theory of Computation.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)
18 videos|69 docs|44 tests

Top Courses for Computer Science Engineering (CSE)

FAQs on Pumping lemma - Theory of Computation - Computer Science Engineering (CSE)

1. What is the pumping lemma in computer science engineering?
Ans. The pumping lemma is a technique used in computer science engineering to prove that a language is not regular. It states that for any regular language, there exists a pumping length such that any string longer than that length can be divided into five parts, satisfying certain conditions.
2. How does the pumping lemma help in proving a language is not regular?
Ans. The pumping lemma provides a method to prove that a language is not regular. If we can show that a language does not satisfy the conditions of the pumping lemma, then we can conclude that the language is not regular. This helps in understanding the limitations of regular languages.
3. What are the conditions that need to be satisfied in the pumping lemma?
Ans. The conditions in the pumping lemma state that for any string longer than the pumping length, it can be divided into five parts: uvwxy. The length of v and y combined must be greater than 0, the length of uvwxy must be less than or equal to the pumping length, and for every positive integer n, the string u(v^n)w(x^n)y must also be in the language.
4. How is the pumping lemma used in practice?
Ans. The pumping lemma is primarily used in theoretical computer science to prove that certain languages are not regular. It helps in understanding the limitations of regular languages and enables us to explore more complex language classes, such as context-free or recursively enumerable languages.
5. Are there any alternative methods to prove a language is not regular apart from the pumping lemma?
Ans. Yes, apart from the pumping lemma, there are other methods to prove that a language is not regular. One such method is the Myhill-Nerode theorem, which uses the concept of indistinguishability to determine if a language is regular or not. Other techniques, such as closure properties or constructing a finite automaton, can also be used depending on the specific language and its properties.
18 videos|69 docs|44 tests
Download as PDF
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev
Related Searches

shortcuts and tricks

,

video lectures

,

Viva Questions

,

Exam

,

Pumping lemma | Theory of Computation - Computer Science Engineering (CSE)

,

study material

,

Important questions

,

MCQs

,

practice quizzes

,

Free

,

pdf

,

Previous Year Questions with Solutions

,

Sample Paper

,

past year papers

,

Objective type Questions

,

Pumping lemma | Theory of Computation - Computer Science Engineering (CSE)

,

ppt

,

Summary

,

Pumping lemma | Theory of Computation - Computer Science Engineering (CSE)

,

Semester Notes

,

Extra Questions

,

mock tests for examination

;