Skip to content
⌕ Search this site

Advertisement

Hypergeometric Distribution Calculator — drawing without replacement

A population of N items contains K “successes”. You draw n items without putting them back. How likely is it that exactly k of them are successes? Pick an example or enter your own numbers.

An example only fills in the numbers — the formula is always the same. Changing a number switches to “Your own values”.

All items you draw from, e.g. 52 cards or 49 lottery numbers.

Items that count as a success, e.g. 4 aces, or the 6 numbers that will be drawn.

How many items are drawn without replacement.

The number of successes you ask about. X can only take values from max(0, n − (N − K)) to min(n, K).

P(X = k): 1.77%

The same as
P(X ≤ k)
P(X ≥ k)
Expected value E(X)
Variance Var(X)
Standard deviation σ
Possible values of X
In words

Full distribution of X

Every possible value of X with P(X = k), P(X ≤ k) and P(X ≥ k)
k P(X = k) P(X ≤ k) P(X ≥ k)
Fill in the fields above — the result is computed on this page.

The P(X = k) column adds up to 100%. P(X ≤ k) grows and P(X ≥ k) falls from row to row; the highlighted row is your k.

What these numbers mean
  • Result for the settings above: 1.77%. It updates as soon as any field changes.
  • We compute it from the formula shown below — not from a prediction model and not from draw history.

The numbers come from the formula and the values you typed above. They are not a forecast — no calculator changes the probability of a single draw.

How to use this page
  1. Fill in the fields in the form above — the result recomputes at once, with no page reload.
  2. Under the result you will find the interpretation scale, if the calculator has one: it says which range your value fell into.
  3. The formula we use is shown lower on this page — you can check the arithmetic yourself.
  4. To compute the same for another game or variant, change it in the select field — prices and pools update automatically.

What this page does not do: It does not point to numbers to play and does not predict a draw — every draw is independent of the previous ones.

Further reading

Formula

P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n) · E(X) = n × K/N · Var(X) = n × K/N × (1 − K/N) × (N − n)/(N − 1)
N is the population size, K the number of successes in it, n the sample size and k the number of successes in the sample. C(a, b) is the binomial coefficient. X can only take values from max(0, n − (N − K)) to min(n, K). For N = 1 (or n = N) the variance is 0 — the result of the draw is then certain.

The hypergeometric distribution describes drawing without replacement: every item taken out changes what is left. That is exactly how lottery balls, cards dealt from a deck or a sample of products taken for inspection behave.

The formula counts favourable samples. Choose k successes out of K and n − k failures out of N − K, multiply the two numbers and divide by all ways of choosing n items out of N. For exactly three matches in Lotto this gives 20 × 12,341 ÷ 13,983,816, about 1.77%.

Not every k is possible. If there are only K successes, you cannot draw more than K of them; if there are only N − K failures, a large sample must contain at least n − (N − K) successes. The calculator shows the possible range of X and returns 0 for values outside it.

The expected value n × K/N is the long-run average number of successes, not a prediction of a single draw. The factor (N − n)/(N − 1) makes the variance smaller than in the binomial distribution, because drawing without replacement leaves less room for chance; when N = 1 or n = N the variance is 0.

The examples are the classic ones from probability lessons — balls in an urn, a deck of cards, defective items in a batch — plus two lottery cases. They only fill in the numbers: the formula never changes.

Read more

Frequently asked questions

What is the difference between the hypergeometric and the binomial distribution?

The binomial distribution assumes drawing with replacement, so the chance of success stays the same every time. The hypergeometric distribution is for drawing without replacement, where each draw changes what is left. For a large population and a small sample the two give similar results.

Why is P(X ≥ k) not equal to 1 − P(X ≤ k)?

Because both include the row X = k. The correct relation is P(X ≥ k) = 1 − P(X ≤ k − 1), which you can check in the table.

See also

← All calculators

Advertisement
Offline app and draw notifications