More Applications

of

the Pumping Lemma

Fall 2006 Costas Busch - RPI 1

The Pumping Lemma:
• Given a infinite regular language L
• there exists an integer m (critical length)

• for any string w L with length | w| m

• we can write w x y z

• with | x y |  m and | y |  1

• such that: xy z  L
i i  0, 1, 2, ...
Fall 2006 Costas Busch - RPI 2

Non-regular languages L  {vv : v  *}
R

Regular languages

Fall 2006 Costas Busch - RPI 3

Theorem: The language L  {vv : v  *} R   {a.RPI 4 . b} is not regular Proof: Use the Pumping Lemma Fall 2006 Costas Busch .

RPI 5 . 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 6 . L  {vv : v  *} R Let m be the critical length for L Pick a string w such that: w L and length | w| m We pick wa b b a m m m m Fall 2006 Costas Busch .

..ab.. | y | 1 m m m m w  xyz  a.a x y z Thus: y a .RPI 7 ...bb....aa..a. 1k m k Fall 2006 Costas Busch ..From the Pumping Lemma: we can write: w  a b b a x y z m m m m with lengths: | x y |  m..ba..

. 1k m k From the Pumping Lemma: xy z  L i i  0.. . Thus: xy z  L 2 Fall 2006 Costas Busch .x y za b b a m m m m y a . 2.RPI 8 . 1.

RPI 9 ...ba.aa.bb..x y za b b am m m m y a ..ab..a ∈ L x y y z m k m m m Thus: a b b a L Fall 2006 Costas Busch ..... 1k m k From the Pumping Lemma: xy z  L 2 m+k m m m 2 xy z = a..aa....a..

RPI 10 . m k m m m k 1 a b b a L BUT: L  {vv : v  *} R m k m m m a b b a L CONTRADICTION!!! Fall 2006 Costas Busch .

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.RPI 12 . l  0} Regular languages Fall 2006 Costas Busch .

l  0} is not regular Proof: Use the Pumping Lemma Fall 2006 Costas Busch .RPI 13 .Theorem: The language n l n l L  {a b c : n.

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 .

l  0} Let m be the critical length of L Pick a string w such that: w L and length | w| m We pick wa b c m m 2m Fall 2006 Costas Busch . n l n l L  {a b c : n.RPI 15 .

.From the Pumping Lemma: We can write w a b c m m 2m x y z With lengths | x y |  m...cc.aa.bc... 1k m k Fall 2006 Costas Busch ..c x y z Thus: y a ..ab...aa...RPI 16 .. | y | 1 m m 2m w  xyz  a.

1. 0 Thus: x y z = xz ∈ L Fall 2006 Costas Busch . .RPI 17 .. 1k m k From the Pumping Lemma: xy z  L i i  0.. x y za b c m m 2m y a . 2.

.c  L x z mk m 2 m Thus: a b c L Fall 2006 Costas Busch .. x y za b c m m 2m y a .aa....bc..cc.ab.RPI 18 . 1k m k From the Pumping Lemma: xz  L mk m 2m xz  a.....

mk m 2 m k 1 a b c L BUT: n l n l L  {a b c : n.RPI 19 . l  0} mk m 2 m a b c L CONTRADICTION!!! Fall 2006 Costas Busch .

RPI 20 .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 .

Non-regular languages L  {a : n  0} n! Regular languages Fall 2006 Costas Busch .RPI 21 .

RPI 22 .Theorem: The language L  {a : n  0} n! is not regular n!  1  2  (n  1)  n Proof: Use the Pumping Lemma Fall 2006 Costas Busch .

RPI 23 . 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 .

L  {a : n  0} n! Let m be the critical length of L Pick a string w such that: w L length | w| m We pick wa m! Fall 2006 Costas Busch .RPI 24 .

.aa...aa.a m! x y z Thus: y  a ..RPI 25 .aa.aa. 1 k  m k Fall 2006 Costas Busch ..From the Pumping Lemma: We can write w  a x y z m! With lengths | x y |  m..... | y | 1 m m!m w  xyz  a  a..

. x y za m! y  a . 1 k  m k From the Pumping Lemma: xy z  L i i  0. Thus: xy z  L 2 Fall 2006 Costas Busch .RPI 26 . 2. .. 1.

..a  L 2 x y y z Thus: m! k a L Fall 2006 Costas Busch ...aa.RPI 27 .aa... x y za m! y  a .. 1 k  m k From the Pumping Lemma: xy z  L 2 mk m!m xy z  a.aa...aa.aa....

RPI 28 . m! k a L 1 k  m Since: L  {a : n  0} n! There must exist p such that: m! k  p! Fall 2006 Costas Busch .

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 2006 Costas Busch .RPI 29 .

m! k 1 k  m a L BUT: L  {a : n  0} n! m! k a L CONTRADICTION!!! Fall 2006 Costas Busch .RPI 30 .

RPI 31 .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 .