Hypergeometric Probability

P(X=k)=(Kk)(NKnk)(Nn)P(X = k) = \frac{\binom{K}{k} \binom{N - K}{n - k}}{\binom{N}{n}}

Enter your known values, leave one input blank, and solves for the missing one. Try different units for next level excitement!

Learning zone

This is the binomial's honest sibling for sampling without replacement, where every draw changes the odds for the next. Split the choices in two: pick k of the K successes, pick the remaining n − k from the N − K non-successes, and divide by all the ways to pick n from N. A five-card poker hand containing exactly two aces: C(4,2) × C(48,3) / C(52,5) = 6 × 17,296 / 2,598,960 ≈ 0.0399, about one deal in twenty-five.

The distribution prices lottery tiers, acceptance sampling on a production lot, and the capture–recapture estimates ecologists use to count fish — tag K animals, catch n later, and the number recaptured pins down N. Matching exactly 4 of 6 numbers in a 6/49 draw is C(6,4) × C(43,2) / C(49,6) = 15 × 903 / 13,983,816 ≈ 0.000969, roughly 1 in 1032. The trap is reaching for the binomial: it is a good approximation only when the sample is a small slice of the population, under about 5%, because then removing items barely shifts the odds. Sample 20 items from a lot of 50 and the two answers diverge badly. A value of k outside the support — more successes than the sample holds, or more than exist in the population — returns exactly 0 rather than an error, because those draws genuinely never happen. There is no closed form for N, K, n or k given P, so this calculator solves for the probability.

Hypergeometric Probability
P(X=k)=(Kk)(NKnk)(Nn)P(X = k) = \frac{\binom{K}{k} \binom{N - K}{n - k}}{\binom{N}{n}}
Where
  • P(X=k)P(X = k)= Probability of exactly k successes
  • NN= Population size
  • KK= Successes in the population
  • nn= Sample size drawn
  • kk= Successes in the sample
Missing one of these? Work it out first, then come back