Regular Pumping Examples
Regular Pumping Examples
Regular Pumping Examples
of
the Pumping Lemma
w L
(critical length)
with length
| w| m
w x y z
| x y | m and | y | 1
such that:
xy z L
i 0, 1, 2, ...
Non-regular languages
L {vv : v *}
Regular languages
L {vv : v *}
is not regular
Proof:
{a, b}
L {vv : v *}
Assume for contradiction
that L is a regular language
Since L is infinite
we can apply the Pumping Lemma
L {vv : v *}
Let
Pick a string
such that:
w L
and length
We pick
m m m m
wa b b a
| w| m
with lengths:
x y z
| x y | m, | y | 1
m m m
w xyz a...aa...a...ab...bb...ba...a
x
Thus:
y a , 1k m
k
m m m m
x y za b b a
y a , 1k m
k
xy z L
i 0, 1, 2, ...
Thus:
xy z L
m m m m
x y za b b a
y a , 1k m
k
xy z L
m m m
m+k
2
xy z = a...aa...aa...a...ab...bb...ba...a L
x
Thus:
y
a
y
m k m m m
b b a
a
BUT:
m k m m m
b b a
L {vv : v *}
m k m m m
b b a
CONTRADICTION!!!
k 1
Therefore:
Conclusion: L
END OF PROOF
Non-regular languages
n l n l
L {a b c
Regular languages
: n, l 0}
L {a b c
: n, l 0}
is not regular
Proof:
n l n l
L {a b c
: n, l 0}
Since L is infinite
we can apply the Pumping Lemma
n l n l
L {a b c
Let
: n, l 0}
Pick a string
such that:
w L
length
We pick
m m 2m
wa b c
and
| w| m
w a b c
With lengths
| x y | m, | y | 1
2m
x y z
2m
w xyz a...aa...aa...ab...bc...cc...c
x
Thus:
y a , 1k m
k
m m 2m
x y za b c
y a , 1k m
xy z L
i 0, 1, 2, ...
Thus:
x y z = xz L
m m 2m
x y za b c
y a , 1k m
k
xz L
mk
2m
xz a...aa...ab...bc...cc...c L
x
Thus:
mk m 2m
b c
BUT:
mk m 2m
b c
n l n l
L {a b c
mk m 2m
b c
: n, l 0}
CONTRADICTION!!!
k 1
Therefore:
Conclusion: L
END OF PROOF
Non-regular languages
n!
L {a : n 0}
Regular languages
n!
L {a : n 0}
is not regular
n! 1 2 (n 1) n
Proof:
n!
L {a : n 0}
Since L is infinite
we can apply the Pumping Lemma
n!
L {a : n 0}
Let
Pick a string
such that:
w L
length
We pick
wa
m!
| w| m
m!
x y z
| x y | m, | y | 1
m
w xyz a
m!
m! m
a...aa...aa...aa...aa...a
x
Thus:
y
k
y a , 1 k m
x y za
m!
y a , 1 k m
xy z L
i 0, 1, 2, ...
Thus:
xy z L
x y za
m!
y a , 1 k m
mk
xy z L
m!m
xy z a...aa...aa...aa...aa...aa...a L
x
Thus:
y
a
m! k
a
Since:
m! k
1 k m
n!
L {a : n 0}
m! k p!
such that:
However:
m! k m! m
m! m!
m!m m!
m!(m 1)
(m 1)!
for
m 1
m! k (m 1)!
m! k p!
for any
a
BUT:
m! k
n!
L {a : n 0}
m! k
CONTRADICTION!!!
1 k m
Therefore:
Conclusion: L
END OF PROOF