Pigeonhole principle
In mathematics, the pigeonhole principle states that if items must be put into containers, with, then at least one container must contain more than one item. In layman's terms, if you have more "objects" than you have "holes," at least one hole must have multiple objects in it. A real-life example could be, "if you have three gloves, then you have at least two right-hand gloves, or at least two left-hand gloves," because you have 3 objects, but only two categories to put them into. This seemingly obvious statement, a type of counting argument, can be used to demonstrate possibly unexpected results. For example, if you know that the population of London is greater than the maximum number of hairs that can be present on a human's head, then the pigeonhole principle requires that there must be two people in London who have the same number of hairs on their heads.
Although the pigeonhole principle appears as early as 1624 in a book attributed to Jean Leurechon, it is commonly called Dirichlet's box principle or Dirichlet's drawer principle after an 1834 treatment of the principle by Peter Gustav Lejeune Dirichlet under the name Schubfachprinzip.
The principle has several generalizations and can be stated in various ways. In a more quantified version: for natural numbers and, if objects are distributed among sets, then the pigeonhole principle asserts that at least one of the sets will contain at least objects. For arbitrary and this generalizes to where and denote the floor and ceiling functions, respectively.
Though the most straightforward application is to finite sets, it is also used with infinite sets that cannot be put into one-to-one correspondence. To do so requires the formal statement of the pigeonhole principle, which is "there does not exist an injective function whose codomain is smaller than its domain". Advanced mathematical proofs like Siegel's lemma build upon this more general concept.
Etymology
Dirichlet published his works in both French and German, using either the German ', or the French '. The strict original meaning of both corresponds to the English , an open-topped box that can be slid in and out of the cabinet that contains it. These terms were morphed to the word pigeonhole, standing for a small open space in a desk, cabinet, or wall for keeping letters or papers, metaphorically rooted in the structures that house pigeons.Since Dirichlet's father was a postmaster, and furniture with pigeonholes is commonly used for storing or sorting things into many categories, the translation pigeonhole may be a perfect rendering of Dirichlet's metaphor. That understanding of the word, referring to some furniture features, is fading —especially among those who do not speak English natively but as a lingua franca in the scientific world— in favour of the more pictorial interpretation, literally involving pigeons and holes. The suggestive, though not misleading interpretation of "pigeonhole" as "dovecote" has lately found its way back to a German back-translation of the "pigeonhole"-principle as the "Taubenschlag"-principle.
Besides the original terms "Schubfach-Prinzip" in German and "Principe des tiroirs" in French, other literal translations are still in use in Bulgarian, Chinese, Danish, Dutch, Hungarian, Italian, Japanese, Persian, Polish, Swedish, and Turkish.
Examples
Sock-picking
Assume a drawer contains a mixture of black socks and blue socks, each of which can be worn on either foot, and that you are pulling a number of socks from the drawer without looking. What is the minimum number of pulled socks required to guarantee a pair of the same color? Using the pigeonhole principle, to have at least one pair of the same color holes, one per color) using one pigeonhole per color, you need to pull only three socks from the drawer items). Either you have three of one color, or you have two of one color and one of the other.Hand-shaking
If there are people who can shake hands with one another, the pigeonhole principle shows that there is always a pair of people who will shake hands with the same number of people. In this application of the principle, the 'hole' to which a person is assigned is the number of hands shaken by that person. Since each person shakes hands with some number of people from 0 to, there are possible holes. On the other hand, either the '0' hole or the hole or both must be empty, for it is impossible for some person to shake hands with everybody else while some person shakes hands with nobody. This leaves people to be placed into at most non-empty holes, so that the principle applies.Hair-counting
We can demonstrate there must be at least two people in London with the same number of hairs on their heads as follows. Since a typical human head has an average of around 150,000 hairs, it is reasonable to assume. There are more than 1,000,000 people in London. Assigning a pigeonhole to each number of hairs on a person's head, and assign people to pigeonholes according to the number of hairs on their head, there must be at least two people assigned to the same pigeonhole by the 1,000,001st assignment . For the average case with the constraint: fewest overlaps, there will be at most one person assigned to every pigeonhole and the 150,001st person assigned to the same pigeonhole as someone else. In the absence of this constraint, there may be empty pigeonholes because the "collision" happens before we get to the 150,001st person. The principle just proves the existence of an overlap; it says nothing of the number of overlaps.There is a passing, satirical, allusion in English to this version of the principle in A History of the Athenian Society, prefixed to "A Supplement to the Athenian Oracle: Being a Collection of the
Remaining Questions and Answers in the Old Athenian Mercuries",. It seems that the question whether there were any two persons in the World that have an equal number of hairs on their head? had been raised in The Athenian Mercury before 1704.
Perhaps the first written reference to the pigeonhole principle appears in 1622 in a short sentence of the Latin work Selectæ Propositiones, by the French Jesuit Jean Leurechon, where he wrote "It is necessary that two men have the same number of hairs, écus, or other things, as each other." The full principle was spelled out two years later, with additional examples, in another book that has often been attributed to Leurechon, but may have been written by one of his students.
The birthday problem
The birthday problem asks, for a set of randomly chosen people, what is the probability that some pair of them will have the same birthday? By the pigeonhole principle, if there are 367 people in the room, we know that there is at least one pair who share the same birthday, as there are only 366 possible birthdays to choose from.The birthday "paradox" refers to the result that even if the group is as small as 23 individuals, the probability that there is a pair of people with the same birthday is still above 50%. While at first glance this may seem surprising, it intuitively makes sense when considering that a comparison will actually be made between every possible pair of people rather than fixing one individual and comparing them solely to the rest of the group.
Team tournament
Imagine seven people who want to play in a tournament of teams items), with a limitation of only four teams holes) to choose from. The pigeonhole principle tells us that they cannot all play for different teams; there must be at least one team featuring at least two of the seven players:Subset sum
Any subset of size six from the set = must contain two elements whose sum is 10. The pigeonholes will be labelled by the two element subsets,,, and the singleton, five pigeonholes in all. When the six "pigeons" are placed into these pigeonholes, each pigeon going into the pigeonhole that has it contained in its label, at least one of the pigeonholes labelled with a two-element subset will have two pigeons in it.Uses and applications
The principle can be used to prove that any lossless compression algorithm, provided it makes some inputs smaller, will also make some other inputs larger. Otherwise, the set of all input sequences up to a given length could be mapped to the smaller set of all sequences of length less than without collisions, a possibility which the pigeonhole principle excludes.A notable problem in mathematical analysis is, for a fixed irrational number, to show that the set of fractional parts is dense in . One finds that it is not easy to explicitly find integers such that, where is a small positive number and is some arbitrary irrational number. But if one takes such that, by the pigeonhole principle there must be such that and are in the same integer subdivision of size . In particular, we can find such that is in, and is in, for some integers and in. We can then easily verify that is in. This implies that, where or. This shows that 0 is a limit point of. We can then use this fact to prove the case for in : find such that ; then if ], we are done. Otherwise ], and by setting, one obtains.
Variants occurring in well known proofs:
In the proof of the pumping lemma for regular languages, a version that mixes finite and infinite sets is used: If infinitely many objects are placed into finitely many boxes, then there exist two objects that share a box.
In Fisk's solution of the Art gallery problem a sort of converse is used: If n objects are placed into k boxes, then there is a box containing at most n/k objects.
Alternative formulations
The following are alternative formulations of the pigeonhole principle.- If objects are distributed over places, and if, then some place receives at least two objects.
- If objects are distributed over places in such a way that no place receives more than one object, then each place receives exactly one object.
- If objects are distributed over places, and if, then some place receives no object.
- If objects are distributed over places in such a way that no place receives no object, then each place receives exactly one object.
Strong form
objects are distributed into boxes, then either the first box contains at least objects, or the second box contains at least objects,..., or the th box contains at least objects.
The simple form is obtained from this by taking, which gives objects. Taking gives the more quantified version of the principle, namely:
Let and be positive integers. If objects are distributed into boxes, then at least one of the boxes contains or more of the objects.
This can also be stated as, if discrete objects are to be allocated to containers, then at least one container must hold at least objects, where is the ceiling function, denoting the smallest integer larger than or equal to.
Similarly, at least one container must hold no more than objects, where is the floor function, denoting the largest integer smaller than or equal to.
Generalizations of the pigeonhole principle
A probabilistic generalization of the pigeonhole principle states that if pigeons are randomly put into pigeonholes with uniform probability, then at least one pigeonhole will hold more than one pigeon with probabilitywhere is the falling factorial. For and for , that probability is zero; in other words, if there is just one pigeon, there cannot be a conflict. For it is one, in which case it coincides with the ordinary pigeonhole principle. But even if the number of pigeons does not exceed the number of pigeonholes, due to the random nature of the assignment of pigeons to pigeonholes there is often a substantial chance that clashes will occur. For example, if 2 pigeons are randomly assigned to 4 pigeonholes, there is a 25% chance that at least one pigeonhole will hold more than one pigeon; for 5 pigeons and 10 holes, that probability is 69.76%; and for 10 pigeons and 20 holes it is about 93.45%. If the number of holes stays fixed, there is always a greater probability of a pair when you add more pigeons. This problem is treated at much greater length in the birthday paradox.
A further probabilistic generalization is that when a real-valued random variable has a finite mean, then the probability is nonzero that is greater than or equal to, and similarly the probability is nonzero that is less than or equal to. To see that this implies the standard pigeonhole principle, take any fixed arrangement of pigeons into holes and let be the number of pigeons in a hole chosen uniformly at random. The mean of is, so if there are more pigeons than holes the mean is greater than one. Therefore, is sometimes at least 2.
Infinite sets
The pigeonhole principle can be extended to infinite sets by phrasing it in terms of cardinal numbers: if the cardinality of set is greater than the cardinality of set, then there is no injection from to. However, in this form the principle is tautological, since the meaning of the statement that the cardinality of set is greater than the cardinality of set is exactly that there is no injective map from to. However, adding at least one element to a finite set is sufficient to ensure that the cardinality increases.Another way to phrase the pigeonhole principle for finite sets is similar to the principle that finite sets are Dedekind finite: Let and be finite sets. If there is a surjection from to that is not injective, then no surjection from to is injective. In fact no function of any kind from to is injective. This is not true for infinite sets: Consider the function on the natural numbers that sends 1 and 2 to 1, 3 and 4 to 2, 5 and 6 to 3, and so on.
There is a similar principle for infinite sets: If uncountably many pigeons are stuffed into countably many pigeonholes, there will exist at least one pigeonhole having uncountably many pigeons stuffed into it.
This principle is not a generalization of the pigeonhole principle for finite sets however: It is in general false for finite sets. In technical terms it says that if and are finite sets such that any surjective function from to is not injective, then there exists an element of of such that there exists a bijection between the preimage of and. This is a quite different statement, and is absurd for large finite cardinalities.