Generalized pigeonhole principle 2026-10-14
For objects assigned to boxes, let be the number in box . The generalized pigeonhole principle statesThe ceiling function rounds up because box counts are integers. An equivalent threshold formulation says: for a positive integer , if , some box contains at least objects. For , putting objects in each box shows why the strict inequality matters. [ref]
https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-spring-2015/mit6_042js15_textbook.pdf#page=583. Lehman, Leighton and Meyer, Mathematics for Computer Science, section 14.8.1, rule 14.8.2
Computed examples. For and , . Counts attain this bound. For and , , and the balanced counts sum to and have largest count exactly . The threshold version agrees: . In contrast, seven boxes each containing three hold only objects.
Two balanced arrangements attain the generalized pigeonhole principle bounds: thirteen objects in twelve boxes force two, and twenty-three in seven force four
. Details. The bound is sharp for every and . Use Euclidean division to write with integers and . Place objects in each of boxes and objects in each remaining box. The largest count is if , and if , exactly . This balanced arrangement makes the guarantee best possible even though other arrangements can be much more crowded.
Proof outline. If every count were at most , the total would be at most . This contradicts . Taking proves the displayed bound for ; for every count is zero.
Pigeonhole principle Created 2026-09-24 Updated 2026-10-13
Place objects into boxes, assigning each object to exactly one box. Here is a nonnegative integer and is a positive integer. The pigeonhole principle says that if , some box contains at least two objects. Equivalently, a function from an -element finite set to an -element finite set cannot be an injective function when . The boxes may stand for categories rather than physical containers. [ref]
https://ocw.mit.edu/courses/6-042j-mathematics-for-computer-science-spring-2015/mit6_042js15_textbook.pdf#page=581. Lehman, Leighton and Meyer, Mathematics for Computer Science, section 14.8, rule 14.8.1
For thirteen objects and twelve boxes, a box containing at least two is unavoidable. Thinking of thirteen people and their birth months gives the same conclusion: at least two share a birth month. Twelve people could occupy the twelve months one apiece, so thirteen is the smallest number that forces a shared month. The generalized pigeonhole principle quantifies how many objects must share a box when there are still more objects.
The useful surprise is that the pigeonhole principle proves existence without needing to locate the objects involved. Choosing a good assignment rule is often the creative step: equal labels can mean equal remainders, nearby points, or repeated states of an algorithm. Once the rule is chosen, a short count can force a relationship among a much larger collection of objects. The pigeonhole principle itself does not name the crowded box. When the objects and their assignments are explicitly available, a simple algorithm finds one: scan the objects, keep the first object seen in each box, and stop when a later object enters an occupied box. At most scanned objects are needed when .
A geometric example. Any five points in a square of side one contain two whose Euclidean distance is at most . Give each point Cartesian coordinates . Divide both ranges into the intervals and , making four cells. Thus belongs to the left half and to the right half; belongs to the lower half and to the upper half. This convention assigns every boundary point to exactly one cell.
The pigeonhole principle puts two of the five points in the same cell. Their differences in Cartesian coordinates have magnitude at most , so the Pythagorean theorem gives their Euclidean distance the boundFor the plotted points , , , and , the first two occupy the lower-left cell and have Euclidean distance . These Cartesian coordinates exhibit the forced pair; the argument applies to every placement of five points.
The pigeonhole principle places two of five points in one of four cells of a square, bounding their Euclidean distance by
. Details. An arithmetic example. Assign eight integers to their seven residue classes modulo the integer modulus . The pigeonhole principle gives two with the same residue class, so is an integer divisor of their difference. In , for example, and satisfy the integer congruence , and . Likewise, assigning fractional parts to short intervals gives the Dirichlet approximation theorem; its existing article explains the approximation bound.

