Maths & numbers

Pigeonhole minimum guaranteed occupancy calculator

Find the minimum count guaranteed in at least one box regardless of the allocation.

Your numbers

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

This is a guarantee for one box. The count in a particular box can be much smaller.

THE FORMULAceil(objects / boxes)

A worked example

25 objects in six boxes force at least one box to contain five objects.

Good to know

Each object belongs to one box.

Find the smallest unavoidable maximum

With 25 objects and six boxes, suppose every box held at most four objects. The total capacity under that assumption would be 6 × 4 = 24. The twenty-fifth object forces some box to hold at least five, so the guaranteed occupancy is five.

This bound can be attained by distributing the objects as 5, 4, 4, 4, 4 and 4. Consequently no larger occupancy is guaranteed for every possible allocation. The general formula is the ceiling of objects divided by boxes.

Twenty-five objects in six boxes can be spread as five in one box and four in each remaining box544444Guaranteed maximum occupancy ≥ 5
Six boxes with four objects each hold only 24. The extra object forces at least one occupancy of five.

Read the existential statement correctly

The result says at least one box reaches the bound. It does not say every box does, or identify which box. All 25 objects could instead be assigned to a single box, making the actual maximum much larger. The guarantee remains valid for that highly uneven allocation.

The Floor and ceiling of a number calculator helps interpret why a noninteger average must round upward for this guarantee. If the objects divide evenly among the boxes, the bound equals that exact average. Empty boxes are allowed. When there are fewer objects than boxes but at least one object, the guaranteed occupancy is one, even though several boxes may remain empty.

A few questions, answered

What does zero objects return?

Zero. Every box can have occupancy zero, and at least one box certainly has at least zero objects.

Is this an average occupancy estimate?

The average is objects/boxes. The output is an integer lower bound on the largest box occupancy across all possible allocations.

Find your calculator

Start typing to explore the library.