Loading [MathJax]/jax/output/HTML-CSS/jax.js
Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

20.5: Pigeonhole Principle

( \newcommand{\kernel}{\mathrm{null}\,}\)

Theorem 20.5.1: Pigeonhole Principle (formal version).

If A,B are finite sets with |B|<|A|, then no function AB can be an injection.

Proof.

This principle is just the contrapositive of Statement 2 of Fact 12.2.3.

Corollary 20.5.1: Pigeonhole Principle.

If m objects are placed in n containers, where m>n, then at least one container must contain more than one object.

Proof.

Let A be the set of objects and B the set of containers, so that

|B|=n<m=|A|.
Also let f:AB represent the function where f(a)=b means that object a has been placed in container b. Then the Theorem 20.5.1 tells us that f cannot be an injection, which means that there is at least one pair of distinct objects a1,a2 with f(a1)=f(a2).

Example 20.5.1: Too few seats.

Your car has five seats, but you also have five friends who need a ride home. How will everyone fit?

Solution

Using the people who need to get home (i.e. your friends and you) as objects and car seats as containers, Pigeonhole Principle says that someone will have to sit on someone else's lap.

Example 20.5.2: Dessert logistics.

The cafeteria puts out 200 chocolate puddings and 200 tapioca puddings. If 201 students each grab a bowl of pudding, what is the minimum number of tapioca puddings that have been taken?

Solution

Since 201>200, there is no injection

{students who took a pudding}{bowls of chocolate pudding}.
(Or: use students as objects, bowls of chocolate pudding as containers.)

But we can't actually have two students take the same bowl of pudding, so at least one student must eat tapioca.

Example 20.5.3: Matching pairs.

Suppose A{1,2,,20}. How big must |A| be to ensure that there exist two elements of A whose sum is 21?

Solution

Collect together the (unordered) pairs of numbers that add to 21:

B={{1,20},{2,19},,{10,11}}P({1,2,,20}).
Notice that |B|=10. Thinking of the elements of B as containers and elements of A as objects, place object a into container b if ab. We need one more object than container to ensure some container receives two objects, so the answer is |A|11.

Example 20.5.4: Matching modulo m.

Suppose mN and AN such that 0<m<|A|<. Show that there exist distinct a1,a2A that have the same remainder when divided by m.

Solution

The set of possible remainders is N<m={0,1,2,,m1}. Computing remainder after division by m defines a function AN<m. Since |N<m|=m<|A|, this function cannot be an injection.

(Or: use elements of A as objects, possible remainders when dividing a number by m as containers.)

Strong version

Recall that given a function f:AB, we can define an equivalence relation on A by taking a1a2 to mean f(a1)=f(a2) (see Example 18.4.4). In this way, we can regard f as placing objects (elements of A) into containers (elements of B), so that object aA is “placed” in container bB when f(a)=b.

Theorem 20.5.3: Pigeonhole Principle (strong form, formal version).

Suppose f:AB, with A,B finite, and let be the equivalence relation on A where a1a2 means f(a1)=f(a2).

If |A|>|B| for some N, then at least one of the equivalence classes of A with respect to has more than elements.

Proof.

Consider the contrapositive:

if every equivalence class of A has no more than elements, then |A||B|.

Since B is finite and f(A)B, then also f(A) is finite and we can enumerate its elements. Write f(A)={b1,b2,,bn}. Each element of f(A) corresponds to an equivalence class of A.

clipboard_eef84bc96c87b5fc418568d2a619f9320.png
Figure 20.5.1: Diagram of equivalence classes under the “have same image” equivalence.

In this diagram, the ai are representative elements of the class of elements of A that are mapped to bi by f. In particular, we must have f(ai)=bi for each index i.

We are assuming that each class [ai] contains no more than elements; i.e. |[ai]|. Since an equivalence relation always partitions a set A into the disjoint union of its equivalence classes, we have

|A|=|[a1]|+|[a2]|++|[an]|+++r terms=n=|f(A)|.
But f(A) is a subset of the finite set B, and so |f(A)||B|. Combining this with the calculation above gives

|A||f(A)||B|.

Corollary 20.5.2: Pigeonhole Principle (strong form, informal version).

If m objects are placed in n containers, with m>n for some N, then at least one container contains more than objects.

Proof Idea.

Again, let A be the set of objects and B the set of containers, so that

|A|=m>n=|B|.
Then apply the Pigeonhole Principle (strong form, formal version).

Note 20.5.1

The Pigeonhole Principle (strong form, formal version) is a generalization of the Pigeonhole Principle (formal version). A function is an injection precisely when no two distinct elements of the domain produce the same output image, so using =1 in the strong form gives back the original form.

Example 20.5.5: Handing out coins.

Show that if thirteen coins are distributed to six children, then at least one child will receive at least three coins.

Solution

Using coins as objects and children as containers, the given statement is just the Pigeonhole Principle (strong form, formal version) with =2: we have 13 objects and 6 containers, and 13>26. (Note: Since coins are discrete objects, “more than two” and “at least three” are the same thing.)

Remark 20.5.1

It is worthwhile to think about how the strong form of the Pigeonhole Principle could be proved directly. Consider the diagram in Figure 20.5.1: the “tipping point” between |A||B| and |A|>|B| is when f is surjective and each of the equivalence classes has exactly elements. When f is surjective, there are |B| equivalence classes in A. Since A is the disjoint union of its equivalence classes under , we have |A|=|B|. If we add one more element to A, it will have to be included in one of the equivalence classes, and that class will now have size greater than .

Example 20.5.6: Handing out pudding.

The cafeteria puts out 100 chocolate, 100 tapioca, and 100 butterscotch puddings. How many students must grab a pudding before we can be certain that at least one of the flavours has at least half of the bowls taken?

Solution. 1 Using “tipping point” thinking
The “tipping point” is exactly 49 bowls of each flavour taken, which requires 349=147 students. After the 148th student, we will definitely have 50 bowls of one of the flavours taken.

Solution. 2 Direct use of the Pigeonhole Principle
Consider students as objects (m of them — this is the unknown to be determined) and flavours as containers (3 of them). To determine the appropriate value of to use, consider that “at least half” in this problem means “at least 50”, which is the same as “more than 49”. So choose =49. In that case, we need m>493=147, bringing us to the answer of m=147+1=148 students. 


This page titled 20.5: Pigeonhole Principle is shared under a GNU Free Documentation License 1.3 license and was authored, remixed, and/or curated by Jeremy Sylvestre via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?