Pumping Lemma Problems
Pumping Lemma Problems
Solution:
Let assume L is regular.
‘n’ is positive integer
w=anb2n
|w|>=n
x=an-j
y=aj | j>0
z=b2n
|xy|<=n
By pumping lemma,
xykz, k=2
an-j aj aj b2n = an+j b2n ∉ L, Hence the
language is not regular.
#5. Show that L ={ap | p is prime number} is
not regular.
w= { aa,aaa,aaaaa,aaaaaaa,…..}
Solution:
Let assume given L is regular
Let ‘n’ be the positive integer.
Let p=r+s+t
w=ar as at ; x= ar ; y= as; z= at
1. s>0
2.|xy|<=n
3. xyp+1z
By pumping lemma,
=xypyz
= ar (as)p as at
= a (r+s+t) asp
= ap asp
=a (s+1)p ∉ L, Hence the language is
not regular.
#6. Show that L= {0n | n is a perfect square}
is not regular.
Solution:
Let assume L be regular language.
Let ‘n’ be the positive integer.
Let w=0n^2
w=xyz
|w|>=n
|xy|<=n
|y|>0
By pumping lemma, k=2
|xy2z| =|xyz|+|y|
1<=|y|<=n
=n2 + (1<=|y|<=n)
=n2+1 <= n2+|y|<=n2+n
= n2+1<=|xyz|+|y|<= n2+n
= n2+1<=|xy2z| <= n2+n
Hence the minimum and maximum length
(limits) are not perfect square, hence the
language is not regular.