Hypergeometric Distribution Calculator

Calculate exact success probability, mean, and variance for a sample drawn without replacement.

Calculate hypergeometric probability
Describe a finite population and the number of successes observed in a sample.

About the hypergeometric distribution

The hypergeometric distribution describes the number of successes in a fixed-size sample drawn without replacement from a finite population. The population contains N objects, exactly K of which have the feature called success. A sample of n objects is selected, and X counts how many of those sampled objects are successes. Typical applications include drawing cards from a deck, auditing a shipment, selecting committee members, and testing products from a finite batch. Exact probability comes from counting combinations. The number of samples containing exactly k successes is the combination of K choose k multiplied by the combination of N minus K choose n minus k. Dividing that product by N choose n, the number of all possible samples of size n, gives P(X = k). Since order does not matter, combinations are the natural counting method. The calculator evaluates these factors without needing a list of individual objects. Feasible inputs obey several constraints. Population size must be positive. The population success count and sample size cannot exceed the population. The requested sample successes cannot exceed either the successes available or the sample size. It also cannot be so small that the sample would require more failures than exist in the population. Validating all these limits prevents a mathematically impossible event from being confused with an ordinary zero-probability result. The expected number of sample successes is n times K divided by N. Variance equals n times the population success proportion times its complement, multiplied by the finite population correction (N - n) divided by (N - 1). That correction captures dependence caused by sampling without replacement. As more of the population is sampled, uncertainty decreases; when the entire population is selected, the number of successes is known and variance is zero. The hypergeometric and binomial distributions are related but not interchangeable. A binomial model assumes independent trials with a constant success probability, which fits replacement sampling or a population effectively much larger than the sample. Hypergeometric draws are dependent because each selection changes the composition remaining. When the sample is a small fraction of a large population, the binomial distribution can approximate the result. For finite batches or substantial sampling fractions, the exact hypergeometric calculation is preferable. Use this tool for transparent probabilities in quality control, genetics, surveys, games, and any selection process where sampled items are not returned.

Hypergeometric examples

N, K, n, kExact probabilityInterpretation
52, 4, 5, 10.29947364Exactly one ace appears in a five-card hand.
20, 7, 5, 20.3873839Exactly two qualifying objects occur in a five-object sample.
10, 3, 2, 00.46666667Both sampled objects come from the seven failures.

How to calculate hypergeometric probability

  1. Enter the total finite population size N.
  2. Enter the number K of successes available in that population.
  3. Enter the sample size n and desired sampled successes k.
  4. Select Calculate Probability to view the exact probability, mean, and variance.

Hypergeometric distribution FAQ

When should I use a hypergeometric model?

Use it for a fixed-size sample drawn without replacement from a finite population with two object types. The changing composition makes successive draws dependent.

How does it differ from a binomial distribution?

Binomial trials are independent and retain a constant success probability. Hypergeometric draws occur without replacement, so each selection changes probabilities for later draws.

What does k mean?

The value k is the exact number of successes requested in the sample. It must be feasible given both the successes and failures available.

Why does variance include a finite population correction?

Sampling without replacement reduces uncertainty as the sample consumes more of the population. The correction makes variance reach zero when the entire population is selected.

Can the binomial distribution approximate this result?

It can be close when the sample is a very small fraction of a large population. For substantial sampling fractions, use the exact hypergeometric probability instead.