🧰 ToolPicoAll Tools →

Home > Blog > New Probability Calculator

New: A Built-In Hypergeometric Probability Calculator (Exact-Match Odds)

A previous post on this calculator flagged "exactly k matches" probability as a natural next feature, something you'd otherwise have to chain three separate nCr lookups to compute by hand. It's now live: a small probability calculator sits in the "Mini tools" section, right alongside the password, lottery, and Pascal's triangle tools. Here's what it does and how to read the result.

In this guide

What was added

Quick answerA new probability calculator (hypergeometric) mini tool now lives in the calculator's "Mini tools" section. Given a population of n items with K "successes" inside it, it returns the probability of drawing exactly k successes when you pull r items at random without replacement.

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

Quick answerThe tool takes four numbers — Population (n), Successes in n (K), Drawn (r), and Exact matches (k) — and computes C(K,k)·C(n−K,r−k) / C(n,r), displayed as a percentage.

Each input maps to a plain-language question:

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

Quick answerA standard 52-card deck has 13 hearts. Drawing 5 cards and asking for the probability of exactly 2 hearts gives C(13,2)·C(39,3) / C(52,5), which the calculator evaluates to approximately 27.4%.

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.

Same 52-card, 5-draw setup, varying only k (illustrative — try your own values in the tool)
Exactly k heartsWhat it represents
k = 0No hearts at all in the 5-card hand
k = 1Exactly one heart
k = 2Exactly two hearts — the calculator's example, ≈27.4%
k = 5All five cards are hearts
This is a "without replacement" model — once a card is drawn, it isn't put back, so the pool shrinks with each pick. That's the defining trait of a hypergeometric setup, and it's why the formula needs three separate nCr terms instead of the simpler fixed-probability math you'd use for draws with replacement (like repeated die rolls).

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?
It's a hypergeometric-style probability mini tool: given a population of n items containing K "successes," it computes the probability of drawing exactly k successes when you draw r items without replacement. It sits alongside the existing password, lottery, and Pascal's triangle mini tools in the "Mini tools" section of the calculator page.
What inputs does the hypergeometric probability calculator take?
Four numbers: Population (n), the total number of items; Successes in n (K), how many of those items count as a "success"; Drawn (r), how many items you draw at once; and Exact matches (k), the number of successes you want in that draw. The tool then computes C(K,k)·C(n−K,r−k) / C(n,r) and returns the result as a percentage.
How is the hypergeometric probability formula different from a simple lottery odds calculation?
A simple lottery odds calculation (the existing Lottery / raffle mini tool) answers "what are the odds of matching all r numbers," which is just 1/C(n,r). The hypergeometric formula answers the more general question of matching exactly k out of r, which requires combining three separate nCr terms: the ways to pick k successes from K, times the ways to pick the remaining r−k non-successes from n−K, divided by the total C(n,r) ways to draw r from n.
What's a worked example of the hypergeometric probability calculator in action?
A standard 52-card deck has 13 hearts, so n=52 and K=13. Drawing 5 cards (r=5) and asking for the probability of exactly 2 hearts (k=2) gives C(13,2)·C(39,3)/C(52,5), which the calculator evaluates to approximately 27.4%.
Does the probability calculator replace the existing lottery mini tool?
No, both remain available side by side. The Lottery / raffle mini tool is a quick way to get "odds of matching everything" for a pick-r-of-n draw. The new probability calculator is the more general exactly-k-matches tool, useful for partial-match questions like card-hand probabilities or partial lottery prize tiers that the simpler lottery tool doesn't cover.

Try the new hypergeometric probability mini tool yourself, right next to the lottery and password calculators.

Try the free Combination & Permutation Calculator →

Related guides

Methodology note: The card-deck example (52 cards, 13 hearts, 5 drawn, ≈27.4% for exactly 2 hearts) is the calculator's own built-in illustration and reflects standard 52-card deck composition. Other figures in this guide (quality-control batch sizes, generic k values) are illustrative only and not tied to any specific real dataset. This is a general-purpose probability tool, not gambling, financial, or statistical advice.