0% found this document useful (0 votes)
85 views31 pages

Regular Pumping Examples

The document discusses using the pumping lemma to prove that certain languages are not regular. It provides examples of applying the pumping lemma to the languages L={vv: v in Σ*}, L={anbncn: n,l ≥ 0}, and L={an!: n ≥ 0} to show that they are not regular. The proofs work by assuming the languages are regular, applying the pumping lemma conditions, and arriving at a contradiction.

Uploaded by

tariqravian
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views31 pages

Regular Pumping Examples

The document discusses using the pumping lemma to prove that certain languages are not regular. It provides examples of applying the pumping lemma to the languages L={vv: v in Σ*}, L={anbncn: n,l ≥ 0}, and L={an!: n ≥ 0} to show that they are not regular. The proofs work by assuming the languages are regular, applying the pumping lemma conditions, and arriving at a contradiction.

Uploaded by

tariqravian
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 31

More Applications

of

the Pumping Lemma

Fall 2005 Costas Busch - RPI 1


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
Fall 2005 Costas Busch - RPI 2
Non-regular languages R
L  {vv : v  *}

Regular languages

Fall 2005 Costas Busch - RPI 3


Theorem: The language
R
L  {vv : v  *}   {a, b}
is not regular

Proof: Use the Pumping Lemma

Fall 2005 Costas Busch - RPI 4


R
L  {vv : v  *}

Assume for contradiction


that L is a regular language

Since L is infinite
we can apply the Pumping Lemma

Fall 2005 Costas Busch - RPI 5


R
L  {vv : v  *}
Let m be the integer in the Pumping Lemma

Pick a string w such that: w  L and

length | w| m

m m m m
We pick wa b b a
Fall 2005 Costas Busch - RPI 6
m m m m
Write a b b a xyz

From the Pumping Lemma


it must be that length | x y |  m, | y | 1

m m m m
xyz  a...aa...a...ab...bb...ba...a
x y z
k
Thus: y  a , k 1
Fall 2005 Costas Busch - RPI 7
m m m m k
x y za b b a y  a , k 1

i
From the Pumping Lemma: xy z  L
i  0, 1, 2, ...

2
Thus: xy z  L
Fall 2005 Costas Busch - RPI 8
m m m m k
x y za 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
Fall 2005 Costas Busch - RPI 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!!!
Fall 2005 Costas Busch - RPI 10
Therefore: Our assumption that L
is a regular language is not true

Conclusion: L is not a regular language

Fall 2005 Costas Busch - RPI 11


Non-regular languages
n l n l
L  {a b c : n, l  0}

Regular languages

Fall 2005 Costas Busch - RPI 12


Theorem: The language
n l n l
L  {a b c : n, l  0}
is not regular

Proof: Use the Pumping Lemma

Fall 2005 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 2005 Costas Busch - RPI 14


n l n l
L  {a b c : n, l  0}

Let m be the integer in the Pumping Lemma

Pick a string w such that: w  L and

length | w| m

m m 2m
We pick wa b c
Fall 2005 Costas Busch - RPI 15
m m 2m
Write a b c xyz

From the Pumping Lemma


it must be that length | x y |  m, | y | 1

m m 2m
xyz  a...aa...aa...ab...bc...cc...c
x y z
k
Thus: y  a , k 1
Fall 2005 Costas Busch - RPI 16
m m 2m k
x y za 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

Fall 2005 Costas Busch - RPI 17


m m 2m k
x y za b c y  a , k 1

From the Pumping Lemma: xz  L


mk m 2m
xz  a...aa...ab...bc...cc...c  L
x z

mk m 2m
Thus: a b c L
Fall 2005 Costas Busch - RPI 18
mk m 2m
a b c L k 1

n l n l
BUT: L  {a b c : n, l  0}

mk m 2m
a b c L

CONTRADICTION!!!
Fall 2005 Costas Busch - RPI 19
Therefore: Our assumption that L
is a regular language is not true

Conclusion: L is not a regular language

Fall 2005 Costas Busch - RPI 20


n!
Non-regular languages L  {a : n  0}

Regular languages

Fall 2005 Costas Busch - RPI 21


Theorem: The language n!
L  {a : n  0}
is not regular

n!  1  2  (n  1)  n

Proof: Use the Pumping Lemma

Fall 2005 Costas Busch - RPI 22


n!
L  {a : n  0}

Assume for contradiction


that L is a regular language

Since L is infinite
we can apply the Pumping Lemma

Fall 2005 Costas Busch - RPI 23


n!
L  {a : n  0}

Let m be the integer in the Pumping Lemma

Pick a string w such that: w  L


length | w| m

m!
We pick wa
Fall 2005 Costas Busch - RPI 24
m!
Write a xyz

From the Pumping Lemma


it must be that length | x y |  m, | y | 1
m m! m
m!
xyz  a  a...aa...aa...aa...aa...a
x y z
k
Thus: y  a , 1 k  m
Fall 2005 Costas Busch - RPI 25
m! k
x y za y  a , 1 k  m

i
From the Pumping Lemma: xy z  L
i  0, 1, 2, ...

2
Thus: xy z  L

Fall 2005 Costas Busch - RPI 26


m! k
x y za y  a , 1 k  m

2
From the Pumping Lemma: xy z  L

mk m!m
2
xy z  a...aa...aa...aa...aa...aa...a  L
x y y z

m! k
Thus: a L
Fall 2005 Costas Busch - RPI 27
m! k
a L 1 k  m

n!
Since: L  {a : n  0}

There must exist p such that:


m! k  p!

Fall 2005 Costas Busch - RPI 28


However: m! k  m! m for m 1
 m! m!
 m!m  m!
 m!(m  1)
 (m  1)!

m! k  (m  1)!

m! k  p! for any p


Fall 2005 Costas Busch - RPI 29
m! k 1 k  m
a L

n!
BUT: L  {a : n  0}

m! k
a L

CONTRADICTION!!!
Fall 2005 Costas Busch - RPI 30
Therefore: Our assumption that L
is a regular language is not true

Conclusion: L is not a regular language

Fall 2005 Costas Busch - RPI 31

You might also like