Pigeonhole Principle Calculator
Distribute n items into k boxes and discover what the pigeonhole principle guarantees about the fullest box.
At least this many items must share one box (ceil(10 / 3))
- 1
Items ÷ boxes
10 ÷ 3 = 3.3333The raw average — how many items each box would hold if distributed perfectly evenly. - 2
Guaranteed minimum in fullest box
⌈10 ÷ 3⌉ = 4
How does this calculator work?
The pigeonhole principle guarantees that distributing n items into k boxes forces the fullest box to hold at least ceil(n / k) items. To guarantee some box reaches m items, you need at least k·(m − 1) + 1 items. These are worst-case certainties that hold for every possible arrangement.
Formula
How this is calculated
Enter n, the number of items, and k, the number of boxes. However cleverly you spread the items, the fullest box must contain at least ceil(n / k) items — this is the pigeonhole (Dirichlet) principle. If you split evenly, each box holds floor(n / k), and the remaining n − k·floor(n / k) boxes get one extra item, which is exactly why the maximum rounds up.
The target input m answers the reverse question: how many items must you place before some box is guaranteed to hold at least m of them. The worst case fills every box with m − 1 items without reaching m, totalling k·(m − 1); one more item, k·(m − 1) + 1, forces the m-th item into some box. This is the minimum count that guarantees the target regardless of arrangement.
All inputs are treated as non-negative integers and are floored internally, so fractional entries are rounded down. The number of boxes k must be at least 1 to avoid division by zero, and the target m must be at least 1 for the forcing count to be defined. The results are guarantees about the worst case, not predictions of a typical or random distribution.
Frequently asked questions
If every box held fewer than ceil(n / k) items, the total would be less than n, a contradiction. So at least one box must reach the rounded-up average.
You need k·(m − 1) + 1. The worst case puts m − 1 items in every box without hitting m; one additional item must push some box to m.
No. The pigeonhole principle is a worst-case guarantee that holds for any distribution, no matter how the items are arranged.
Also known as
TG we-Calculate Editorial Team. (2026). Pigeonhole Principle Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/pigeonhole-principle-calculator
TG we-Calculate Editorial Team. "Pigeonhole Principle Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/pigeonhole-principle-calculator.
TG we-Calculate Editorial Team, "Pigeonhole Principle Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/pigeonhole-principle-calculator
@misc{wecalculate_pigeonhole_principle_calculator, title = {Pigeonhole Principle Calculator}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/pigeonhole-principle-calculator}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
