The Pumping Lemma for Regular Languages
The Pumping Lemma forRegular Languages – p.1/39
The Pumping Lemma for Regular Languages The Pumping Lemma - - PowerPoint PPT Presentation
The Pumping Lemma for Regular Languages The Pumping Lemma forRegular Languages p.1/39 Nonregular languages Consider the language . The Pumping Lemma forRegular Languages
The Pumping Lemma forRegular Languages – p.1/39
The Pumping Lemma forRegular Languages – p.2/39
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
we discover that such a machine needs to remember how many
✂s have been seen so far as it reads the input
s isn’t limited, the machine needs to keep track of an unlimited number of possibilities
The Pumping Lemma forRegular Languages – p.2/39
we discover that such a machine needs to remember how many
✂s have been seen so far as it reads the input
s isn’t limited, the machine needs to keep track of an unlimited number of possibilities
The Pumping Lemma forRegular Languages – p.2/39
The Pumping Lemma forRegular Languages – p.3/39
The Pumping Lemma forRegular Languages – p.3/39
has an equal number of 0s and 1s
✝The Pumping Lemma forRegular Languages – p.3/39
has an equal number of 0s and 1s
✝not regular
The Pumping Lemma forRegular Languages – p.3/39
has an equal number of 0s and 1s
✝not regular
has equal no of 01 and 10 substrings
✝The Pumping Lemma forRegular Languages – p.3/39
has an equal number of 0s and 1s
✝not regular
has equal no of 01 and 10 substrings
✝regular
The Pumping Lemma forRegular Languages – p.3/39
The Pumping Lemma forRegular Languages – p.4/39
The Pumping Lemma forRegular Languages – p.4/39
The Pumping Lemma forRegular Languages – p.4/39
The Pumping Lemma forRegular Languages – p.5/39
The Pumping Lemma forRegular Languages – p.5/39
The Pumping Lemma forRegular Languages – p.5/39
The Pumping Lemma forRegular Languages – p.6/39
The Pumping Lemma forRegular Languages – p.6/39
The Pumping Lemma forRegular Languages – p.7/39
The Pumping Lemma forRegular Languages – p.7/39
The Pumping Lemma forRegular Languages – p.7/39
,
✂✄ ☎ ✆ ✝ ✞The Pumping Lemma forRegular Languages – p.7/39
,
✂✄ ☎ ✆ ✝ ✞2.
✆ ✄ ✆The Pumping Lemma forRegular Languages – p.7/39
,
✂✄ ☎ ✆ ✝ ✞2.
✆ ✄ ✆3.
✆ ✂ ✄ ✆The Pumping Lemma forRegular Languages – p.7/39
The Pumping Lemma forRegular Languages – p.8/39
The Pumping Lemma forRegular Languages – p.8/39
The Pumping Lemma forRegular Languages – p.8/39
to be the number of states of
to be the number of states of
,
✆may be broken into three pieces
✂ ✄ ✆satisfying the pumping lemma’s conditions
The Pumping Lemma forRegular Languages – p.9/39
The Pumping Lemma forRegular Languages – p.10/39
The Pumping Lemma forRegular Languages – p.10/39
The Pumping Lemma forRegular Languages – p.10/39
The Pumping Lemma forRegular Languages – p.10/39
hold more than one pigeon
The Pumping Lemma forRegular Languages – p.10/39
hold more than one pigeon
The Pumping Lemma forRegular Languages – p.10/39
The Pumping Lemma forRegular Languages – p.11/39
The Pumping Lemma forRegular Languages – p.12/39
is the part of
The Pumping Lemma forRegular Languages – p.12/39
is the part of
is the part of
is the part of
is the part of
is the part of
is the part of
is the part of
is the part of
The Pumping Lemma forRegular Languages – p.12/39
is the part of
is the part of
is the part of
takes
to
✁The Pumping Lemma forRegular Languages – p.12/39
is the part of
is the part of
is the part of
takes
to
✁takes
The Pumping Lemma forRegular Languages – p.12/39
is the part of
is the part of
is the part of
takes
to
✁takes
takes
The Pumping Lemma forRegular Languages – p.12/39
The Pumping Lemma forRegular Languages – p.13/39
The Pumping Lemma forRegular Languages – p.14/39
,
✂✄ ✄ ✆, and in general
✂✄ ☎ ✆for all
. For
,
✂ ✄ ☎ ✆ ✁ ✂ ✆which is also accepted because
✆takes
The Pumping Lemma forRegular Languages – p.14/39
,
✂✄ ✄ ✆, and in general
✂✄ ☎ ✆for all
. For
,
✂ ✄ ☎ ✆ ✁ ✂ ✆which is also accepted because
✆takes
, state
✁is the part between two successive occurrences of
✁.
The Pumping Lemma forRegular Languages – p.14/39
,
✂✄ ✄ ✆, and in general
✂✄ ☎ ✆for all
. For
,
✂ ✄ ☎ ✆ ✁ ✂ ✆which is also accepted because
✆takes
, state
✁is the part between two successive occurrences of
✁.
states in the sequence must contain a repetition. Therefore,
✆ ✂✄ ✆The Pumping Lemma forRegular Languages – p.14/39
The Pumping Lemma forRegular Languages – p.15/39
and among the first
✁elements in
✁ ✂ ☎ ✁ ✞ ☎ ✠ ✠ ✠ ☎ ✁✄✂ ☎ ✂two must be the same state, say
✁✝✆ ✁ ✁ ✞.
The Pumping Lemma forRegular Languages – p.15/39
and among the first
✁elements in
✁ ✂ ☎ ✁ ✞ ☎ ✠ ✠ ✠ ☎ ✁✄✂ ☎ ✂two must be the same state, say
✁✝✆ ✁ ✁ ✞.
places in the sequence starting at
✁ ✂, we have
The Pumping Lemma forRegular Languages – p.15/39
and among the first
✁elements in
✁ ✂ ☎ ✁ ✞ ☎ ✠ ✠ ✠ ☎ ✁✄✂ ☎ ✂two must be the same state, say
✁✝✆ ✁ ✁ ✞.
places in the sequence starting at
✁ ✂, we have
,
✄ ✁,
✆ ✁.
The Pumping Lemma forRegular Languages – p.15/39
takes
to
✁ ✆,
✄takes
to
✁ ✆, and
✆takes
to
✁ ✂ ☎ ✂, which is an accept state,
, for
The Pumping Lemma forRegular Languages – p.16/39
takes
to
✁ ✆,
✄takes
to
✁ ✆, and
✆takes
to
✁ ✂ ☎ ✂, which is an accept state,
, for
;
The Pumping Lemma forRegular Languages – p.16/39
takes
to
✁ ✆,
✄takes
to
✁ ✆, and
✆takes
to
✁ ✂ ☎ ✂, which is an accept state,
, for
;
, so
✆ ✂✄ ✆The Pumping Lemma forRegular Languages – p.16/39
takes
to
✁ ✆,
✄takes
to
✁ ✆, and
✆takes
to
✁ ✂ ☎ ✂, which is an accept state,
, for
;
, so
✆ ✂✄ ✆The Pumping Lemma forRegular Languages – p.16/39
The Pumping Lemma forRegular Languages – p.17/39
The Pumping Lemma forRegular Languages – p.17/39
Note: if only some elements of
mean that
The Pumping Lemma forRegular Languages – p.17/39
The Pumping Lemma forRegular Languages – p.18/39
is regular in order to obtain a contradiction
The Pumping Lemma forRegular Languages – p.18/39
is regular in order to obtain a contradiction
length
✁s.t. all strings of length
✁can be pumped
The Pumping Lemma forRegular Languages – p.18/39
is regular in order to obtain a contradiction
length
✁s.t. all strings of length
✁can be pumped
,
✆, that cannot be pumped: demonstrate that
,
✄,
✆, showing that for each division one of the pumping lemma conditions, (1)
✂✄ ☎ ✆ ✝ ✞, (2)
✆ ✄ ✆, (3)
✆ ✂✄ ✆, fails.
The Pumping Lemma forRegular Languages – p.18/39
The Pumping Lemma forRegular Languages – p.19/39
The Pumping Lemma forRegular Languages – p.19/39
The Pumping Lemma forRegular Languages – p.20/39
The Pumping Lemma forRegular Languages – p.21/39
1.
✄consists of
✂s only. In this case
✂ ✄ ✄ ✆has more
✂s than
✁s and so it is not in
✁, violating condition 1
The Pumping Lemma forRegular Languages – p.21/39
1.
✄consists of
✂s only. In this case
✂ ✄ ✄ ✆has more
✂s than
✁s and so it is not in
✁, violating condition 1 2.
✄consists of
✁s only. This leads to the same contradiction
The Pumping Lemma forRegular Languages – p.21/39
1.
✄consists of
✂s only. In this case
✂ ✄ ✄ ✆has more
✂s than
✁s and so it is not in
✁, violating condition 1 2.
✄consists of
✁s only. This leads to the same contradiction 3.
✄consists of
✂s and
✁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
The Pumping Lemma forRegular Languages – p.21/39
1.
✄consists of
✂s only. In this case
✂ ✄ ✄ ✆has more
✂s than
✁s and so it is not in
✁, violating condition 1 2.
✄consists of
✁s only. This leads to the same contradiction 3.
✄consists of
✂s and
✁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
The Pumping Lemma forRegular Languages – p.21/39
The Pumping Lemma forRegular Languages – p.22/39
The Pumping Lemma forRegular Languages – p.22/39
The Pumping Lemma forRegular Languages – p.23/39
, and in our case
✂✄ ✁ ✂. Hence,
✂The Pumping Lemma forRegular Languages – p.23/39
, and in our case
✂✄ ✁ ✂. Hence,
✂then
✄must consists of only
✁s, so
✂ ✄ ✄ ✆ ✁ ✝there are more 1-s than 0-s.
The Pumping Lemma forRegular Languages – p.23/39
, and in our case
✂✄ ✁ ✂. Hence,
✂then
✄must consists of only
✁s, so
✂ ✄ ✄ ✆ ✁ ✝there are more 1-s than 0-s.
The Pumping Lemma forRegular Languages – p.23/39
The Pumping Lemma forRegular Languages – p.24/39
The Pumping Lemma forRegular Languages – p.25/39
would also be regular because
✂ ✁ ✁ ✁is regular and
The Pumping Lemma forRegular Languages – p.25/39
would also be regular because
✂ ✁ ✁ ✁is regular and
which is not regular.
The Pumping Lemma forRegular Languages – p.25/39
would also be regular because
✂ ✁ ✁ ✁is regular and
which is not regular.
The Pumping Lemma forRegular Languages – p.25/39
The Pumping Lemma forRegular Languages – p.26/39
The Pumping Lemma forRegular Languages – p.26/39
The Pumping Lemma forRegular Languages – p.27/39
The Pumping Lemma forRegular Languages – p.27/39
The Pumping Lemma forRegular Languages – p.27/39
The Pumping Lemma forRegular Languages – p.28/39
The Pumping Lemma forRegular Languages – p.29/39
cannot be near each other
The Pumping Lemma forRegular Languages – p.29/39
cannot be near each other
and
✂ ✄ ☎ ☎ ✂ ✆which differ from each other by a single repetition of
✄.
The Pumping Lemma forRegular Languages – p.29/39
cannot be near each other
and
✂ ✄ ☎ ☎ ✂ ✆which differ from each other by a single repetition of
✄.
and
✂✄ ☎ ☎ ✂ ✆cannot be both perfect square because they are too close to each other.
The Pumping Lemma forRegular Languages – p.29/39
The Pumping Lemma forRegular Languages – p.30/39
The Pumping Lemma forRegular Languages – p.30/39
The Pumping Lemma forRegular Languages – p.30/39
The Pumping Lemma forRegular Languages – p.31/39
The Pumping Lemma forRegular Languages – p.31/39
The Pumping Lemma forRegular Languages – p.32/39
is not regular
The Pumping Lemma forRegular Languages – p.32/39
is not regular
regular and its pumping length is
✁.
The Pumping Lemma forRegular Languages – p.32/39
The Pumping Lemma forRegular Languages – p.33/39
The Pumping Lemma forRegular Languages – p.34/39
The Pumping Lemma forRegular Languages – p.34/39
(
✂✄ ✆ ✁ ✂)
The Pumping Lemma forRegular Languages – p.34/39
(
✂✄ ✆ ✁ ✂)
The Pumping Lemma forRegular Languages – p.34/39
The Pumping Lemma forRegular Languages – p.35/39
The Pumping Lemma forRegular Languages – p.35/39
The Pumping Lemma forRegular Languages – p.35/39
The Pumping Lemma forRegular Languages – p.36/39
Reason: the string
,
✆and
string
,
✆where
✂ ✁ ✂,
✄ ✁ ✁,
✆ ✁ ✁and
✂✄ ☎ ✆ ✝ ✞. Hence, the minimum pumping length for
✞is 2.
The Pumping Lemma forRegular Languages – p.36/39
The Pumping Lemma forRegular Languages – p.37/39
Solution: The minimum pumping length for
✂ ✂ ✂ ✁ ✁is 4. Reason:
✂ ✂ ✂ ✝ ✂ ✂ ✂ ✁ ✁but
✂ ✂ ✂cannot be pumped. Hence, 3 is not a pumping length for
✂ ✂ ✂ ✁ ✁. If
and
✆the division
,
✂ ✁ ✂ ✂ ✂,
✄ ✁ ✁,
✆ ✁ ✁.
The Pumping Lemma forRegular Languages – p.37/39
The Pumping Lemma forRegular Languages – p.38/39
Solution: The minimum pumping length of
✂ ✁ ✁ ✁is 1.
The Pumping Lemma forRegular Languages – p.38/39
Solution: The minimum pumping length of
✂ ✁ ✁ ✁is 1. Reason: the minimum pumping length for
✂ ✁ ✁ ✁cannot be 0 because
in the language but cannot be pumped. Every nonempty string
,
✆can be pumped by the division:
,
✂ ✁first character
the rest of
The Pumping Lemma forRegular Languages – p.38/39
The Pumping Lemma forRegular Languages – p.39/39
Solution: The minimum pumping length for
✂ ✁ ✁ ☎ ✂ ☎ ✁ ✁is 3.
The Pumping Lemma forRegular Languages – p.39/39
Solution: The minimum pumping length for
✂ ✁ ✁ ☎ ✂ ☎ ✁ ✁is 3. Reason: The pumping length cannot be 2 because the string
✁ ✁is in the language and it cannot be pumped. Let
we can write is as
,
✂ ✁is the first symbol of
is the rest of the string. If
we can write it as
,
✂ ✁ ✁,
✄ ✁ ✂and
✆is the remainder of
The Pumping Lemma forRegular Languages – p.39/39