What was added
The mini tools row on the combination and permutation calculator page already covered a password/PIN arrangement counter, a lottery/raffle probability tool, and a Pascal's triangle row generator. Those three answer different, narrower questions: how many possible passwords exist, what are the odds of matching every number in a draw, and what do the raw nCr values look like across a row. None of them, on their own, answered "what's my probability of exactly some partial number of matches" — which is the more general and often more useful question for card hands, partial lottery prizes, or quality-control sampling. That gap is what the new tool fills.
How the four inputs work
Each input maps to a plain-language question:
- Population (n): the total size of the group you're drawing from — a card deck, a batch of parts, a pool of raffle tickets.
- Successes in n (K): how many items in that population count as what you're looking for — hearts in a deck, defective parts in a batch, winning numbers in a lottery pool.
- Drawn (r): how many items you pull out at once, without putting any back.
- Exact matches (k): the number of "successes" you specifically want to land among your r draws — not "at least," but exactly.
Under the hood, the calculation is the same three-term structure the earlier lottery discussion on this blog described in the abstract: multiply the ways to choose k successes from the K available, by the ways to choose the remaining r−k draws from the n−K non-successes, then divide by the total number of ways to draw r items from n overall. The tool runs all three nCr terms internally and returns the final percentage directly, along with the "favorable" and "total ways" counts it used to get there — so the intermediate numbers are visible, not just the final figure.
A worked example: hearts in a card draw
This is the calculator's own built-in example, and it's a useful one to try first since a standard deck is a fixed, well-known reference: n=52 (the full deck), K=13 (the 13 hearts), r=5 (a 5-card hand), and k=2 (wanting exactly 2 of those 5 cards to be hearts). Plug those four numbers in and the tool shows the formula it used, the "favorable" count (ways to pick 2 hearts and 3 non-hearts), the "total ways" count (all possible 5-card hands from 52), and the resulting percentage.
| Exactly k hearts | What it represents |
|---|---|
| k = 0 | No hearts at all in the 5-card hand |
| k = 1 | Exactly one heart |
| k = 2 | Exactly two hearts — the calculator's example, ≈27.4% |
| k = 5 | All five cards are hearts |
Beyond card hands, the same four-input shape applies to quality-control sampling (n parts in a batch, K defective, drawing r for inspection, wanting exactly k defects found), and to partial lottery-style matches (n numbers in the pool, K winning numbers, r drawn total, wanting exactly k of your numbers to hit) — the kind of "5 out of 6" partial-prize question that a simple all-or-nothing lottery odds calculation can't answer on its own.
Frequently asked questions
What is the new probability calculator on the Combination & Permutation Calculator?
What inputs does the hypergeometric probability calculator take?
How is the hypergeometric probability formula different from a simple lottery odds calculation?
What's a worked example of the hypergeometric probability calculator in action?
Does the probability calculator replace the existing lottery mini tool?
Try the new hypergeometric probability mini tool yourself, right next to the lottery and password calculators.
Try the free Combination & Permutation Calculator →