Calculators
Pigeonhole Principle Calculator
Calculate guaranteed minimum occupancy and the objects needed to force a shared box using exact browser arithmetic.
Find the minimum occupancy guaranteed in at least one box, and how many objects force your target. Enter up to 100 digits per count; boxes and target must be positive. Boxes have unlimited capacity. Calculations stay in your browser.
How the pigeonhole guarantee works
The generalized pigeonhole principle says that distributing N objects among B boxes guarantees at least one box with ceil(N / B) objects. To force at least K objects in one box, you need B × (K − 1) + 1 objects: with one fewer, every box could hold only K − 1. For 10 objects and 3 boxes, at least one box contains 4 objects. To guarantee 5 in one of 3 boxes requires 13 objects. These are worst-case guarantees, not probabilities or claims about every box. Objects can be distributed arbitrarily, boxes have unlimited capacity, and each object occupies exactly one box. Zero objects gives occupancy zero. Boxes and target occupancy must be positive. Enter non-negative integers of up to 100 decimal digits; signs, decimals, separators and scientific notation are rejected. Leading zeros and surrounding whitespace are accepted. BigInt arithmetic preserves exact values. All processing stays in your browser.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
Does the guarantee apply to every box?
No. It guarantees that at least one box reaches the stated occupancy, regardless of how objects are distributed.
How many objects force K in one box?
For B boxes and positive target K, the minimum is B × (K − 1) + 1. With one fewer, each box can still hold K − 1.
Is this a probability calculator?
No. This is a worst-case counting guarantee with unlimited box capacity, not an estimate for random assignments.