Vous êtes sur la page 1sur 31

1

More Applications

of

the Pumping Lemma
2
The Pumping Lemma:
Given a infinite regular language L
there exists an integer m
for any string with length L we
m w > | |
we can write z y x w=
with and
m y x s | | 1 | | > y
such that:
L z y x
i
e
... , 2 , 1 , 0 = i
3
Regular languages
Non-regular languages
*} : { E e = v vv L
R
4
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
*} : { E e = v vv L
R
} , { b a = E
5
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
*} : { E e = v vv L
R
6
m m m m
a b b a w=
We pick
Let be the integer in the Pumping Lemma
Pick a string such that: w
L w e
m w > | |
length
m
and
*} : { E e = v vv L
R
7
Write
z y x a b b a
m m m m
=
it must be that length
From the Pumping Lemma
a ba bb ab a aa a xyz ... ... ... ... ... ... =
x
y
z
m
m m m
1 | | , | | > s y m y x
1 , > = k a y
k
Thus:
8
From the Pumping Lemma:
L z y x
i
e
... , 2 , 1 , 0 = i
Thus:
L z y x e
2
1 , > = k a y
k m m m m
a b b a z y x =
9
From the Pumping Lemma:
L a ba bb ab a aa aa a z xy ... ... ... ... ... ... ... =
2
x
y
z
k m+
m m m
1 , > = k a y
k
y
L z y x e
2
Thus:
m m m m
a b b a z y x =
L a b b a
m m m k m
e
+
10
L a b b a
m m m k m
e
+
L a b b a
m m m k m
e
+
BUT:
CONTRADICTION!!!
1 > k
*} : { E e = v vv L
R
11
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
12
Regular languages
Non-regular languages
} 0 , : { > =
+
l n c b a L
l n l n
13
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
} 0 , : { > =
+
l n c b a L
l n l n
14
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
} 0 , : { > =
+
l n c b a L
l n l n
15
m m m
c b a w
2
=
We pick
Let be the integer in the Pumping Lemma
Pick a string such that: w
L w e
m w > | |
length
m
} 0 , : { > =
+
l n c b a L
l n l n
and
16
Write
z y x c b a
m m m
=
2
it must be that length
From the Pumping Lemma
c cc bc ab aa aa a xyz ... ... ... ... ... ... =
x
y
z
m m
m 2
1 | | , | | > s y m y x
1 , > = k a y
k
Thus:
17
From the Pumping Lemma:
L z y x
i
e
... , 2 , 1 , 0 = i
Thus:
m m m
c b a z y x
2
=
L xz z y x =
0
1 , > = k a y
k
18
From the Pumping Lemma:
L c cc bc ab aa a xz e = ... ... ... ... ...
x
z
k m
m
m 2
m m m
c b a z y x
2
= 1 , > = k a y
k
L xz e
Thus:
L c b a
m m k m
e
2
19
L c b a
m m k m
e
2
L c b a
m m k m
e
2
BUT:
CONTRADICTION!!!
} 0 , : { > =
+
l n c b a L
l n l n
1 > k
20
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:
21
Regular languages
Non-regular languages
} 0 : {
!
> = n a L
n
22
Theorem: The language
is not regular
Proof: Use the Pumping Lemma
} 0 : {
!
> = n a L
n
n n n = ) 1 ( 2 1 !
23
Assume for contradiction
that is a regular language L
Since is infinite
we can apply the Pumping Lemma
L
} 0 : {
!
> = n a L
n
24
! m
a w=
We pick
Let be the integer in the Pumping Lemma
Pick a string such that: w
L w e
m w > | |
length
m
} 0 : {
!
> = n a L
n
25
Write
z y x a
m
=
!
it must be that length
From the Pumping Lemma
a aa aa aa aa a a xyz
m
... ... ... ... ...
!
= =
x y
z
m
m m !
1 | | , | | > s y m y x
m k a y
k
s s = 1 ,
Thus:
26
From the Pumping Lemma:
L z y x
i
e
... , 2 , 1 , 0 = i
Thus:
! m
a z y x =
L z y x e
2
m k a y
k
s s = 1 ,
27
From the Pumping Lemma:
L a aa aa aa aa aa a z xy e = ... ... ... ... ... ...
2
x y
z
k m+ m m !
Thus:
! m
a z y x = m k a y
k
s s = 1 ,
L z y x e
2
y
L a
k m
e
+ !
28
L a
k m
e
+ !
! ! p k m = +
} 0 : {
!
> = n a L
n
Since:
m k s s 1
There must exist such that: p
29
However:
)! 1 (
) 1 ( !
! !
! !
!
+ =
+ =
+ <
+ s
+ s
m
m m
m m m
m m
m m k m+ !
for
1 > m
)! 1 ( ! + < + m k m
! ! p k m = +
for any p
30
L a
k m
e
+ !
L a
k m
e
+ !
BUT:
CONTRADICTION!!!
} 0 : {
!
> = n a L
n
m k s s 1
31
Our assumption that
is a regular language is not true
L
Conclusion: L is not a regular language
Therefore:

Vous aimerez peut-être aussi