🧮
🧮 Math & statistics

Hypergeometric Distribution Calculator (lottery, card draws)

Results update as you type.

Your numbers

Understanding the hypergeometric distribution calculator — concept and principle

The hypergeometric distribution gives the probability of drawing exactly k "successes" when you take n items without replacement from a population of N items that contains K successes. It is the right model for card games (aces in a poker hand), lotteries (matching numbers), quality sampling from a lot (defective units in a sample) and any draw where each item can be picked only once. The calculator returns P(X = k) and the chance of drawing at least one success.

Hypergeometric: one ace in five cardsChoose 1 of the 4 aces and 4 of the 48 other cards: 778,320 of 2,598,960 hands, about 0.2995.Exactly 1 ace in a 5-card handDeck 52 = 4 aces + 48 other cards1 of 4 aces4 of the 48 othersC(4,1) × C(48,4) = 4 × 194,580C(52,5) = 2,598,960 possible handsno putting cards backP(X = 1) ≈ 0.2995= 778,320 ÷ 2,598,960At least one ace: 1 − C(48,5) ÷ C(52,5) ≈ 0.3412
Count favourable hands, then divide by all possible hands.

How it is calculated

C(a, b) = a! ÷ (b!(a − b)!) is the number of ways to choose b items from a. k must satisfy max(0, n − (N − K)) ≤ k ≤ min(n, K). The mean is n·K/N.

The principle

Every set of n items is equally likely, and there are C(N, n) such sets. A favourable set picks k of the K successes, in C(K, k) ways, and fills the remaining n − k places from the N − K failures, in C(N − K, n − k) ways. Favourable divided by total gives the probability. Unlike the binomial, the chance of a success changes after each draw because the population shrinks; when N is much larger than n, the two distributions become nearly the same.

Worked example

  1. Defaults: a 52-card deck (N = 52) with 4 aces (K = 4), a 5-card hand (n = 5), exactly 1 ace (k = 1).
  2. C(4, 1) = 4 and C(48, 4) = 194,580, so favourable hands = 778,320.
  3. All hands: C(52, 5) = 2,598,960.
  4. P(X = 1) = 778,320 ÷ 2,598,960 ≈ 0.2994736356.
  5. No ace: C(48, 5) = 1,712,304, so P(X ≥ 1) = 1 − 1,712,304 ÷ 2,598,960 ≈ 0.3411580017.
How P(X = k) changes with Successes in population KHow P changes with Successes in populati…00.10.20.30.40.51234568Example: 0.2994736356Successes in population K
Each point is the calculator re-run with only “Successes in population K” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Successes in population KP(X = k)
10.0961538462
20.177224736
30.2445701357
40.2994736356
50.3431468741
60.3767314618
80.4178625296

How to read the result

About 30% of five-card hands contain exactly one ace and about 34% contain at least one. The mean is 5 × 4/52 ≈ 0.385 aces per hand. For a 6/45 lottery (N = 45, K = 6, n = 6) the chance of matching all six is 1 ÷ C(45, 6) = 1 in 8,145,060, and matching exactly three is about 2.24%.

Common mistakes

Keep in mind: The formula assumes every combination is equally likely, as with a well-shuffled deck or a fair draw. Lottery results are not predictable from past draws, and this is not gambling advice.

Frequently asked questions

What is the probability of exactly 2 aces in 5 cards?

C(4, 2)·C(48, 3) ÷ C(52, 5) = 6 × 17,296 ÷ 2,598,960 ≈ 0.0399.

When can I use the binomial instead?

When the sample is a small fraction of the population (a common rule is n ≤ 5% of N), using p = K/N.

Does the order of the draws matter?

No. The hypergeometric counts unordered selections, so the order in which cards appear does not change the result.

Sources: Sheldon M. Ross, A First Course in Probability, Pearson — hypergeometric random variables · William Feller, An Introduction to Probability Theory and Its Applications, Vol. 1, Wiley — hypergeometric distribution

Checked 8 Nov 2026. Standard formulas, computed in your browser with double-precision numbers.

🧮 All math & statistics tools →🌍 Calculators by country →