TTKTheTextKit

Hypergeometric Distribution Calculator

Enter the size of a population, how many of its items count as successes and how many you draw, and the calculator gives the chance of exactly, at most, at least, fewer than, more than or between k successes, with the expected count and a full table. A second tab works out lottery odds for any pool and number of picks, with the exact count of winning tickets for each number of matches. Everything runs in your browser.

All the items you draw from

Items of the kind you want

Drawn without replacement

Probability
0.0399298
3.99298%, about 1 in 25.04
Expected successes
0.384615
Standard deviation 0.572
Most likely count
0
Possible range 0 to 4
kP(X = k)At most kAt least kChance
00.658840.658841
10.299470.958320.34116
20.039930.998250.041684
30.00173610.999980.0017545
41.8469e-511.8469e-5

The hypergeometric distribution gives the chance of exactly k successes in n draws taken without replacement from a population of N items that holds K successes: the number of ways to choose k of the K successes and n minus k of the N minus K failures, divided by the number of ways to choose n of N. It differs from the binomial because every draw changes what is left. The lottery tab uses the same rule with a pool of M numbers and m winning numbers, so matching all m has odds of 1 in the number of ways to choose m from M. These are the odds of the numbers only, and do not include bonus balls or prize rules. Everything is worked out in your browser.

Related Tools

[5 suggestions]

About the Hypergeometric Distribution Calculator

The hypergeometric distribution describes drawing without replacement, where each draw changes what is left. If a population of N items holds K successes and you draw n, the chance of exactly k successes is the number of ways to choose k of the K successes times the ways to choose n minus k of the N minus K failures, divided by the ways to choose n of the N. In a five card poker hand from a 52 card deck, the chance of exactly two aces is 3.993%, and in a batch of 50 parts with 5 defective, a sample of 10 contains none with probability 31.06%. The mean is n times K over N and the variance is n times K over N times (N minus K) over N times (N minus n) over (N minus 1). When the population is huge compared with the sample, it matches the binomial distribution, which assumes independent draws. The lottery tab is the same rule with a pool of M numbers and m winning numbers. In a 6 from 49 game there are 13,983,816 possible tickets, so the jackpot is 1 in 13,983,816, matching 5 numbers has 258 winning tickets (1 in 54,200.84), matching 4 has 13,545 (1 in 1,032.4) and matching 3 has 246,820 (1 in 56.66). Binomial coefficients are computed exactly with big integers for the lottery table and by logarithms for large populations, so nothing overflows. Bonus balls and prize tiers are not included.

What is the hypergeometric distribution used for?▾

It gives probabilities when you draw without replacement from a group with two kinds of items, such as aces in a poker hand, defective parts in a sample or winning numbers on a lottery ticket. Use the binomial distribution instead when each draw is independent.

How is it different from the binomial distribution?▾

In a binomial setting, every trial has the same chance of success. In a hypergeometric setting, drawing an item changes the chances for the next draw because it is not put back. For a very large population the two give nearly the same answer.

How do I calculate lottery odds?▾

The number of possible tickets is the number of ways to choose your picks from the pool, and the jackpot is 1 in that number. For 6 numbers from 49 it is 49 choose 6, which is 13,983,816. Odds for fewer matches use the hypergeometric formula.

Does the order of the draws matter?▾

No. The formula counts combinations, not sequences, so drawing the same items in a different order is the same outcome.

Is my data uploaded?▾

No. The calculation runs in your browser and nothing you enter is sent anywhere.