CS103
HO#32
SlidesThe Pumping Lemma
4/27/11
1
More on Regular Expressions
All strings over the alphabet {a, b} that have at least 2 a's
(some beginning) (1
st
impt. a) (some middle) (2
nd
impt. a) (some ending)
(a
b)* a (a
b)* a (a
b)*
More on Regular Expressions
All strings over the alphabet {a, b} that have at least 2 a's
(some beginning) (1
st
impt. a) (some middle) (2
nd
impt. a) (some ending)
(a
b)* a (a
b)* a (a
b)*
(some b's) (1
st
a) (some b's) (2
nd
a) (some ending)
b*ab*a (a
b)*
(a
b)*ab*ab*
b*a(a
b)*ab*
Kleene's Theorem
Theorem 1.54
: A language is regular if and only if some regular
expression describes it.
Lemma 1.55
: If a language is described by a regular expression,
then it is regular.
Lemma 1.60
: If a language is regular, then it is described by
a regular expression.
NonRegular Languages
q
1
q
2
q
3
q
4
q
5
a
a
a
a
a
b
b
b
b
b
b
b
b
b
b
a,b
Suppose we want to recognize
B = { a
n
b
n
 n
0 }
q
0
q
12
q
13
q
14
q
15
q
9
q
10
q
11
q
7
q
8
q
6
NonRegular Languages
We will show that regular languages have a particular property.
To show that a language L is
not
regular:
Assume that L is regular.
Thus it has the property.
Derive a contradiction.
Thus L is not regular.
Note that this approach is only useful in proving that L is
not
regular.
Having the property doesn't guarantee that a language
is
regular.
Long Strings Force Repeated States
Suppose M = (Q,
,
, q
1
, F).
Suppose s is a string of length at least Q that is accepted by M.
Then M must visit some state more that once when s is the input.
PROOF:
M starts in some state, and each time it reads a character,
it visits some state.
So if s = Q, M will visit Q + 1 states (the initial
one plus one for each character in s).
Since there more visits than states, the
pigeonhole principle
tells us
that at least one state is visited more than once.
This will be true
for any accepted string s such that s
Q.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentCS103
HO#32
SlidesThe Pumping Lemma
4/27/11
2
b
a
a
c
b
d
a
(Assume transitions not shown in this DFA lead to the accepting state.)
What is the longest string M can accept without repeating a state?
Any accepted string of 6 or more symbols must contain
cd
one or more times.
L(M) = ba(cd)*(ca
a)b
… strings for missing transitions
Examples:
baab
bacab
ba
cd
ab
ba
cdcdcd
ab
ba
cdcdcdcd
cab
M
The Pumping Lemma
If A is a regular language, then there is a number p (the pumping length)
such that, if s is any string in A of length at least p, then s may be divided
into three pieces, s = xyz satisfying the following three conditions:
1.
for each i
0, xy
i
z
A,
2. y > 0, and
3. xy
p.
Note that x or z may be
, but y may not.
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '11
 PLUMMER
 Formal language, Formal languages, Regular expression, Regular language, regular languages

Click to edit the document details