keisoku

Hypergeometric Distribution Calculator

From population N, successes K, and sample size n, compute the probability of drawing exactly k successes without replacement (PMF, cumulative, upper) plus mean and variance, with a bar chart.

Input

Set the population N, the number of successes K, and the sample size n, then find the probability of exactly k successes. This is sampling without replacement.

Total number of items. An integer of 1 or more.

How many items in the population count as successes. An integer from 0 to N.

How many items are drawn without replacement. An integer from 0 to N.

Number of successes among the drawn items. An integer within the valid range.

Result

P(X=k) for X=1 when N=50, K=5, n=10

0.4313372

Cumulative P(X≤k)

0.74189998

Upper P(X≥k)

0.68943722

Combinations C(K,k)

5

Mean nK÷N

1

Variance

0.73469388

Probability mass P(X=k)

012345

How it works

  • The hypergeometric distribution gives the probability of drawing exactly k successes when n items are taken without replacement from a population of N that contains K successes. It applies to lotteries, card draws, and acceptance sampling.
  • The probability mass function is P(X=k) = C(K,k)·C(N−K,n−k) ÷ C(N,n). The combinations C(a,b) are computed with the log gamma function to avoid overflow for large values.
  • The possible range of k is max(0, n−(N−K)) to min(n, K). Outside this range the probability is zero.
  • Cumulative probability P(X≤k) sums the masses from the lower bound up to k, and upper probability P(X≥k) sums from k to the upper bound.
  • The mean is nK÷N and the variance is n·(K÷N)·(1−K÷N)·(N−n)÷(N−1). The final factor (N−n)÷(N−1) is the finite population correction that distinguishes it from the binomial distribution.
  • All calculations run in your browser and no input is sent anywhere. The tool is intended for educational and estimation purposes.

Reviews

Tell us what you think of this calculator.

Write a review

  1. Home
  2. Hypergeometric Distribution Calculator