CS 461 – Sept. 14
• Practice simplifying FA’s
• Section 1.4 – Pumping lemma
–
–
–
–
Purpose is to show that a language is not regular
Proof
Examples
Can also help to determine if a language is
finite/infinite.
Non-regular languages
• Means there is no such FA for language.
• They do exist! How can a language be nonregular?
– Not because language is too big, because the largest
possible language (0 + 1)* is regular.
– Non-regular means the “shape” of the language is
defective. It requires an infinite number of states.
Finite # of states can’t precisely define the language.
You’ll discover that a finite # of states winds up
defining something else.
finite
regular
Essential idea
The pumping lemma basically says this:
• If L is regular, you should be able take almost
any word in L, and repeat some of its characters
in order to produce longer words in L.
– Incidentally, you should also be able to take away
some of its characters to produce a shorter word.
– Degenerate case: finite sets.
– “Almost any word”? Some words are not interesting
like ε and 0.
Motivation
• Consider language { 0n1n }.
• Suppose it’s regular. Then there must be some
FA for it.
– How many states does it have? Let’s pick a number
like 95.
– Then, how would we process the word 097197? While
reading the 0s, we have to visit the same state twice!
In other words, we go back to a previous state, for
example from s80 s81 s82 s80, and then
continue on to accept state.
– There must be another word that leaves out the s81
and s82 steps, such as 094197, or does them
repeatedly. But those words are not in L!
Contradiction implies that L is not regular.
More generally…
• Suppose L is regular and M is FA recognizing it.
Let p = # of states.
• Consider a word s, |s| p. We take at least p
transitions, so we visit at least p+1 states. So,
we must visit some state twice while reading the
first p symbols! Suppose we call this state q.
• Let s = xyz, where x is part of string up to first
time we visit q, and y is the part of string
between our 2 visits.
• Other words of the form xyiz are also accepted
by M. In other words, we can loop as many
times as we want, even 0 times.
A litmus test
• The pumping lemma is a guaranteed property of
any regular language.
• Analogy…
– If it’s a duck, then it will quack.
– If it’s a cow, then it will moo.
• Contrapositive proves an imposter!
– If it doesn’t quack, it’s not a duck.
– If it doesn’t moo, it’s not a cow.
• However, can’t be used to prove regularity.
Pumping lemma
• See handout
– Formal statement (if it’s a duck…)
– Contrapositive used to show nonregularity
• If language is regular, then there is some part of
any word we can “pump.”
• If we have a language we suspect is nonregular, use contrapositive!
Proving non-regularity
• It’s like a 2-player game…
– Adversary picks secret number p.
– We select any string we want, in terms of p
(e.g. 0p1p)
– Adversary will break up s into xyz subject to
constraints.
• The place to pump has length at least 1.
• The place to pump appears in the first p positions.
– Be ready to show that xyiz won’t be in
language for some i.
© Copyright 2026 Paperzz