Beginner

Pigeonhole Principle Calculator

Distribute n items into k boxes and discover what the pigeonhole principle guarantees about the fullest box.
Total objects to distribute
Number of containers
Desired count to force into one box
Guaranteed minimum in fullest box
4

At least this many items must share one box (ceil(10 / 3))

Items to force 4 per box
10
Even split per box
3
Boxes with one extra item
1
67%
33%
Boxes at base count (3)
Boxes with one extra (4)
Distribution across 3 boxes — fullest guaranteed ≥ ceil(n/k) = 4
Step by step
  1. 1

    Items ÷ boxes

    10 ÷ 3 = 3.3333
    The raw average — how many items each box would hold if distributed perfectly evenly.
  2. 2

    Guaranteed minimum in fullest box

    ⌈10 ÷ 3⌉ = 4
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

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
fullest box ≥ ceil(n / k); items to force m per box = k·(m − 1) + 1
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

pigeonhole principle
pigeonhole calculator
guaranteed minimum
boxes and items
dirichlet principle
pigeonhole

APA

TG we-Calculate Editorial Team. (2026). Pigeonhole Principle Calculator [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/pigeonhole-principle-calculator

Chicago

TG we-Calculate Editorial Team. "Pigeonhole Principle Calculator." TG we-Calculate. 2026. https://we-calculate.com/calculator/pigeonhole-principle-calculator.

IEEE

TG we-Calculate Editorial Team, "Pigeonhole Principle Calculator," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/pigeonhole-principle-calculator

BibTeX

@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?