Title: The Pigeonhole Principle
1Section 7.4
2A Simple Idea
- If n pigeons fly into m pigeonholes and n gt m,
then some pigeonhole must have two or more
pigeons inside.
3Pigeonhole Principle (formally)
- A function from one finite set to a smaller
finite set cannot be one-to-one. There must be
at least two elements in the domain that have the
same image in the co-domain.
4Application of this Rule
- There are 78 people in this class. Must there be
two whose birthdays fall in the same month? - YES there are twelve months in a year, and
more people than months. - In the same week?
- YES there are 52 weeks in a year, and more
people than weeks. - On the same day?
- NO there are more days in the year than people
in the class.
5Finding the Number to Pick to Ensure a Result
- Suppose six similar-looking pairs of boots are
together in a big pile in a dark room. How many
boots must you pick to be sure of getting a
matched pair? - Answer You must pick seven boots to be sure of
getting a matched pair. - This ensures more boots than pairs, at which
point the pigeonhole principle tells us two boots
must be from the same pair.
6Application to Finite-State Automata
- It seems tempting to say that we can solve all
our problems with computers, bt that is simply
not true. - Our finite-state automata model is not as
sophisticated as a real computer, but even now we
can show there is a language not accepted by any
finite-state automaton.
7Finite vs. Infinite Sets
- A set is called finite if, and only if, it is the
empty set or there is a one-to-one
correspondence from 1, 2, , n to it, where n
is a positive integer. - In the first case, the number of elements in the
set is said to be 0, and in the second case it is
said to be n. - A set that is not finite is called infinite.
8Theorem Let L be the language over the alphabet
? a, b defined by L s??s akbk where k
? Z.There is no finite-state automaton that
accepts L.
- Proof By contradiction.
- Suppose that there is a finite-state automaton A
that accepts L. Since A has only a finite number
of states, they can be denoted s1, s2, , sn,
where n is a positive integer. - Consider all input strings that consist entirely
of as a, a2, a3, . - There are infinitely many such strings and only
finitely many states, so by the pigeonhole
principle, there is a state sm and strings a j
and ak such with j ? k such that when either a j
or ak is input, A goes to state sm.
9Theorem Let L be the language over the alphabet
? a, b defined by L s??s akbk where k
? Z.There is no finite-state automaton that
accepts L.
- By our definition of A, A accepts L, so it
accepts both the strings a jb j and akbk. Thus,
input of either j or k bs upon encountering
state sm will lead to an accept state. As
acceptance of L means that if a string is not in
L, it will not be accepted. - But this means that A accepts a jbk, which is not
in L because j ? k. This is a contradiction. - Therefore, our supposition is false, so there is
no finite-state automaton that accepts L.
10Theorem Let X and Y be finite sets with the same
number of elements and suppose f is a function
from X to Y. Then f is one-to-one if, and only
if, f is onto.
- Proof Suppose f is a function from X to Y, where
X and Y are finite sets each with k elements. - If f is one-to-one, then f is onto.
- Suppose f is one-to-one. Then f (x1), f (x2), f
(x3), , f (xk) are all different. - Consider the set S of elements of Y that are not
the image of any element of X. - The sets f (x1), f (x2), , f (xk), and S
are mutually disjoint. Therefore, - n(Y) n(f (x1)) n(f (x2)) n(f
(xk)) n(S)
11Theorem Let X and Y be finite sets with the same
number of elements and suppose f is a function
from X to Y. Then f is one-to-one if, and only
if, f is onto.
- n(Y) n(f (x1)) n(f (x2)) n(f
(xk)) n(S) - 1 1 1 n(S)
- k n(S)
- But n(Y) k, so n(S) k k 0. Thus S is
empty, so there is no element of Y that is not
the image of some element of X. - Therefore, f is onto.
12Theorem Let X and Y be finite sets with the same
number of elements and suppose f is a function
from X to Y. Then f is one-to-one if, and only
if, f is onto.
- If f is onto, then f is one-to-one.
- Suppose that f is onto. Then f -1(yi ) ? ? and
thus n(f -1(yi )) ? 1 for all i 1, 2, , k. - But X must be the union of the mutually disjoint
sets f -1(y1), f -1(y2), , f -1(yk). Therefore, - n(X) n(f -1(y1)) n(f -1(y2)) n(f
-1(yk)) - n(X) ? k.
- Now if any of the sets f -1(yi) has more than one
element, n(X) gt k. But we know this is not the
case because n(X) k. - Therefore, each set f -1(yi) has exactly one
element, so f is one-to-one. -
13Wednesdays class
- Turn in homework.
- New homework.
- Section 7.6 countability and uncountability