



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
The pigeon hole principle is a simple, yet extremely powerful proof principle. Informally it says that if n + 1 or more pigeons are.
Typology: Study notes
1 / 7
This page cannot be seen from the preview
Don't miss anything!
|A| > q 1 + q 2 + · · · + qn.
For any function f : A → B there is an i ∈ {1, 2,... n} such that |{a ∈ A | f (a) = bi}| > qi.
⋃^ n i= 1
Si
|I|+ 1
⋂ i∈I
Si
|A ∪ B| = |A| + |B| − |A ∩ B| |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| +|A ∩ B ∩ C|
The pigeon hole principle is a simple, yet extremely powerful proof principle. Informally it says that if n + 1 or more pigeons are placed in n holes, then some hole must have at least 2 pigeons. This is also known as the Dirichlet’s drawer principle or Dirichlet’s box principle after the mathematician Peter Gustav Dirichlet. Formally, we could restate it as follows.
Proposition 1 (Pigeon Hole Principle). If A and B are sets such that |A| > |B| then for any function f : A → B there are a, b ∈ A such that f (a) = f (b).
Proof. Observe that we have previously established that if f : A → B is injective then |A| ≤ |B|. The contrapositive of this is that if |A| > |B| then a function f : A → B is not injective. Or there must be two elements a, b ∈ A such that f (a) = f (b).
The pigeon hole principle is used to establish many different re- sults. For example, suppose you have a drawer with orange and blue colored socks, each of which can be worn on either foot, and you are pulling socks from the drawer without looking. How many socks do you need to pull before you are guaranteed to get a pair of the same color? Taking each sock to be a pigeon and the colors to be holes into which they are assigned, the pigeon hole principle guarantees that in any set of 3 socks there is a pair of the same color. While this is an extremely straightforward application of the pigeon hole prin- ciple, there are many non-trivial observations that follow from this principle.
Proposition 2. In any set S ⊆ Z with |S| = n, there are a, b ∈ S such that a − b is a multiple of n − 1 , i.e., (n − 1 )|(a − b).
Before proving the proposition, let us look at an example to under- stand what it is saying. Consider an example set of integers S that is (say) {4, 3, 1, 7, 8}. There are two elements, namely 4 and 8, such that 4 − 8 = −4 is a multiple of |S| − 1 = 5 − 1 = 4.
Proof of Proposition 2. Consider the function r : S → {0, 1, 2,... n − 2 } where r(a) = rem(a, n − 1 ), i.e., r maps an number a to the remainder when a is divided by n − 1. Since |S| = n > n − 1 = |{0, 1, 2... n − 2 }|, by the pigeon hole principle, there are a, b ∈ S such that r(a) = r(b). That is, rem(a, n − 1 ) = rem(b, n − 1 ). Therefore, a ≡ b mod (n − 1 ) or (n − 1 )|(a − b).
Problem 1. A chess player trains for a championship by playing practice games over 77 days. She plays at least one game on any day,
that one of the numbers in S is our desired number x, i.e., it leaves a remainder of a when divided by m and a remainder of b when divided by n. First observe that for any i, rem(a + im, m) = a. Thus, every num- ber in S leaves a remainder of a when divided by m. All that is left to show is that one of the numbers in S leaves a remainder of b when divided by n. Suppose (for contradiction), for all ∈ S, rem(
, n) 6 = b. Consider the function r : S → {0, 1, 2,... n − 1 } defined as r() = rem(
, n). Since (by assumption) b 6 ∈ rng(r), |rng(r)| ≤ n − 1. Observe that |S| = n. Thus, by the pigeon hole principle, there are i < j such that r(a + im) = rem(a + im, n) = rem(a + jm, n) = r(a + jm). This means that a + jm ≡ a + im mod n or n|((a + jm) − (a + im)). Simplifying we have, n|(j − i)m. Since m and n are coprime, it must be the case that n|(j − i). But this is impossible since 0 < j − i < n.
Applications of the Chinese Remainder Theorem
The Chinese Remainder theorem is an important result in number theory that has applications in computer science. Our statement of the theorem is weaker than what the proof en- tails. One can observe that the proof shows that, for m, n, a, b as given in the theorem, there is a unique number x < mn such that x ≡ a mod m and x ≡ b mod n. Therefore, one way to interpret the Chinese Remainder Theorem is that it says that the (large) number x can be represented by the pair of (small) numbers (a, b). Many number theoretic algorithms exploit this interpretation and use the “chinese remainder theorem representation” of numbers to compute large numbers.
The pigeon hole principle can be generalized as follows.
Proposition 4 (Generalized Pigeon Hole Principle). Let A be a set and B be an n-element set (say) {b 1 , b 2 ,... bn}. Let q 1 ,... qn ∈ N be such that |A| > q 1 + q 2 + · · · + qn. For any function f : A → B, there is an i ∈ {1, 2,... n} such that |{a ∈ A | f (a) = bi}| > qi.
Proof. For an element b ∈ B, let us define f −^1 (b) = {a ∈ A | f (a) = b}. Observe that since each element gets mapped to exactly one value in B, we have A ⊆ ∪ni= 1 f −^1 (bi) and for any j 6 = k, f −^1 (bj) ∩ f −^1 (bk) = ∅. We need to show that for some i, | f −^1 (bi)| > qi. Suppose (for contradiction) this is not true, i.e., for every i, | f −^1 (bi)| ≤ qi. Based on the observation in the previous paragraph, and using the sum rule,
we have
|A| ≤ | ∪ni= 1 f −^1 (bi)| =
n
i= 1
| f −^1 (bi)| ≤
n
i= 1
qi.
But this contradicts the assumption that |A| > (^) ∑ni= 1 qi.
Observe that the (simple) pigeon hole principle (Proposition 1 ) fol- lows from Proposition 4 — simply take each qi = 1. There is another special case of Proposition 4 that arises in many situations. If we take each qi to be some (fixed) number k, we see that Proposition 4 says that if the cardinality of the domain of a function f is greater than k times the cardinality of its co-domain, then there are at least k + 1 elements that are mapped to the same value by f. Since this form is very useful, we state it explicitly.
Proposition 5. If |A| > k|B| then for any function f : A → B there are k + 1 elements a 1 , a 2 ,... ak+ 1 ∈ A such that f (ai) = f (aj) for any i, j ∈ {1, 2,... k + 1 }.
We conclude our discussion on the pigeon hole principle by look- ing at some applications of the generalized pigeon hole principle.
Example 6. Suppose we draw cards from a standard 52 card deck. How many cards must we draw to ensure that we get 3 cards of one suit? How many cards must we draw if we instead want 3 cards of the hearts suit? The answer to these two questions is different and can be computed using the generalized pigeon hole principle. Let us consider the first question. Consider the function that maps each drawn card to its suit. The co-domain of this function has 4 elements. Taking each qi to be 2 in Proposition 4 , we see that if we draw more than 2 × 4 = 8 cards then we can ensure that there are 3 cards in one suit. Thus, we need to draw at least 9 cards. To answer the second question, once again consider the function that maps each drawn card to its suit. Since we may draw all 13 of the spades, all 13 of the diamonds, all 13 of the clubs, before we get the 3 hearts cards, we need to draw 13 + 13 + 13 + 3 = 42 cards to ensure that we get 3 cards of the hearts suit.
Problem 2. Two people will be said to be acquaintances if they have met before, and they will be said to be strangers if they have never met before. Prove that in any group of 6 people, there is either a group of 3 people who are mutual acquantainces (i.e., any two in this group of 3 have met before) or there is a group of 3 mutual strangers (i.e., no two in this group of 3 have met before).
Proof. Let a be one of the 6 people. Let K denote the set of people a has met (among the other 5 people) and let S be the set of people a
This means that |B \ A| = |B| − |A ∩ B|. Putting it all together, we have |A ∪ B| = |A| + |B \ A| = |A| + |B| − |A ∩ B|.
For 3 sets A, B, C, we can generalize Proposition 7 to get
|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.
We leave the proof of this result as an exercise for the reader. In gen- eral, the principle of inclusion-exclusion says that the cardinality of the union of n sets is the sum of the cardinalities of the individual sets, minus the cardinality of their pairwise intersection, plus the cardinality of their 3 -way intersections, and so on, with the plus and minus signs alternating with intersections of larger number of sets. Or informally,
1 ≤i≤n
1 ≤i<j≤n
1 ≤i<j<k≤n
|Si ∩ Sj ∩ Sk| · · ·
This is stated fomally below.
Theorem 8 (Principle of Inclusion-Exclusion). For any sets S 1 , S 2 ,... Sn, ∣∣ ∣∣ ∣
⋃^ n i= 1
Si
|I|+ 1
⋂ i∈I
Si
Theorem 8 can be proved by induction using Proposition 7 to establish the base case and to carry out the induction step. We skip the proof here. Let us conclude our discussion by using Theorem 8 to prove a result.
Example 9. How many integers between 1 and 100 are multiples of either 2 or 3? We will Proposition 7 to establish this result. Let us define a couple of sets.
A 2 = { 1 ≤ i ≤ 100 | 2 |i} A 3 = { 1 ≤ i ≤ 100 | 3 |i}
Observe that we need to compute |A 2 ∪ A 3 |. We will use the principle of inclusion-exclusion for this. We know,
|A 2 | =
(^1) Notice that 1 For a real number r ∈ R , brc is largest integer that is ≤ r. On the other hand, A 2 ∩ A 3 = { 1 ≤ i ≤ 100 | 6 |i}. dre is the smallest integer ≥ r.
That is, A 2 ∩ A 3 is the set of all numbers that are multiples of 6. Thus, |A 2 ∩ A 3 | = b 1006 c = 16. Thus, by the principle of inclusion-exclusion,
|A 2 ∪ A 3 | = |A 2 | + |A 3 | − |A 2 ∩ A 3 | = 50 + 33 − 16 = 67.