More Applications of The Pumping Lemma
More Applications of The Pumping Lemma
More Applications of The Pumping Lemma
of
1
The Pumping Lemma:
• Given a infinite regular language L
• there exists an integer m
• with | x y | m and | y | 1
i i 0, 1, 2, ...
• such that: xy z L
2
Non-regular languages R
L {vv : v *}
Regular languages
3
Theorem: The language
R
L {vv : v *} {a, b}
is not regular
4
R
L {vv : v *}
Since L is infinite
we can apply the Pumping Lemma
5
R
L {vv : v *}
Let m be the integer in the Pumping Lemma
length | w| m
m m m m
We pick wa b b a
6
m m m m
Write a b b a xyz
m m m m
xyz a...aa...a...ab...bb...ba...a
x y z
k
Thus: y a , k 1
7
m m m m k
x y za b b a y a , k 1
i
From the Pumping Lemma: xy z L
i 0, 1, 2, ...
2
Thus: xy z L
8
m m m m k
x y za b b a y a , k 1
2
From the Pumping Lemma: xy z L
m+k m m m
2
xy z = a...aa...aa...a...ab...bb...ba...a ∈ L
x y y z
m k m m m
Thus: a b b a L
9
m k m m m
a b b a L k 1
R
BUT: L {vv : v *}
m k m m m
a b b a L
CONTRADICTION!!!
10
Therefore: Our assumption that L
is a regular language is not true
11
Non-regular languages
n l n l
L {a b c : n, l 0}
Regular languages
12
Theorem: The language
n l n l
L {a b c : n, l 0}
is not regular
13
n l n l
L {a b c : n, l 0}
Since L is infinite
we can apply the Pumping Lemma
14
n l n l
L {a b c : n, l 0}
length | w| m
m m 2m
We pick wa b c
15
m m 2m
Write a b c xyz
m m 2m
xyz a...aa...aa...ab...bc...cc...c
x y z
k
Thus: y a , k 1
16
m m 2m k
x y za b c y a , k 1
i
From the Pumping Lemma: xy z L
i 0, 1, 2, ...
0
Thus: x y z = xz ∈ L
17
m m 2m k
x y za b c y a , k 1
mk m 2m
Thus: a b c L
18
mk m 2m
a b c L k 1
n l n l
BUT: L {a b c : n, l 0}
mk m 2m
a b c L
CONTRADICTION!!!
19
Therefore: Our assumption that L
is a regular language is not true
20
n!
Non-regular languages L {a : n 0}
Regular languages
21
Theorem: The language n!
L {a : n 0}
is not regular
n! 1 2 (n 1) n
22
n!
L {a : n 0}
Since L is infinite
we can apply the Pumping Lemma
23
n!
L {a : n 0}
m!
We pick wa
24
m!
Write a xyz
i
From the Pumping Lemma: xy z L
i 0, 1, 2, ...
2
Thus: xy z L
26
m! k
x y za y a , 1 k m
2
From the Pumping Lemma: xy z L
mk m!m
2
xy z a...aa...aa...aa...aa...aa...a L
x y y z
m! k
Thus: a L
27
m! k
a L 1 k m
n!
Since: L {a : n 0}
28
However: m! k m! m for m 1
m! m!
m!m m!
m!(m 1)
(m 1)!
m! k (m 1)!
n!
BUT: L {a : n 0}
m! k
a L
CONTRADICTION!!!
30
Therefore: Our assumption that L
is a regular language is not true
31