Docsity

Pumping Lemma for regular languages, Study notes of Data Communication Systems and Computer Networks

Toggle sidebar
bg1
Pumping Lemma for regular languages
Suppose that a language L is regular. Then there is a FA that accepts L.
Let n be the number of states of that FA.Then for any string x in L with |x| ≥ n, there are
strings u, v and w which satisfy the following:
ox = uvw
o|uv| ≤ n
o|v| > 0 is same asv≠ ε
oFor every integer m ≥ 0, uvmw ∈ L.
IfLis regular then for everyxsuch that |x| ≥nthen there existsuvwsuch thatx=uvw,v≠ ε, |
uv| ≤n, and for whichuviwis inLfor everyi.
Applications of Pumping Lemma
Pumping Lemma is to be applied to show that certain languages are not regular. It should never be used
to show a language is regular.
IfLis regular, it satisfies Pumping Lemma.
IfLdoes not satisfy Pumping Lemma, it is non-regular.
Method to prove that a language L is not regular
At first, we have to assume thatLis regular.
So, the pumping lemma should hold forL.
Use the pumping lemma to obtain a contradiction −
oSelectwsuch that|w| ≥ c
oSelectysuch that|y| ≥ 1
oSelectxsuch that|xy| ≤ c
oAssign the remaining string toz.
oSelectksuch that the resulting string is not inL.
Hence L is not regular.
Problem
Prove thatL = {aibi| i ≥ 0}is not regular.
Solution−
At first, we assume thatLis regular and n is the number of states.
Let w =anbn. Thus |w| = 2n ≥ n.
By pumping lemma, let w = xyz, where |xy| ≤ n.
Let x = ap, y = aq, and z = arbn, where p + q + r = n, p ≠ 0, q ≠ 0, r ≠ 0. Thus |y| ≠ 0.
Let k = 2. Then xy2z = apa2qarbn.
Number of as = (p + 2q + r) = (p + q + r) + q = n + q
Hence, xy2z = an+qbn. Since q ≠ 0, xy2z is not of the form anbn.
Thus, xy2z is not in L. Hence L is not regular.

Partial preview of the text

Download Pumping Lemma for regular languages and more Study notes Data Communication Systems and Computer Networks in PDF only on Docsity!

Pumping Lemma for regular languages

 Suppose that a language L is regular. Then there is a FA that accepts L.

 Let n be the number of states of that FA. Then for any string x in L with |x| ≥ n, there are

strings u, v and w which satisfy the following:

o x = uvw

o |uv| ≤ n

o |v| > 0 is same as v ≠ ε

o For every integer m ≥ 0, uvmw ∈ L.

 If L is regular then for every x such that | x | ≥ n then there exists uvw such that x=uvw , v ≠ ε, |

uv | ≤ n , and for which uviw is in L for every i.

Applications of Pumping Lemma

Pumping Lemma is to be applied to show that certain languages are not regular. It should never be used to show a language is regular.  If L is regular, it satisfies Pumping Lemma.  If L does not satisfy Pumping Lemma, it is non-regular.

Method to prove that a language L is not regular

 At first, we have to assume that L is regular.  So, the pumping lemma should hold for L.  Use the pumping lemma to obtain a contradiction − o Select w such that |w| ≥ c o Select y such that |y| ≥ 1 o Select x such that |xy| ≤ c o Assign the remaining string to z. o Select k such that the resulting string is not in L. Hence L is not regular. Problem Prove that L = {aibi^ | i ≥ 0} is not regular. Solution −  At first, we assume that L is regular and n is the number of states.  Let w = anbn. Thus |w| = 2n ≥ n.  By pumping lemma, let w = xyz, where |xy| ≤ n.  Let x = ap, y = aq, and z = arbn, where p + q + r = n, p ≠ 0, q ≠ 0, r ≠ 0. Thus |y| ≠ 0.  Let k = 2. Then xy^2 z = apa2qarbn.  Number of as = (p + 2q + r) = (p + q + r) + q = n + q  Hence, xy^2 z = an+q^ bn. Since q ≠ 0, xy^2 z is not of the form anbn.  Thus, xy^2 z is not in L. Hence L is not regular.