More Applications of the Pumping Lemma Fall 2006 Costas Busch - RPI The Pumping Lemma: • Given a infinite regular language • there exists an integer •

Download Report

Transcript More Applications of the Pumping Lemma Fall 2006 Costas Busch - RPI The Pumping Lemma: • Given a infinite regular language • there exists an integer •

More Applications
of
the Pumping Lemma
Fall 2006
Costas Busch - RPI
1
The Pumping Lemma:
• Given a infinite regular language
• there exists an integer
• for any string
• we can write
• with
m (critical length)
w L with length | w |  m
w x y z
| x y |  m and | y |  1
• such that:
Fall 2006
L
xy z  L
i
Costas Busch - RPI
i  0, 1, 2, ...
2
Non-regular languages
L  {vv : v  *}
R
Regular languages
Fall 2006
Costas Busch - RPI
3
Theorem: The language
L  {vv : v  *}
R
  {a, b}
is not regular
Proof:
Fall 2006
Use the Pumping Lemma
Costas Busch - RPI
4
L  {vv : v  *}
R
Assume for contradiction
that L is a regular language
Since L is infinite
we can apply the Pumping Lemma
Fall 2006
Costas Busch - RPI
5
L  {vv : v  *}
R
Let
m be the critical length for L
Pick a string
w such that: w  L
and length
We pick
Fall 2006
| w| m
wa b b a
m m m m
Costas Busch - RPI
6
From the Pumping Lemma:
we can write: w  a b b a
m
with lengths:
m
m
m
x y z
| x y |  m, | y | 1
m
m m m
w  xyz  a...aa...a...ab...bb...ba...a
x
Thus:
Fall 2006
y
z
y a , 1k m
k
Costas Busch - RPI
7
x y za b b a
m m m m
y a , 1k m
k
From the Pumping Lemma:
xy z  L
i
i  0, 1, 2, ...
Thus:
Fall 2006
xy z  L
2
Costas Busch - RPI
8
x y za b b a
m m m m
y a , 1k m
k
From the Pumping Lemma:
xy z  L
2
m m m
m+k
2
xy z = a...aa...aa...a...ab...bb...ba...a ∈L
x
Thus:
Fall 2006
y
a
y
z
m k m m m
b b a
Costas Busch - RPI
L
9
a
BUT:
m k m m m
b b a
L
k 1
L  {vv : v  *}
R
a
m k m m m
b b a
L
CONTRADICTION!!!
Fall 2006
Costas Busch - RPI
10
Therefore:
Our assumption that L
is a regular language is not true
Conclusion: L is not a regular language
END OF PROOF
Fall 2006
Costas Busch - RPI
11
Non-regular languages
n l n l
L  {a b c
: n, l  0}
Regular languages
Fall 2006
Costas Busch - RPI
12
Theorem: The language
n l n l
L  {a b c
: n, l  0}
is not regular
Proof:
Fall 2006
Use the Pumping Lemma
Costas Busch - RPI
13
n l n l
L  {a b c
: n, l  0}
Assume for contradiction
that L is a regular language
Since L is infinite
we can apply the Pumping Lemma
Fall 2006
Costas Busch - RPI
14
n l n l
L  {a b c
Let
: n, l  0}
m be the critical length of L
Pick a string
w such that: w  L
length
We pick
Fall 2006
and
| w| m
wa b c
m m 2m
Costas Busch - RPI
15
From the Pumping Lemma:
We can write
w a b c
With lengths
| x y |  m, | y | 1
m
m 2m
m
x y z
m
2m
w  xyz  a...aa...aa...ab...bc...cc...c
x
Thus:
Fall 2006
y
z
y a , 1k m
k
Costas Busch - RPI
16
x y za b c
m m 2m
y a , 1k m
k
From the Pumping Lemma:
xy z  L
i
i  0, 1, 2, ...
Thus:
Fall 2006
0
x y z = xz ∈ L
Costas Busch - RPI
17
x y za b c
m m 2m
y a , 1k m
k
xz  L
From the Pumping Lemma:
mk
m
2m
xz  a...aa...ab...bc...cc...c  L
x
Thus:
Fall 2006
z
a
mk m 2m
b c
Costas Busch - RPI
L
18
a
BUT:
mk m 2m
n l n l
L  {a b c
a
L
b c
k 1
: n, l  0}
mk m 2m
b c
L
CONTRADICTION!!!
Fall 2006
Costas Busch - RPI
19
Therefore:
Our assumption that L
is a regular language is not true
Conclusion: L is not a regular language
END OF PROOF
Fall 2006
Costas Busch - RPI
20
Non-regular languages
L  {a : n  0}
n!
Regular languages
Fall 2006
Costas Busch - RPI
21
Theorem: The language
L  {a : n  0}
n!
is not regular
n!  1 2  (n  1)  n
Proof:
Fall 2006
Use the Pumping Lemma
Costas Busch - RPI
22
L  {a : n  0}
n!
Assume for contradiction
that L is a regular language
Since L is infinite
we can apply the Pumping Lemma
Fall 2006
Costas Busch - RPI
23
L  {a : n  0}
n!
Let
m be the critical length of
Pick a string
L
w such that: w  L
length
We pick
Fall 2006
wa
Costas Busch - RPI
| w| m
m!
24
From the Pumping Lemma:
We can write
w a
With lengths
| x y |  m, | y | 1
m!
x y z
m
w  xyz  a
m!
 a...aa...aa...aa...aa...a
x
Thus:
Fall 2006
m!m
y
z
y  a , 1 k  m
k
Costas Busch - RPI
25
x y za
y  a , 1 k  m
m!
k
From the Pumping Lemma:
xy z  L
i
i  0, 1, 2, ...
Thus:
Fall 2006
xy z  L
2
Costas Busch - RPI
26
x y za
y  a , 1 k  m
m!
k
xy z  L
2
From the Pumping Lemma:
m!m
mk
xy z  a...aa...aa...aa...aa...aa...a  L
2
x
Thus:
Fall 2006
y
y
a
m! k
z
L
Costas Busch - RPI
27
a
Since:
m! k
L
1 k  m
L  {a : n  0}
n!
There must exist
p such that:
m! k  p!
Fall 2006
Costas Busch - RPI
28
However:
m! k  m! m
 m! m!
for
m 1
 m!m  m!
 m!(m  1)
 (m  1)!
m! k  (m  1)!
m! k  p!
Fall 2006
Costas Busch - RPI
for any
p
29
a
BUT:
m! k
L
1 k  m
L  {a : n  0}
n!
a
m! k
L
CONTRADICTION!!!
Fall 2006
Costas Busch - RPI
30
Therefore:
Our assumption that L
is a regular language is not true
Conclusion: L is not a regular language
END OF PROOF
Fall 2006
Costas Busch - RPI
31