You are on page 1of 126

The Pumping Lemma for

Regular Languages

The Pumping Lemma forRegular Languages p.1/39




Consider the language




Nonregular languages
.

The Pumping Lemma forRegular Languages p.2/39




Consider the language




Nonregular languages
.


If we attempt to find a DFA that recognizes we discover that


such a machine needs to remember how many s have been
seen so far as it reads the input

The Pumping Lemma forRegular Languages p.2/39




Consider the language




Nonregular languages
.


If we attempt to find a DFA that recognizes we discover that


such a machine needs to remember how many s have been
seen so far as it reads the input


Because the number of s isnt limited, the machine needs to


keep track of an unlimited number of possibilities

The Pumping Lemma forRegular Languages p.2/39




Consider the language




Nonregular languages
.


If we attempt to find a DFA that recognizes we discover that


such a machine needs to remember how many s have been
seen so far as it reads the input


Because the number of s isnt limited, the machine needs to


keep track of an unlimited number of possibilities
This cannot be done with any finite number of states

The Pumping Lemma forRegular Languages p.2/39

Intuition may fail us


Just because a language appears to require
unbounded memory to be recognized, it doesnt mean
that it is necessarily so

The Pumping Lemma forRegular Languages p.3/39

Intuition may fail us


Just because a language appears to require
unbounded memory to be recognized, it doesnt mean
that it is necessarily so
Example:

The Pumping Lemma forRegular Languages p.3/39

Intuition may fail us


Just because a language appears to require
unbounded memory to be recognized, it doesnt mean
that it is necessarily so





 


Example:
has an equal number of 0s and 1s

The Pumping Lemma forRegular Languages p.3/39

Intuition may fail us


Just because a language appears to require
unbounded memory to be recognized, it doesnt mean
that it is necessarily so





 


Example:
has an equal number of 0s and 1s not regular

The Pumping Lemma forRegular Languages p.3/39

Intuition may fail us


Just because a language appears to require
unbounded memory to be recognized, it doesnt mean
that it is necessarily so

has an equal number of 0s and 1s not regular









 

 


Example:
has equal no of 01 and 10 substrings

The Pumping Lemma forRegular Languages p.3/39

Intuition may fail us


Just because a language appears to require
unbounded memory to be recognized, it doesnt mean
that it is necessarily so

has an equal number of 0s and 1s not regular









 

 


Example:
has equal no of 01 and 10 substrings regular

The Pumping Lemma forRegular Languages p.3/39

Language nonregularity
The technique for proving nonregularity of some
language is provided by a theorem about regular
languages called pumping lemma

The Pumping Lemma forRegular Languages p.4/39

Language nonregularity
The technique for proving nonregularity of some
language is provided by a theorem about regular
languages called pumping lemma
Pumping lemma states that all regular languages have
a special property

The Pumping Lemma forRegular Languages p.4/39

Language nonregularity
The technique for proving nonregularity of some
language is provided by a theorem about regular
languages called pumping lemma
Pumping lemma states that all regular languages have
a special property
If we can show that a language does not have this
property we are guaranteed that is not regular.

The Pumping Lemma forRegular Languages p.4/39

Observation
Pumping lemma states that all regular languages have a
special property.

The Pumping Lemma forRegular Languages p.5/39

Observation
Pumping lemma states that all regular languages have a
special property.
Pumping lemma does not state that only regular languages
have this property. Hence, the property used to prove that
a language is not regular does not ensure that language
is regular.

The Pumping Lemma forRegular Languages p.5/39

Observation
Pumping lemma states that all regular languages have a
special property.
Pumping lemma does not state that only regular languages
have this property. Hence, the property used to prove that
a language is not regular does not ensure that language
is regular.
Consequence: A language may not be regular and still have
strings that have all the properties of regular languages.

The Pumping Lemma forRegular Languages p.5/39

Pumping property
All strings in the language can be pumped" if they are at
least as long as a certain value, called the pumping length

The Pumping Lemma forRegular Languages p.6/39

Pumping property
All strings in the language can be pumped" if they are at
least as long as a certain value, called the pumping length
Meaning: each such string in the language contains a section that can be repeated any number of times with the resulting string remaining in the language.

The Pumping Lemma forRegular Languages p.6/39

Theorem 1.70


Pumping Lemma: If is a regular language, then there is


a pumping length such that:

The Pumping Lemma forRegular Languages p.7/39

Theorem 1.70


Pumping Lemma: If is a regular language, then there is


a pumping length such that:
is any string in

of length at least ,


If

The Pumping Lemma forRegular Languages p.7/39

Theorem 1.70


Pumping Lemma: If is a regular language, then there is


a pumping length such that:
of length at least ,


Then may be divided into three pieces,


satisfying the following conditions:

is any string in

If

The Pumping Lemma forRegular Languages p.7/39

Theorem 1.70


Pumping Lemma: If is a regular language, then there is


a pumping length such that:
is any string in

of length at least ,







1. for each

Then may be divided into three pieces,


satisfying the following conditions:

If

The Pumping Lemma forRegular Languages p.7/39

Theorem 1.70


Pumping Lemma: If is a regular language, then there is


a pumping length such that:
is any string in

of length at least ,










2.

1. for each

Then may be divided into three pieces,


satisfying the following conditions:

If

The Pumping Lemma forRegular Languages p.7/39

Theorem 1.70


Pumping Lemma: If is a regular language, then there is


a pumping length such that:
is any string in

of length at least ,









3.

2.

1. for each

Then may be divided into three pieces,


satisfying the following conditions:

If

The Pumping Lemma forRegular Languages p.7/39

represents the length of string and


may be concatenated times, and

Recall that
means that

Interpretation

The Pumping Lemma forRegular Languages p.8/39

may be , but

or

, either

represents the length of string and


may be concatenated times, and


When

Recall that
means that

Interpretation

The Pumping Lemma forRegular Languages p.8/39

may be , but

Without condition

or

, either


represents the length of string and


may be concatenated times, and

When

Recall that
means that

Interpretation

theorem would be trivially true

The Pumping Lemma forRegular Languages p.8/39


 
 
 

Let

Proof idea
be a DFA that recognizes

The Pumping Lemma forRegular Languages p.9/39


 
 
 

be a DFA that recognizes

Assign a pumping length

Let

Proof idea
to be the number of states of

The Pumping Lemma forRegular Languages p.9/39


 
 
 

be a DFA that recognizes


to be the number of states of



Assign a pumping length

Show that any string


,
may be broken into three
satisfying the pumping lemmas conditions
pieces


Let

Proof idea

The Pumping Lemma forRegular Languages p.9/39

More ideas
and
, consider a sequence of states that
goes through to accept , example:


 



 

 


If

The Pumping Lemma forRegular Languages p.10/39

More ideas
and
, consider a sequence of states that
goes through to accept , example:

 

 



then the

must be final;if
is


 

 

  

  



Since
accepts ,
length of



 


If

The Pumping Lemma forRegular Languages p.10/39

More ideas
and
, consider a sequence of states that
goes through to accept , example:


 



 

 


If



it result that

and

 

then the

 

  

must be final;if
is

Because



  



Since
accepts ,
length of

The Pumping Lemma forRegular Languages p.10/39

More ideas
and
, consider a sequence of states that
goes through to accept , example:


 



 

 


If



it result that

and

 

then the

 

  

must be final;if
is

Because



  



Since
accepts ,
length of

By pigeonhole principle:

The Pumping Lemma forRegular Languages p.10/39

More ideas
and
, consider a sequence of states that
goes through to accept , example:


 



 

 


If



it result that

and

 

then the

 

  

must be final;if
is

Because



  



Since
accepts ,
length of

By pigeonhole principle:
- If p pigeons are placed into fewer than p holes, some holes must
hold more than one pigeon

The Pumping Lemma forRegular Languages p.10/39

More ideas
and
, consider a sequence of states that
goes through to accept , example:


 



 

 


If

 



then the

it result that

and

 

  

must be final;if
is

Because



  



Since
accepts ,
length of

By pigeonhole principle:

 

  

  

the sequence
state, see Figure 1

 

- If p pigeons are placed into fewer than p holes, some holes must
hold more than one pigeon

must contain a repeated

The Pumping Lemma forRegular Languages p.10/39


















repeats when

reads

Figure 1: State

 









Recognition sequence

The Pumping Lemma forRegular Languages p.11/39

in to the three pieces: , , and




Divide

More ideas, continuation

The Pumping Lemma forRegular Languages p.12/39

is the part of

appearing before



Piece

in to the three pieces: , , and




Divide

More ideas, continuation

The Pumping Lemma forRegular Languages p.12/39

in to the three pieces: , , and




is the part of

appearing before

is the part of

between two appearances of

Piece

Piece



Divide

More ideas, continuation

The Pumping Lemma forRegular Languages p.12/39

in to the three pieces: , , and




Piece

appearing before

is the part of

between two appearances of

is the part of

after the 2nd appearance of

Piece

is the part of

Piece



Divide

More ideas, continuation

The Pumping Lemma forRegular Languages p.12/39

in to the three pieces: , , and




Piece

appearing before

is the part of

between two appearances of

is the part of

after the 2nd appearance of

Piece

is the part of

Piece



Divide

More ideas, continuation

In other words:

The Pumping Lemma forRegular Languages p.12/39

in to the three pieces: , , and




Piece

appearing before

is the part of

between two appearances of

is the part of

after the 2nd appearance of

Piece

is the part of

Piece



Divide

More ideas, continuation

from

to

takes

 

In other words:
,

The Pumping Lemma forRegular Languages p.12/39

in to the three pieces: , , and




Piece

appearing before

is the part of

between two appearances of

is the part of

after the 2nd appearance of

Piece

is the part of

Piece



Divide

More ideas, continuation

from

to

takes

to

from

 

takes

In other words:
,
,

The Pumping Lemma forRegular Languages p.12/39

in to the three pieces: , , and




Piece

appearing before

is the part of

between two appearances of

is the part of

after the 2nd appearance of

Piece

is the part of

Piece



Divide

More ideas, continuation

to

from

takes

to

,
,

from

to

 

takes

 

from

takes

In other words:

The Pumping Lemma forRegular Languages p.12/39

Note
The division specified above satisfies the 3 conditions

The Pumping Lemma forRegular Languages p.13/39

on

Suppose that we run

Observations

The Pumping Lemma forRegular Languages p.14/39



, and in
which is also


 



Condition 1: it is obvious that


accepts
for all
. For
,
general
to
accepted because takes



on

Suppose that we run

Observations

The Pumping Lemma forRegular Languages p.14/39



, and in
which is also

 





Condition 1: it is obvious that


accepts
for all
. For
,
general
to
accepted because takes



on

Suppose that we run

Observations

is

Condition 2: Since
, state is repeated. Then because
.
the part between two successive occurrences of ,

The Pumping Lemma forRegular Languages p.14/39



, and in
which is also

 





Condition 1: it is obvious that


accepts
for all
. For
,
general
to
accepted because takes



on

Suppose that we run

Observations

is

Condition 2: Since
, state is repeated. Then because
.
the part between two successive occurrences of ,



Condition 3: makes sure that is the first repetition in the


states in
sequence. Then by pigeonhole principle, the first
the sequence must contain a repetition. Therefore,

The Pumping Lemma forRegular Languages p.14/39


 
 
 

Pumping lemmas proof




 



Let
be a DFA that has states and
recognizes . Let
be a string over of
length
. Let
be the sequence of states
,
while processing , i.e.,

The Pumping Lemma forRegular Languages p.15/39


 
 
 

Pumping lemmas proof









 





elements in
.

 

and among the first


two must be the same state, say

 



Let
be a DFA that has states and
recognizes . Let
be a string over of
length
. Let
be the sequence of states
,
while processing , i.e.,

The Pumping Lemma forRegular Languages p.15/39


 
 
 

Pumping lemmas proof








 





places in the sequence



Because occurs among the first


starting at , we have

elements in
.

 

and among the first


two must be the same state, say

 



Let
be a DFA that has states and
recognizes . Let
be a string over of
length
. Let
be the sequence of states
,
while processing , i.e.,

The Pumping Lemma forRegular Languages p.15/39


 
 
 

Pumping lemmas proof










 



places in the sequence

Now let



Because occurs among the first


starting at , we have

elements in
.

and among the first


two must be the same state, say

 

 



Let
be a DFA that has states and
recognizes . Let
be a string over of
length
. Let
be the sequence of states
,
while processing , i.e.,

The Pumping Lemma forRegular Languages p.15/39

Note










 

for

to , and takes
must accept
,



takes
from to , takes
from
from to
, which is an accept state,


As

The Pumping Lemma forRegular Languages p.16/39

Note












 

, so

We know that

for

to , and takes
must accept
,



takes
from to , takes
from
from to
, which is an accept state,


As

The Pumping Lemma forRegular Languages p.16/39

Note












 

, so



We also know that

;


, so

We know that

for

to , and takes
must accept
,



takes
from to , takes
from
from to
, which is an accept state,


As

The Pumping Lemma forRegular Languages p.16/39

Note












 

, so



We also know that

;


, so

We know that

for

to , and takes
must accept
,



takes
from to , takes
from
from to
, which is an accept state,


As

Thus, all conditions are satisfied and lemma is proven

The Pumping Lemma forRegular Languages p.16/39

Before using lemma


Note: To use this lemma we must also ensure that if the
property stated by the pumping lemma is true then the
language is regular.

The Pumping Lemma forRegular Languages p.17/39

Before using lemma


Note: To use this lemma we must also ensure that if the
property stated by the pumping lemma is true then the
language is regular.
Proof: assuming that each element of language satisfies
the three conditions stated in pumping lemma we can
easily construct a FA that recognizes , that is, is regular.

The Pumping Lemma forRegular Languages p.17/39

Before using lemma


Note: To use this lemma we must also ensure that if the
property stated by the pumping lemma is true then the
language is regular.
Proof: assuming that each element of language satisfies
the three conditions stated in pumping lemma we can
easily construct a FA that recognizes , that is, is regular.
Note: if only some elements of
mean that

satisfy the three conditions it does not

is regular.

The Pumping Lemma forRegular Languages p.17/39

Using pumping lemma (PL)


Proving that a language

is not regular using PL:

The Pumping Lemma forRegular Languages p.18/39

Using pumping lemma (PL)


is not regular using PL:

Proving that a language


1. Assume that

is regular in order to obtain a contradiction

The Pumping Lemma forRegular Languages p.18/39

Using pumping lemma (PL)


is not regular using PL:

Proving that a language


1. Assume that

is regular in order to obtain a contradiction

2. The pumping lemma guarantees the existence of a pumping


length s.t. all strings of length or greater in can be pumped

The Pumping Lemma forRegular Languages p.18/39

Using pumping lemma (PL)


is not regular using PL:

Proving that a language


1. Assume that

is regular in order to obtain a contradiction




2. The pumping lemma guarantees the existence of a pumping


length s.t. all strings of length or greater in can be pumped





3. Find
,
, that cannot be pumped: demonstrate that
cannot be pumped by considering all ways of dividing into , , ,
showing that for each division one of the pumping lemma
, (2)
, (3)
, fails.
conditions, (1)

The Pumping Lemma forRegular Languages p.18/39

Observations
The existence of contradicts pumping lemma, hence
cannot be regular

The Pumping Lemma forRegular Languages p.19/39

Observations
The existence of contradicts pumping lemma, hence
cannot be regular
Finding sometimes takes a bit of creative thinking.
Experimentation is suggested

The Pumping Lemma forRegular Languages p.19/39




Example 1: prove that


 

Applications
is not regular

The Pumping Lemma forRegular Languages p.20/39

such that for any

; obviously



be the pumping length of


. By pumping




lemma

 

. Choose

is not regular

is regular and let




Assume that

Example 1: prove that


 

Applications

The Pumping Lemma forRegular Languages p.20/39

Example, continuation
Consider the cases:

The Pumping Lemma forRegular Languages p.21/39

Example, continuation
Consider the cases:


has more s than s and






consists of s only. In this case


so it is not in , violating condition 1


1.

The Pumping Lemma forRegular Languages p.21/39

Example, continuation
Consider the cases:


has more s than s and






consists of s only. In this case


so it is not in , violating condition 1


1.

consists of s only. This leads to the same contradiction




2.

The Pumping Lemma forRegular Languages p.21/39

Example, continuation
Consider the cases:




has more s than s and

consists of s only. In this case


so it is not in , violating condition 1


1.



consists of s and s. In this case


may have the same
number of s and s but they are out of order with some s before
some s hence it cannot be in either


consists of s only. This leads to the same contradiction

3.

2.

The Pumping Lemma forRegular Languages p.21/39

Example, continuation
Consider the cases:




has more s than s and

consists of s only. In this case


so it is not in , violating condition 1


1.



consists of s and s. In this case


may have the same
number of s and s but they are out of order with some s before
some s hence it cannot be in either


consists of s only. This leads to the same contradiction




3.

2.

The contradiction is unavoidable if we make the assumption


that

is regular so

is not regular

The Pumping Lemma forRegular Languages p.21/39




Prove that
is not regular



Example 2
has an equal number of 0s and 1s

The Pumping Lemma forRegular Languages p.22/39

is regular and

for any

, where

is its pumping length.

. Then pumping lemma guarantees




with




that

Let

Proof: assume that

has an equal number of 0s and 1s

Prove that
is not regular



Example 2

The Pumping Lemma forRegular Languages p.22/39

Note


 

If we take the division


,
it seems that
indeed, no contradiction occurs. However:

The Pumping Lemma forRegular Languages p.23/39

Note


 



and





Condition 3 states that


, and in our case
. Hence,
cannot be pumped

If we take the division


,
it seems that
indeed, no contradiction occurs. However:

The Pumping Lemma forRegular Languages p.23/39

Note


 




and





Condition 3 states that


, and in our case
. Hence,
cannot be pumped

If we take the division


,
it seems that
indeed, no contradiction occurs. However:








If
then must consists of only s, so
there are more 1-s than 0-s.

because

The Pumping Lemma forRegular Languages p.23/39

Note


 




and





Condition 3 states that


, and in our case
. Hence,
cannot be pumped

If we take the division


,
it seems that
indeed, no contradiction occurs. However:








If
then must consists of only s, so
there are more 1-s than 0-s.

because

This gives us the desired contradiction

The Pumping Lemma forRegular Languages p.23/39

leads us to trouble because this string







for any

Then

can be pumped by the division:

Selecting

Other selections

The Pumping Lemma forRegular Languages p.24/39

An alternative method
Use the fact that

is nonregular.

The Pumping Lemma forRegular Languages p.25/39

An alternative method
Use the fact that

were regular then


would also be regular because
is regular and of regular languages is a regular language.


If

is nonregular.

The Pumping Lemma forRegular Languages p.25/39

An alternative method
Use the fact that







But

were regular then


would also be regular because
is regular and of regular languages is a regular language.


If

is nonregular.

which is not regular.

The Pumping Lemma forRegular Languages p.25/39

An alternative method
Use the fact that




Hence,

But

were regular then


would also be regular because
is regular and of regular languages is a regular language.


If

is nonregular.

which is not regular.

is not regular either.

The Pumping Lemma forRegular Languages p.25/39

is nonregular using



 

Show that
pumping lemma

 

Example 3

The Pumping Lemma forRegular Languages p.26/39

Proof: Assume that

is nonregular using



 

Show that
pumping lemma

 

Example 3

. Since






Consider

is regular and is its pumping length.


and

satisfiesthe conditions of the pumping lemma.

The Pumping Lemma forRegular Languages p.26/39

Note


Condition 3 is again crucial because without it we


, so
could pump if we let

The Pumping Lemma forRegular Languages p.27/39

Note

exhibits the essence of the

 

The string
nonregularity of



Condition 3 is again crucial because without it we


, so
could pump if we let

The Pumping Lemma forRegular Languages p.27/39

Note

exhibits the essence of the

 

The string
nonregularity of



Condition 3 is again crucial because without it we


, so
could pump if we let

we fail because this string

If we chose, say
can be pumped

The Pumping Lemma forRegular Languages p.27/39

 


Show that

Example 4
is nonregular.

The Pumping Lemma forRegular Languages p.28/39

 


Show that

Example 4
is nonregular.

Proof by contradiction: Assume that

can be split,

where for all

Pumping lemma guarantees that

be its pumping length. Consider

is regular and let

The Pumping Lemma forRegular Languages p.28/39

Searching for a contradiction

The elements of are strings whose lengths are perfect


squares. Looking at first perfect squareswe observe that
they are: 0, 1, 4, 9, 25, 36, 49, 64, 81,

The Pumping Lemma forRegular Languages p.29/39

Searching for a contradiction

The elements of are strings whose lengths are perfect


squares. Looking at first perfect squareswe observe that
they are: 0, 1, 4, 9, 25, 36, 49, 64, 81,
Note the growing gap between these numbers: large members
cannot be near each other

The Pumping Lemma forRegular Languages p.29/39

Searching for a contradiction

The elements of are strings whose lengths are perfect


squares. Looking at first perfect squareswe observe that
they are: 0, 1, 4, 9, 25, 36, 49, 64, 81,

which differ from each other



Consider two strings


and
by a single repetition of .





Note the growing gap between these numbers: large members


cannot be near each other

The Pumping Lemma forRegular Languages p.29/39

Searching for a contradiction

The elements of are strings whose lengths are perfect


squares. Looking at first perfect squareswe observe that
they are: 0, 1, 4, 9, 25, 36, 49, 64, 81,

which differ from each other








Consider two strings


and
by a single repetition of .





Note the growing gap between these numbers: large members


cannot be near each other





If we chose very large the lengths of


and
cannot be
both perfect square because they are too close to each other.

The Pumping Lemma forRegular Languages p.29/39

Turning this idea into a proof




Calculate the value of that gives us the contradiction.

The Pumping Lemma forRegular Languages p.30/39

Turning this idea into a proof




Calculate the value of that gives us the contradiction.


, calculating the difference we obtain











If

The Pumping Lemma forRegular Languages p.30/39

Turning this idea into a proof




Calculate the value of that gives us the contradiction.


, calculating the difference we obtain





If

By pumping lemma
and
are both perfect
we can see that they
squares. But letting
,
cannot be both perfect square if
because they would be too close together.

The Pumping Lemma forRegular Languages p.30/39

Value of for contradiction




To calculate the value for that leads to contradiction we


observe that:

The Pumping Lemma forRegular Languages p.31/39

Value of for contradiction

To calculate the value for that leads to contradiction we


observe that:

The Pumping Lemma forRegular Languages p.31/39

Value of for contradiction

. Then

Let

To calculate the value for that leads to contradiction we


observe that:

The Pumping Lemma forRegular Languages p.31/39

Example 5
Sometimes pumping down" is useful when we apply
pumping lemma.

The Pumping Lemma forRegular Languages p.32/39

Example 5
Sometimes pumping down" is useful when we apply
pumping lemma.


We illustrate this using pumping lemma to prove that


is not regular

The Pumping Lemma forRegular Languages p.32/39

Example 5
Sometimes pumping down" is useful when we apply
pumping lemma.


We illustrate this using pumping lemma to prove that


is not regular
is

Proof: by contradiction using pumping lemma. Assume that


regular and its pumping length is .

The Pumping Lemma forRegular Languages p.32/39

Searching for a contradiction




; From decomposition
, from
it results that consists only of 0s.


 

Let
condition 3,

The Pumping Lemma forRegular Languages p.33/39

Searching for a contradiction




; From decomposition
, from
it results that consists only of 0s.

 

Let
condition 3,

Let us examine
to see if it is in . Adding an
extra-copy of increases the number of zeros. Since
contains all strings
that have more 0s than 1s, it
will still give a string in

The Pumping Lemma forRegular Languages p.33/39

Searching for a contradiction




; From decomposition
, from
it results that consists only of 0s.

 

Let
condition 3,

Let us examine
to see if it is in . Adding an
extra-copy of increases the number of zeros. Since
contains all strings
that have more 0s than 1s, it
will still give a string in

The Pumping Lemma forRegular Languages p.33/39

 

, consider

 

even when

and

Since

Try something else


.

The Pumping Lemma forRegular Languages p.34/39

 

, consider

 

even when

and

Since

Try something else


.

This decreases the number of 0s in .

The Pumping Lemma forRegular Languages p.34/39

 

, consider

 

even when

and

Since

Try something else

cannot have

cannot be in




and





Since has just one more 0 than 1 and


more 0s than 1s,

This decreases the number of 0s in .

The Pumping Lemma forRegular Languages p.34/39

 

, consider

 

even when

and

Since

Try something else

cannot have

cannot be in




and





Since has just one more 0 than 1 and


more 0s than 1s,

This decreases the number of 0s in .

This is the required contradiction

The Pumping Lemma forRegular Languages p.34/39

Minimum pumping length

The pumping lemma says that every regular language


has a pumping length , such that every string in the
language of length at least can be pumped.

The Pumping Lemma forRegular Languages p.35/39

Minimum pumping length

The pumping lemma says that every regular language


has a pumping length , such that every string in the
language of length at least can be pumped.

Hence, if is a pumping length for a regular language


so is any length
.

The Pumping Lemma forRegular Languages p.35/39

Minimum pumping length

The pumping lemma says that every regular language


has a pumping length , such that every string in the
language of length at least can be pumped.

The minimum pumping length for


that is a pumping length for .

is the smallest

Hence, if is a pumping length for a regular language


so is any length
.

The Pumping Lemma forRegular Languages p.35/39

Consider

 

Example
. The minimum pumping length for

is 2.

The Pumping Lemma forRegular Languages p.36/39

is 2.

and cannot be pumped. But any




where

can be pumped because for




and






. Hence, the minimum pumping length for

string



Reason: the string

. The minimum pumping length for




 

Consider

Example

is 2.

The Pumping Lemma forRegular Languages p.36/39

Find the minimum pumping length for the language

Problem 1
.

The Pumping Lemma forRegular Languages p.37/39




is 4.

cannot be pumped. Hence, 3 is not a




but

Reason:

Solution: The minimum pumping length for

Find the minimum pumping length for the language

Problem 1




and







. If





the division



pumping length for

can be pumped by

The Pumping Lemma forRegular Languages p.37/39

Find the minimum pumping length for the language

Problem 2
.

The Pumping Lemma forRegular Languages p.38/39




Solution: The minimum pumping length of

Find the minimum pumping length for the language

Problem 2
.

is 1.

The Pumping Lemma forRegular Languages p.38/39

is 1.

of

and



can be pumped by the division:




in the language but cannot be pumped. Every nonempty string




cannot be 0 because is

Reason: the minimum pumping length for

Solution: The minimum pumping length of

Find the minimum pumping length for the language

Problem 2

first character

the rest of .

The Pumping Lemma forRegular Languages p.38/39

Problem 3






Find the minimum pumping length for the language


.

The Pumping Lemma forRegular Languages p.39/39

Problem 3




Solution: The minimum pumping length for





Find the minimum pumping length for the language


.
is 3.

The Pumping Lemma forRegular Languages p.39/39

Problem 3

and

we can write is as

is the rest of the string.




we can write it as

is generated by

is the first symbol of , and






If

is generated by

of length at least 3. If

is in the

be a string in the language




language and it cannot be pumped. Let

Reason: The pumping length cannot be 2 because the string

is 3.





Solution: The minimum pumping length for





Find the minimum pumping length for the language


.

is the remainder of .

The Pumping Lemma forRegular Languages p.39/39

You might also like