Percentages and Math

Hypergeometric Distribution Calculator

Work out sampling odds for cards, batches and pools when items are not put back.

Your numbers

A whole number from 1 to 5,000.

A whole number from 0 to N.

A whole number from 1 to N. Items are drawn without putting any back.

A whole number from 0 to n.

Result

Probability of exactly 1 marked in 5 drawn

0.431337

43.1337% when drawing 5 from 50 without replacement

P(X = 1)
0.431337
P(X <= 1)
0.7419
P(X < 1)
0.310563
P(X >= 1)
0.689437
P(X > 1)
0.2581
Mean (n x K / N)
1
Variance
0.734694
Standard deviation
0.857143
Possible counts of marked items
0 to 5

Probabilities near your k

kP(X = k)P(X <= k)
00.3105630.310563
10.4313370.7419
20.209840.95174
30.0441770.995916
40.0039650.999881
50.0001191
How this was calculated
  1. P(X = k) = C(K, k) x C(N - K, n - k) / C(N, n) = C(10, 1) x C(40, 4) / C(50, 5).
  2. All counts are found with exact whole-number arithmetic and divided only at the end, so even long or lopsided draws keep their accuracy.
  3. Mean = n x K / N, and variance = n x (K / N) x (1 - K / N) x (N - n) / (N - 1). The last factor is the correction for drawing without replacement.
  • This assumes every draw is equally likely to pick any remaining item. If items are put back after each draw, use the binomial probability calculator instead.

Calculated using SumPanda.com · https://sumpanda.com/hypergeometric-distribution-calculator/

Results are estimates for general information. Verify important figures before relying on them.

Next step

How to use the hypergeometric distribution calculator

  1. Enter the group size (N), the number of marked items in the group (K), the number you draw (n), and the number of marked items you want in the draw (k). Items are drawn without putting any back.
  2. The headline gives the chance of exactly k marked items. The list below it gives the chance of at most k, fewer than k, at least k and more than k, with the mean, variance and standard deviation.
  3. The table shows the chance of each count near your k, with your row highlighted. Counts that cannot happen, for example more marked items than were drawn, show a probability of 0.
  4. Use Copy, Print or CSV to keep the result.

Formula

P(X = k) = C(K, k) x C(N - K, n - k) / C(N, n)

Mean = n x K / N

Variance = n x (K / N) x (1 - K / N) x (N - n) / (N - 1)

C(a, b) is the number of ways to choose b items from a. The numerator counts the draws with exactly k marked items, and the denominator counts all possible draws.

A box of 50 with 10 marked

Draw 5 items from 50, where 10 are marked. The chance of exactly 1 marked item is C(10, 1) x C(40, 4) / C(50, 5) = 10 x 91,390 / 2,118,760 = 0.431337. The chance of 1 or fewer is 0.7419, and the mean number of marked items in a draw is 5 x 10 / 50 = 1.

If the draws were made with replacement, the chance of 1 marked item in 5 draws at 20% each would be 5 x 0.2 x 0.8^4 = 0.4096. The hypergeometric answer, 0.4313, is different because each draw changes what is left. For 5 cards from a 52 card deck, the chance of exactly 2 hearts is C(13, 2) x C(39, 3) / C(52, 5) = 712,842 / 2,598,960 = 0.27428.

When to use this distribution

Use it when you draw a fixed number of items from a group that has two kinds of items, and you do not put any back. Examples are cards from a deck, defective parts in a sample taken from a batch, or winners among tickets drawn from a pool. If you replace each item before the next draw, the chances stay the same each time, and the binomial probability calculator fits better. When the group is very large compared with the draw, the two give nearly the same answer.

The mean n x K / N is the same as for the binomial case, but the spread is smaller, because drawing without replacement removes some of the chance. The last factor of the variance formula, (N - n) / (N - 1), is the amount of that reduction. It is 1 for very large groups and falls to 0 when you draw the whole group.

Exact counts, large groups

The counts of ways to draw are huge whole numbers even for modest groups, so the tool works with exact whole-number arithmetic and divides only at the end. That keeps the answer accurate for groups up to 5,000 items, where the number of possible draws has over a thousand digits. Probabilities smaller than one in a million are shown in scientific notation, and anything below 1e-300 is reported as such rather than as a misleading zero.

For events with no fixed group, such as arrivals per hour, see the Poisson distribution calculator, and for independent trials with a fixed chance each time, use the binomial one. The probability calculator handles the basic combinations of events.

Assumptions and limits

  • Every item in the group is equally likely to be drawn at each step, and drawn items are not replaced.
  • The group has only two kinds of items: marked and unmarked.
  • The group size is limited to 5,000 items.
  • Probabilities are shown to six decimal places, or in scientific notation when smaller than one in a million.

Formulas reviewed October 10, 2026. See the calculation methodology for how SumPanda rounds, tests and sources its formulas.

Frequently asked questions

What is the difference between hypergeometric and binomial?

The binomial model puts each item back before the next draw. The hypergeometric model does not, so each draw changes the chances of the next one.

Why is the probability of some counts exactly 0?

Some counts are impossible. You cannot draw more marked items than exist, or more than you draw, and a draw may have to include some marked items if few unmarked ones remain.

What does the variance correction mean?

It is the factor (N - n) / (N - 1). It reduces the spread compared with drawing with replacement, and it disappears as the group becomes very large compared with the draw.

Why is the group limited to 5,000?

Exact counts for larger groups take noticeably longer to compute in a browser. The limit keeps the page quick while covering most real sampling problems.