Skip to content
FiftyCalc Free calculators for all 50 states

Hypergeometric Distribution Calculator

Test cases replayed : 3 of 3 match · Methodology · No outside source listed

Enter the population size, the number of successes in it, how many items you draw and a number of successes k, for draws without replacement.

Result

Sample figures

P(X = k)—

P(X ≤ k) —

  • P(X ≥ k)—
  • Mean (n × K ÷ N)—
  • Variance—

Estimate for planning only, not tax, legal, financial or medical advice. This calculator uses the method explained on this page.

Hypergeometric Distribution Calculator

Population size (N): enter 1 or more. Prefilled example: 52.

Successes in the population (K): enter 0 or more. Prefilled example: 13.

Number of draws (n): enter 0 or more. Prefilled example: 5.

Successes in the draws (k): enter 0 or more. Prefilled example: 2.

How to use this calculator

Fill in the fields in this order; each step takes you to its field.

  1. Population size (N): enter 1 or more.
  2. Successes in the population (K): enter 0 or more.
  3. Number of draws (n): enter 0 or more.
  4. Successes in the draws (k): enter 0 or more.
  5. Read the result: P(X = k); the panel also shows P(X ≤ k), P(X ≥ k), Mean (n × K ÷ N) and Variance.

How this calculator works

Hypergeometric distribution: drawing n items without replacement from N items of which K are successes, P(X = k) = C(K, k) × C(N − K, n − k) ÷ C(N, n), where C is the binomial coefficient.

P(X ≤ k) adds these terms from 0 to k (computed here for k up to 30), and P(X ≥ k) = 1 − P(X ≤ k) + P(X = k). Mean = nK ÷ N; variance = n (K/N)(1 − K/N)(N − n) ÷ (N − 1).

Unlike the binomial distribution, each draw changes the odds of the next, because drawn items are not put back.

The formula

  1. Eq=ncr⁡(K2,k)×ncr⁡(N2−K2,n−k)ncr⁡(N2,n)
Symbols used in the formula
SymbolMeaningUnit
N2Population size (N)
K2Successes in the populationK
nNumber of draws
kSuccesses in the draws
EqP(X = k)
ncr(n, k)the number of ways to choose k items from n, order ignored.

Worked example

Population size (N)52
Successes in the population (K)13
Number of draws (n)5
Successes in the draws (k)2
P(X ≤ k)0.9072
P(X ≥ k)0.367
Mean (n × K ÷ N)1.25
Variance0.864
  1. Eq=ncr⁡(13,2)×ncr⁡(52−13,5−2)ncr⁡(52,5)=0.27428

P(X = k) 0.2743

Each step uses the unrounded value of the step before it; figures on this page are rounded for display.

Frequently asked questions

What is the chance of exactly 2 hearts in a 5-card hand?

C(13, 2) × C(39, 3) ÷ C(52, 5) = 78 × 9,139 ÷ 2,598,960 ≈ 0.2743.

When can I use the binomial distribution instead?

When the draws are a small part of the population (a common rule is under 5%), drawing without replacement barely changes the odds and the binomial is a close approximation.

Questions answered

Related calculators