You are on page 1of 23

The Pumping Lemma

A. Senthil, Professor /CSE 1


Take an infinite regular language L

There exists a DFA that accepts L

m
states

A. Senthil, Professor /CSE 2


Take string w with wÎ L

There is a walk with label w:

.........
walk w
A. Senthil, Professor /CSE 3
If string w has length | w| ³ m (number
of states
of DFA)

then, from the pigeonhole principle:

a state is repeated in the walk w

...... q ......
walk w
A. Senthil, Professor /CSE 4
Let q be the first state repeated in the
walk of w

...... q ......
walk w
A. Senthil, Professor /CSE 5
Write w= x y z

...... q ......

x A. Senthil, Professor /CSE


z 6
Observations: length | x y | £ m number
of states
length | y | ³1 of DFA

...... q ......

x A. Senthil, Professor /CSE


z 7
Observation: The string xz
is accepted

...... q ......

x A. Senthil, Professor /CSE


z 8
Observation: The string xyyz
is accepted

...... q ......

x A. Senthil, Professor /CSE


z 9
Observation: The string xyyyz
is accepted

...... q ......

x A. Senthil, Professor /CSE


z 10
i
In General: The string xy z
is accepted i = 0, 1, 2, ...

...... q ......

x A. Senthil, Professor /CSE


z 11
In General: i
x y z ∈L i = 0, 1, 2, ...

Language accepted by the DFA

...... q ......

x A. Senthil, Professor /CSE


z 12
The Pumping Lemma:
• Given a infinite regular language L
• there exists an integer m
• for any string wÎ L with length | w|³ m

• we can write w= x y z

• with | x y | £ m and | y | ³ 1
i i = 0, 1, 2, ...
• such that: xy z Î L
A. Senthil, Professor /CSE 13
Applications

of

the Pumping Lemma

A. Senthil, Professor /CSE 14


Theorem: n n
The language L = {a b : n ³ 0}
is not regular

Proof: Use the Pumping Lemma

A. Senthil, Professor /CSE 15


n n
L = {a b : n ³ 0}

Assume for contradiction


that L is a regular language

Since L is infinite
we can apply the Pumping Lemma

A. Senthil, Professor /CSE 16


n n
L = {a b : n ³ 0}
Let m be the integer in the Pumping Lemma

Pick a string w such that: wÎ L


length | w|³ m

m m
We pick w=a b
A. Senthil, Professor /CSE 17
m m
Write: a b =xyz

From the Pumping Lemma


it must be that length | x y | £ m, | y |³ 1
m m
m m
xyz = a b = a...aa...aa...ab...b
x y z
k
Thus: y = a , k ³1
A. Senthil, Professor /CSE 18
m m k
x y z=a b y = a , k ³1

i
From the Pumping Lemma: xy z Î L
i = 0, 1, 2, ...

2
Thus: xy z Î L

A. Senthil, Professor /CSE 19


m m k
x y z=a b y = a , k ³1

2
From the Pumping Lemma: xy z Î L

m+k m
2
xy z = a...aa...aa...aa...ab...b Î L
x y y z

m+ k m
Thus: a b ÎL
A. Senthil, Professor /CSE 20
m+ k m k≥ 1
a b ÎL

n n
BUT: L = {a b : n ³ 0}

m+ k m
a b ÏL

CONTRADICTION!!!
A. Senthil, Professor /CSE 21
Therefore: Our assumption that L
is a regular language is not true

Conclusion: L is not a regular language

A. Senthil, Professor /CSE 22


Non-regular languages n n
{a b : n ³ 0}

Regular languages

A. Senthil, Professor /CSE 23

You might also like