Pigeonhole Principle Calculator
Enter the number of containers and target load to instantly find the minimum items needed to guarantee that outcome by the pigeonhole principle.
Select Mode
e.g. 12 months, 365 days, 26 letters
Minimum k is 2 (at least two items share a container).
Total items distributed across the containers.
Fill in the values and click Calculate.
Step-by-step
Classic examples
| Scenario | m | k=2 needs |
|---|---|---|
| Months of the year | 12 | 13 |
| Days of the week | 7 | 8 |
| Days in a year | 365 | 366 |
| Letters A–Z | 26 | 27 |
| Deck of 52 cards (suits) | 4 | 5 |
Summary
Enter the number of containers and target load to instantly find the minimum items needed to guarantee that outcome by the pigeonhole principle.
How it works
- Enter the number of containers (pigeonholes).
- Choose a mode: find the minimum items for a guaranteed load, or find the guaranteed load for a given number of items.
- The calculator applies the formula: minimum items = (k − 1) × m + 1, where k is the target load and m is the number of containers.
- The guaranteed maximum load formula is: floor((n − 1) / m) + 1 items in at least one container.
- Results update instantly as you type.
Use cases
- Prove in combinatorics homework that a collision must occur.
- Determine birthday-problem thresholds in a classroom or group.
- Analyze hash table collision guarantees given a fixed table size.
- Calculate how many files must exist in a folder before a duplicate extension is certain.
- Solve discrete-math exam questions involving guaranteed overlaps.
- Model scheduling conflicts: minimum meetings before two land in the same slot.
Frequently Asked Questions
Last updated: 2026-06-13 ·
Reviewed by Nham Vu