Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Application of pumping lemma for regular sets

Note: Pumping lemma is a technique to identify the class of language for finite automata (FA).

Example-1: Show that a language L = {anbn : n > 0 } is not regular.

Solution:
Let L be a regular language and any string w = apbp, w ∊ L.
Now, according to the pumping lemma of regular set, ‘w’ can be decomposed into x, y, and z
as:
x = aq
y = ar (r >0)
z = ap-(q+r)bp, where w = xyz ∊ L

Now, using the property of pumping lemma, we have


xy2z = aq a(r)*2 ap-(q+r)bp = aq a2r ap-(q+r)bp = ap+rbp ≠ apbp or xy2z ∉ L

Here, our assumption w ∊ L contradict with our result obtained. Hence, language L = {anbn :
n > 0 } is not regular.

Note: In the decomposition of the string, we must decompose the first symbol for the first and
second string and then put all remaining parts on the final string.

Example-2: Show that a language L = {xx : x ∊ (0, 1)*} is not regular.

Solution:
Let L be a regular language and x = anbn then any string w = anbnanbn, w ∊ L.
Now, according to the pumping lemma of regular set, ‘w’ can be decomposed into the strings
r, s, and t as:
r = al
s = am (r >0)
t = an-(l+m)bnanbn, where w = rst ∊ L

Now, using the property of pumping lemma, we have


rs2t = al a(m)*2 an-(l+m)bnanbn = al a2m an-(l+m)bnanbn = an+m bnanbn ≠ anbnanbn or rs2t ∉ L

Here, our assumption w ∊ L contradict with our result obtained. Hence, language L = {xx : x
∊ (0, 1)*} is not regular.

Example-3: Show that a language L = {ai2 : i ≥ 1} is not regular.

Solution:
Here, we have to show that the pumping lemma does not hold for L. Thus, consider any
pumping number p ≥ 1.
Now, choose w = ap2

Theory of Computation - Compiled by Yagya Raj Pandeya, NAST, Dhangadhi ©yagyapandeya@gmail.com Page 1

Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)


Now, according to the pumping lemma of regular set, w = xyz can be decompose such that
|y|>0 and |xy| ≤ p. That is:
x = am
y = an (n >0)
z = ap2-(m+n)

Now, using the property of pumping lemma, we have


xy2z = am a(n)*2 ap2-(m+n)= am a2n ap2-(m+n) = ap2+n) ≠ ap2 or xy2z ∉ L

Here, our assumption w ∊ L contradict with our result obtained. Hence, language L = {ai2 : i ≥
1} is not regular.

Example-4: Show that a language L = {a2n : n ≥ 1} is regular.

Solution:
Here, we can write, L = a2n = a(a2)ia, i ≥ 0 [As i = 0, L = aa and i = 1, L = a(a2)ia]
Now, let a2 = p
Hence, L = ap*a, which can be represented by finite automata as given below:

Hence, L is a regular language as it is accepted by finite automata.

Theory of Computation - Compiled by Yagya Raj Pandeya, NAST, Dhangadhi ©yagyapandeya@gmail.com Page 2

Print to PDF without this message by purchasing novaPDF (http://www.novapdf.com/)

You might also like