Princípio das Casas dos Pombos
- Created by
- Renato Passos, Eng. de Software
- Reviewed by
- Renato Passos, Eng. de Software
Last updated: Apr 18, 2026
Formula
pigeonhole
About this calculator
The Pigeonhole Principle Calculator is an online tool that applies the combinatorial principle known as the Pigeonhole Principle (or Dirichlet's Principle). It calculates the minimum number of pigeons that must occupy at least one hole, given a number of pigeons and holes. The principle states that if more pigeons than holes are distributed, at least one hole will contain more than one pigeon. The formula used is: pigeons per hole = ceil(pigeons / holes), where ceil rounds up the quotient.
This calculator is useful in practical optimization and allocation scenarios, such as distributing tasks among employees, allocating resources in projects, or even in logic and discrete mathematics problems. For example, if you have 10 pigeons and 3 holes, the calculator informs that at least one hole will have 4 pigeons (since 10/3 ≈ 3.33, rounded up is 4). The result shows the minimum guaranteed number of pigeons in a hole, not the exact distribution.
Caveats: The principle works only when the number of pigeons is greater than the number of holes. If the number of pigeons is less than or equal to the number of holes, the result will be 1 (since each hole can have at most one pigeon, but it does not guarantee that any hole has more). Additionally, the calculator considers all pigeons as indistinguishable; if there are additional constraints, the principle may not apply directly. Use it to obtain the worst-case scenario in allocations.
Frequently asked questions
What is the Pigeonhole Principle?
It is a combinatorial principle stating that if n pigeons are placed into m holes and n > m, then at least one hole contains more than one pigeon.
How is the calculation done?
The calculation uses the formula ceil(pigeons / holes), which rounds up the division result.
Is the result the exact number of pigeons in each hole?
No, the result is the minimum guaranteed number of pigeons in at least one hole, not the exact distribution.
Can I use this calculator for large numbers?
Yes, the calculator accepts large positive integers, as long as they are within system limits.
What happens if the number of pigeons is less than or equal to the number of holes?
The result will be 1, as the principle does not guarantee that any hole has more than one pigeon.