Skip to content

Hypergeometric Distribution Calculator

Enter the population size, the number of successes in it, the number of items drawn, and the number of successes you want. The calculator returns the probability of exactly that many, at most, and at least, plus the mean and standard deviation. From a 52-card deck with 13 hearts, drawing 5 cards gives a 27.43% chance of exactly 2 hearts.

Updated 2026-11-19 Editorial estimate Calccc Editorial Team Free · No sign-up
Scenarios A/BSave two input sets and compare the results. Stored only in this browser.
AEmpty
BEmpty

Your inputs stay in this browser. No account, no uploads.

Professional worksheet

Detailed schedule & assumptions

Inputs used, method, sensitivity, and any year-by-year table. The summary above stays compact; the audit lives here.

Professional worksheet

Inputs, scope, and sensitivity

Inputs used

Method and scope

Result audit

MetricValue

What this calculator does

The hypergeometric distribution describes sampling without replacement from a finite group. A card drawn from a deck is not put back, so the odds of the next card change; a component tested for a defect is not returned to the batch. In those situations the binomial distribution, which assumes a constant probability on every draw, is the wrong model. The hypergeometric formula counts the ways to choose the successes and the failures and divides by the total number of ways to choose the sample. It is used in quality control, in lotteries and card games, in ecology, and in any sampling plan where the population is small enough that removing an item matters. The calculation is exact for a random sample, but it depends on the population and the number of successes being known. This calculator returns the exact, at-most, and at-least probabilities, the expected number of successes, and the spread.

How to use it

  1. Enter the total population size.
  2. Enter how many of those items count as successes.
  3. Enter how many items are drawn without replacement.
  4. Enter the number of successes you want the probability for.
  5. Read the exact, at-most, and at-least probabilities.
  6. Use the mean and standard deviation to describe the distribution rather than a single draw.

How it works

P(exactly k) = C(K, k) × C(N - K, n - k) / C(N, n), where N is the population, K is the number of successes, n is the number drawn, and C is the binomial coefficient. Mean = n × K / N. Variance = n × (K / N) × (1 - K / N) × (N - n) / (N - 1). In the default case N = 52, K = 13, n = 5, and k = 2 give P = 0.2743, a mean of 1.25, and a standard deviation of 0.93.

Example calculations

Example 1: Two hearts in a five-card hand

A standard deck has 52 cards and 13 hearts. Drawing 5 cards, the chance of exactly 2 hearts is C(13, 2) × C(39, 3) / C(52, 5) = 78 × 9,139 / 2,598,960 = 0.2743, or 27.43%. The chance of at most 2 hearts is 90.72%, and the chance of at least 2 is 36.70%. The expected number of hearts is 5 × 13 / 52 = 1.25.

Example 2: Sampling a batch for defects

A batch of 100 parts contains 8 defective ones. A sample of 10 is checked. The chance of finding exactly 1 defective is C(8, 1) × C(92, 9) / C(100, 10) = 0.408, or about 40.8%. The chance of finding none is about 41.6%, and the chance of finding at least one is about 58.4%. Because the sample is a large share of the batch, the binomial approximation would overstate the chance of a defective part on later draws.

Example 3: A lottery-style draw

A draw takes 6 numbers from 50, and a ticket matches 4 of them. The chance of exactly 4 matches is C(6, 4) × C(44, 2) / C(50, 6) = 15 × 946 / 15,890,700 = 0.000893, or about 0.089%. The tiny probability is typical of lottery games, and the hypergeometric formula is the exact way to compute it because the drawn balls are not replaced.

What the result means

The exact probability is the headline, but the at-most and at-least figures are often more useful. A quality plan usually cares about the chance of finding at least one defect, which is the complement of finding none. The mean tells you what to expect on average across many samples, and the standard deviation tells you how much a single sample is likely to vary. The finite population correction, the (N - n) / (N - 1) term in the variance, is what distinguishes this distribution from the binomial: when the sample is a small fraction of a large population, the correction is close to 1 and the two models agree. When the sample is a large fraction, the hypergeometric result is noticeably tighter, because each draw removes an item and changes the composition of what remains.

Common mistakes

  • Using the binomial distribution when the sample is drawn without replacement.
  • Entering the sample size as the population size, or the reverse.
  • Confusing at most k with at least k.
  • Forgetting that the number of successes cannot exceed the number drawn.
  • Treating the expected value as a prediction for a single sample.
  • Ignoring the finite population correction when the sample is a large share of the population.

Assumptions and limits

  • The sample is drawn at random without replacement.
  • Every item in the population is equally likely to be drawn.
  • The population size and the number of successes are known exactly.
  • Each item is either a success or a failure, with no other categories.
  • The order of the draws does not matter.
  • The population does not change during the draw.

Frequently asked questions

What is the hypergeometric distribution?

It gives the probability of a certain number of successes when a fixed number of items is drawn without replacement from a finite population that contains a known number of successes.

How is it different from the binomial distribution?

The binomial assumes each draw has the same probability of success and is independent of the others, which fits sampling with replacement or a very large population. The hypergeometric accounts for the changing composition as items are removed.

What does at most k mean?

It is the probability of getting k or fewer successes. The at-least figure is the probability of k or more. The two overlap at exactly k, so they do not add to 100% unless you subtract the exact probability once.

Can I use it for lottery odds?

Yes. Lottery draws are sampling without replacement, so the hypergeometric formula gives the exact chance of matching a given number of numbers, provided the draw is fair and the pool is known.

What is the expected number of successes?

It is n × K / N, the sample size times the proportion of successes in the population. In the default case, 5 × 13 / 52 = 1.25 hearts in a five-card hand.

Does the order of the draws matter?

No. The formula counts combinations, not permutations, so the order in which the items are drawn does not change the probability of a given count.

Sources

This calculator is an educational planning tool, not financial, legal, insurance, medical, or professional advice. Results depend on the inputs and on rules that vary by place and provider. Confirm important decisions with a qualified professional and the relevant documents.

2026 update

How to use the professional output

This page is not just a formula box. The result is designed to be checked, compared, and taken away.

  • Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
  • A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
  • Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.

The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.

Calccc Editorial Team · Updated 2026-11-19

Prepared by Calccc Editorial Team as an educational estimate. This page is not a licensed professional review and is not financial, medical, legal, or tax advice.

Editorial estimate prepared by the Calccc Editorial Team; not a licensed professional review.