Difference between revisions of "Pigeonhole Principle"
Etmetalakret (talk | contribs) |
Italianzebra (talk | contribs) (→Example 4) |
||
(15 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | In [[combinatorics]], the '''pigeonhole principle''' states that if <math>n+1</math> or more pigeons are placed into <math>n</math> holes, one hole must contain two or more pigeons. This seemingly trivial statement may be used with remarkable creativity to generate striking counting arguments | + | In [[combinatorics]], the '''pigeonhole principle''' states that if <math>n+1</math> or more pigeons are placed into <math>n</math> holes, one hole must contain two or more pigeons. This seemingly trivial statement may be used with remarkable creativity to generate striking counting arguments, especially in Olympiad settings. |
− | In older texts, the principle may be referred to as the '''Dirichlet box principle'''. A | + | In older texts, the principle may be referred to as the '''Dirichlet box principle'''. A common phrasing of the principle uses balls and boxes and is that if <math>n</math> balls are to be placed in <math>k</math> boxes and <math>n>k</math>, then at least one box must contain more than one ball. |
== Proof == | == Proof == | ||
− | + | An intuitive proof of the pigeonhole principle is as follows: suppose for contradiction that there exists a way to place <math>n</math> balls into <math>k</math> boxes where <math>n>k</math> such that all boxes contain at most one ball. | |
− | Let <math>b_1, b_2, \ldots, b_k</math> how many balls each box contains. Our condition that all boxes contain at most one ball implies that <math>b_r \leq 1</math> for all <math>1 \leq r \leq n</math>, so <cmath>b_1 + b_1 + \cdots + b_n \geq n.</cmath> However, we know that there are a total of <math>k</math> balls across all our boxes, so this sum must equal <math>k</math>: <cmath>b_1 + b_1 + \cdots + b_n = k.</cmath> Therefore, <math>k \geq n</math>. This contradicts our | + | Let <math>b_1, b_2, \ldots, b_k</math> how many balls each box contains. Our condition that all boxes contain at most one ball implies that <math>b_r \leq 1</math> for all <math>1 \leq r \leq n</math>, so <cmath>b_1 + b_1 + \cdots + b_n \geq n.</cmath> However, we know that there are a total of <math>k</math> balls across all our boxes, so this sum must equal <math>k</math>: <cmath>b_1 + b_1 + \cdots + b_n = k.</cmath> Therefore, <math>k \geq n</math>. This contradicts our definition that <math>n>k</math>. Therefore, our assumption must be incorrect; at least one box must contain two or more balls. <math>\square</math> |
− | In formal terms, the pigeonhole principle is a consequence of how | + | In formal terms, the pigeonhole principle is a consequence of how one set is ''defined'' to be larger than another set. |
− | Let <math>N</math> be a set of <math>n</math> balls and <math>K</math> be a set of <math>k</math> boxes such that <math>n>k</math> | + | Let <math>N</math> be a set of <math>n</math> balls and <math>K</math> be a set of <math>k</math> boxes such that <math>n>k</math>. The definition that <math>|N| > |K|</math> (as in our problem) is that there exists a surjective mapping from <math>N</math> to <math>K</math>, but not an injection. In other words, there exists a way to map every ball of <math>N</math> to every box of <math>K</math>, but it does ''not'' hold that if the boxes of two balls are the same, then the balls must be the same. That is to say, there must be two or more balls in the same box—which is the pigeonhole principle. |
− | == Examples == | + | == Introductory Examples == |
− | === | + | === Example 1 === |
+ | ''If a Martian has an infinite number of red, blue, yellow, and black socks in a drawer, what is the minimum number of socks that the Martian must pull out of the drawer to guarantee they have a pair?'' | ||
− | + | '''Solution''': Intuitively, you might realize that after we select four socks of different colors (one red, one blue, one yellow, and one black), the Martian can't select a fifth sock without creating a pair. We may use this to prove the problem: | |
− | |||
− | + | Note that the Martian may select <math>4</math> socks without a pair: one red, one blue, one yellow, and one black sock. However, if the Martian selects <math>5</math> socks from <math>4</math> colors, the pigeonhole principle guarantees that <math>2</math> socks must have the same color (where the <math>5</math> socks are "pigeons" and the <math>4</math> colors are "holes"). Therefore, <math>5</math> is the minimum number of socks they must draw to guarantee a pair. <math>\square</math> | |
− | |||
− | |||
− | |||
− | === Olympiad Problems | + | === Example 2 === |
+ | ''Let <math>S = {1, 2, 3, \ldots, 2n}</math>. Show that if we choose <math>n+1</math> numbers from <math>S</math>, then there exist two numbers such that one is a multiple of the other. | ||
+ | |||
+ | '''Solution''': | ||
+ | |||
+ | We write each number as <math>2^ab</math> for some integers <math>a</math> and <math>b</math>, where <math>a</math> is nonnegative and <math>b</math> is odd (<math>b</math> can also be <math>1</math>). Because we select <math>n+1</math> integers and there are <math>n</math> possible values of <math>b</math>, Pigeonhole Principle guarantees that two numbers will share the same <math>b</math> value. These numbers are multiples—if we define the two numbers <math>2^ib</math> and <math>2^jb</math> where <math>i>j</math>, we may multiply <math>2^jb</math> by <math>2^{i-j}</math> to get <math>2^ib</math>, as desired. <math>\square</math> | ||
+ | |||
+ | === Example 3 === | ||
+ | ''Suppose <math>S</math> is a set of <math>n + 1</math> integers. Prove that there exists distinct <math>a, b</math> in <math>S</math> such that <math>a - b</math> is a multiple of <math>n</math>.'' | ||
+ | |||
+ | '''Solution''': Note that for any such <math>a</math> and <math>b</math>, <cmath>n | (a - b).</cmath> We may rewrite this in [[modular arithmetic]] as <math> a - b \equiv 0 \textrm{ } (\textrm{mod }n)</math>, or <cmath>a \equiv b \textrm{ } (\textrm{mod }n).</cmath> Therefore, we wish to show that there exist <math>a</math> and <math>b</math> with the same remainder modulo n. Note that there are <math>n+1</math> integers in <math>S</math> and <math>n</math> possible remainders (namely, <math>0, 1, \ldots, n-1</math>) modulo <math>n</math>. Then by the pigeonhole principle, there exist two integers with the same remainder modulo <math>n</math>. As shown earlier, this implies that their difference is a multiple of <math>n</math>, as required. <math>\square</math> | ||
+ | |||
+ | === Example 4 === | ||
+ | ''Show that in any group of <math>n</math> people, there are two who have an identical number of friends within the group.'' | ||
+ | |||
+ | '''Solution''': Note that for any person from the group, the minimum number of in-group friends they can have is <math>0</math> (nobody) and the maximum is <math>n-1</math> (everybody but themselves). Hence, there are <math>n</math> possible values for an individual's number of in-group friends. | ||
+ | |||
+ | However, note that if a person has <math>0</math> in-group friends, nobody else can be friends with all other <math>n-1</math> individuals; vice-versa if an individual has <math>n-1</math> friends. ''There cannot exist two individuals with <math>0</math> and <math>n-1</math> friends''. Therefore, there are only <math>n-1</math> possible values of an individual's number of in-group friends. | ||
+ | |||
+ | Then because there are <math>n</math> individuals and <math>n-1</math> possible values of in-group friends, the Pigeonhole Principle guarantees that two individuals have the same number of friends within the group. <math>\square</math> | ||
+ | |||
+ | == Intermediate Examples == | ||
+ | === Example 1: Rational Approximation Theorem === | ||
+ | ''Show that for any irrational number <math>x</math> and positive integer <math>n</math>, there exists a rational number <math>\frac{p}{q}</math> with <math>1 \leq q \leq n</math> such that <math>|x - \frac{p}{q}| < \frac{1}{nq}</math>.'' | ||
+ | |||
+ | '''Solution''': Take a moment to digest the question; in short, our task is to ''prove the existence of a rational number'' close to our irrational <math>x</math>. In particular, <math>n</math> is almost like a "confidence level"—where a higher <math>n</math> increases the denominator <math>q</math> and decreases the distance between <math>x</math> and <math>\frac{p}{q}</math>. | ||
+ | |||
+ | To simplify the problem, we multiply both sides of the inequality by <math>q</math> to get <cmath>|qx-p| < \frac{1}{n}.</cmath> Note that we wish <math>|qx-p|</math> to be less than one; hence, we might think to define <math>p</math> such that <math>qx-p</math> is <math>\{ qx \}</math>, the fractional part of <math>qx</math>. In formal terms, we let <math>p=\lfloor qx \rfloor</math> such that <math>|qx-p|=|qx-\lfloor qx \rfloor|=|\{ qx\} |=\{ qx\}</math>. | ||
+ | |||
+ | Now, we wish to demonstrate that out of <math>\{ x \}, \{ 2x \}, \ldots, \{ nx \}</math>, there exists a positive integer <math>q</math> such that <math>\{ qx \}</math> lies in the interval <math>[0,1/n)</math>. We can view the intervals <math>[0, 1/n), [1/n,2/n), \ldots, [(n-1)/n, 1)</math> as windows that contain all our multiples of <math>\{ qx \}</math>. Note that if <math>[0, 1/n)</math> and <math>[(n-1)/n, 1)</math> contain a multiple, then we are done. | ||
+ | |||
+ | Suppose every interval is filled; then one value of <math>\{ qx \}</math> must lie in <math>[0, 1/n)</math>. If there exists an interval that is not filled, we have at most <math>n-1</math> filled intervals and <math>n</math> multiples. The Pigeonhole Principle thus guarantees that there exists an interval with two values of <math>\{ qx \}</math>. Letting these values be <math>q_1</math> and <math>q_2</math>, we note that <math>\{ (q_1 - q_2)x \}</math> is either in the first or last interval. Hence, in either case, there exists a <math>q</math> such that <math>\{ qx \}</math> lies in <math>[0, 1/n)</math>, which is the theorem. We may assemble this into a formal proof: | ||
+ | |||
+ | '''Proof''': Let <math>k</math> be an integer from <math>0</math> to <math>n</math> inclusive. Note that for all of <math>0x, 1x, \ldots, nx</math>, we can write <math>kx = a_k + b_k</math>, where <math>a_k</math> is an integer and <math>0 \leq b_k < 1</math>. | ||
+ | |||
+ | Consider the <math>n</math> intervals from <math>[0, 1)</math> of size <math>\frac{1}{n}</math>. We have <math>n+1</math> total <math>b_0, b_1, \ldots b_n</math>; hence, the Pigeonhole Principle guarantees the existence of some <math>i</math> and <math>j</math> such that <math>b_i</math> and <math>b_j</math> are in the same interval. Without loss of generality, let <math>i>j</math>. Then <math>|b_i - b_j| < \frac{1}{n}</math>. | ||
+ | |||
+ | We have that <cmath>|(i-j)x - (a_i - a_j)| = |(ix-a_i) - (jx-a_j)| = |b_i - b_j| < \frac{1}{n}.</cmath> Note that the fact <math>i-j>0</math> allows us to divide both sides of this inequality by <math>i - j</math> to obtain <cmath>|x-\frac{a_i - a_j}{i - j}| < \frac{1}{n(i - j)}.</cmath> Therefore, <math>\frac{a_i - a_j}{i - j}</math> is a rational <math>\frac{p}{q}</math> such that <math>|x-\frac{p}{q}| < \frac{1}{nq}</math>, which completes the proof. <math>\square</math> | ||
+ | |||
+ | == Olympiad Problems == | ||
# Seven line segments, with lengths no greater than 10 inches, and no shorter than 1 inch, are given. Show that one can choose three of them to represent the sides of a triangle. ([[Pigeonhole Principle/Solutions#O1|Solution]]) <div style="text-align:right">(Manhattan Mathematical Olympiad 2004)</div> | # Seven line segments, with lengths no greater than 10 inches, and no shorter than 1 inch, are given. Show that one can choose three of them to represent the sides of a triangle. ([[Pigeonhole Principle/Solutions#O1|Solution]]) <div style="text-align:right">(Manhattan Mathematical Olympiad 2004)</div> | ||
# Prove that having 100 whole numbers, one can choose 15 of them so that the difference of any two is divisible by 7. ([[Pigeonhole Principle/Solutions#O2|Solution]]) <div style="text-align:right">(Manhattan Mathematical Olympiad 2005)</div> | # Prove that having 100 whole numbers, one can choose 15 of them so that the difference of any two is divisible by 7. ([[Pigeonhole Principle/Solutions#O2|Solution]]) <div style="text-align:right">(Manhattan Mathematical Olympiad 2005)</div> | ||
Line 34: | Line 70: | ||
* [[Combinatorics]] | * [[Combinatorics]] | ||
− | + | [[Category:Combinatorics]] [[Category:Definition]] | |
− | [[Category:Combinatorics]] |
Latest revision as of 18:13, 19 June 2024
In combinatorics, the pigeonhole principle states that if or more pigeons are placed into holes, one hole must contain two or more pigeons. This seemingly trivial statement may be used with remarkable creativity to generate striking counting arguments, especially in Olympiad settings.
In older texts, the principle may be referred to as the Dirichlet box principle. A common phrasing of the principle uses balls and boxes and is that if balls are to be placed in boxes and , then at least one box must contain more than one ball.
Contents
Proof
An intuitive proof of the pigeonhole principle is as follows: suppose for contradiction that there exists a way to place balls into boxes where such that all boxes contain at most one ball.
Let how many balls each box contains. Our condition that all boxes contain at most one ball implies that for all , so However, we know that there are a total of balls across all our boxes, so this sum must equal : Therefore, . This contradicts our definition that . Therefore, our assumption must be incorrect; at least one box must contain two or more balls.
In formal terms, the pigeonhole principle is a consequence of how one set is defined to be larger than another set.
Let be a set of balls and be a set of boxes such that . The definition that (as in our problem) is that there exists a surjective mapping from to , but not an injection. In other words, there exists a way to map every ball of to every box of , but it does not hold that if the boxes of two balls are the same, then the balls must be the same. That is to say, there must be two or more balls in the same box—which is the pigeonhole principle.
Introductory Examples
Example 1
If a Martian has an infinite number of red, blue, yellow, and black socks in a drawer, what is the minimum number of socks that the Martian must pull out of the drawer to guarantee they have a pair?
Solution: Intuitively, you might realize that after we select four socks of different colors (one red, one blue, one yellow, and one black), the Martian can't select a fifth sock without creating a pair. We may use this to prove the problem:
Note that the Martian may select socks without a pair: one red, one blue, one yellow, and one black sock. However, if the Martian selects socks from colors, the pigeonhole principle guarantees that socks must have the same color (where the socks are "pigeons" and the colors are "holes"). Therefore, is the minimum number of socks they must draw to guarantee a pair.
Example 2
Let . Show that if we choose numbers from , then there exist two numbers such that one is a multiple of the other.
Solution:
We write each number as for some integers and , where is nonnegative and is odd ( can also be ). Because we select integers and there are possible values of , Pigeonhole Principle guarantees that two numbers will share the same value. These numbers are multiples—if we define the two numbers and where , we may multiply by to get , as desired.
Example 3
Suppose is a set of integers. Prove that there exists distinct in such that is a multiple of .
Solution: Note that for any such and , We may rewrite this in modular arithmetic as , or Therefore, we wish to show that there exist and with the same remainder modulo n. Note that there are integers in and possible remainders (namely, ) modulo . Then by the pigeonhole principle, there exist two integers with the same remainder modulo . As shown earlier, this implies that their difference is a multiple of , as required.
Example 4
Show that in any group of people, there are two who have an identical number of friends within the group.
Solution: Note that for any person from the group, the minimum number of in-group friends they can have is (nobody) and the maximum is (everybody but themselves). Hence, there are possible values for an individual's number of in-group friends.
However, note that if a person has in-group friends, nobody else can be friends with all other individuals; vice-versa if an individual has friends. There cannot exist two individuals with and friends. Therefore, there are only possible values of an individual's number of in-group friends.
Then because there are individuals and possible values of in-group friends, the Pigeonhole Principle guarantees that two individuals have the same number of friends within the group.
Intermediate Examples
Example 1: Rational Approximation Theorem
Show that for any irrational number and positive integer , there exists a rational number with such that .
Solution: Take a moment to digest the question; in short, our task is to prove the existence of a rational number close to our irrational . In particular, is almost like a "confidence level"—where a higher increases the denominator and decreases the distance between and .
To simplify the problem, we multiply both sides of the inequality by to get Note that we wish to be less than one; hence, we might think to define such that is , the fractional part of . In formal terms, we let such that .
Now, we wish to demonstrate that out of , there exists a positive integer such that lies in the interval . We can view the intervals as windows that contain all our multiples of . Note that if and contain a multiple, then we are done.
Suppose every interval is filled; then one value of must lie in . If there exists an interval that is not filled, we have at most filled intervals and multiples. The Pigeonhole Principle thus guarantees that there exists an interval with two values of . Letting these values be and , we note that is either in the first or last interval. Hence, in either case, there exists a such that lies in , which is the theorem. We may assemble this into a formal proof:
Proof: Let be an integer from to inclusive. Note that for all of , we can write , where is an integer and .
Consider the intervals from of size . We have total ; hence, the Pigeonhole Principle guarantees the existence of some and such that and are in the same interval. Without loss of generality, let . Then .
We have that Note that the fact allows us to divide both sides of this inequality by to obtain Therefore, is a rational such that , which completes the proof.
Olympiad Problems
- Seven line segments, with lengths no greater than 10 inches, and no shorter than 1 inch, are given. Show that one can choose three of them to represent the sides of a triangle. (Solution) (Manhattan Mathematical Olympiad 2004)
- Prove that having 100 whole numbers, one can choose 15 of them so that the difference of any two is divisible by 7. (Solution) (Manhattan Mathematical Olympiad 2005)
- Prove that from any set of one hundred whole numbers, one can choose either one number which is divisible by 100, or several numbers whose sum is divisible by 100. (Solution) (Manhattan Mathematical Olympiad 2003)
- Prove that among any ten points located inside a circle with diameter 5, there exist at least two at a distance less than 2 from each other. (Solution) (Japan 1997)
- Every point in a plane is either red, green, or blue. Prove that there exists a rectangle in the plane such that all of its vertices are the same color. (Solution) (USAMTS Year 18 - Round 1 - Problem 4)
- There are 51 senators in a senate. The senate needs to be divided into committees such that each senator is on exactly one committee. Each senator hates exactly three other senators. (If senator A hates senator B, then senator B does 'not' necessarily hate senator A.) Find the smallest such that it is always possible to arrange the committees so that no senator hates another senator on his or her committee. (Solution) (Red MOP lecture 2006)