Hypergeometric Distribution Calculator

Hypergeometric PMF P(X=k).

FreeNo accountOn your device

Runs in your browser. How to verify

Loading tool…

About this tool

Enter the population size N, the successes in it K, the sample size n and the count you want k. Drawing 5 cards from 52, the chance of exactly one ace is 0.299474.

How to use

1
Step 1
Enter N, the population size.
2
Step 2
Enter K, the number of successes in the population.
3
Step 3
Enter n, the sample size, and k, the successes you want.
4
Step 4
Press Calculate.

How it works

Unlike the binomial, draws are made without replacement, so each one changes the odds for the next. P(X = k) = C(K, k) C(N − K, n − k) ÷ C(N, n). For one ace in five cards: 4 × C(48, 4) ÷ C(52, 5) = 4 × 194,580 ÷ 2,598,960 = 0.299474.

P(X = k) = C(K, k) · C(N − K, n − k) ÷ C(N, n)

Worked example

Matching 3 of 6 lottery numbers

Input
N = 49, K = 6, n = 6, k = 3
Output
0.0176504
Walkthrough
C(6, 3) × C(43, 3) ÷ C(49, 6) = 20 × 12,341 ÷ 13,983,816 = 0.0176504, about 1 in 57.

Limitations

  • Gives P(X = k) only, not a cumulative probability.
  • Impossible inputs are rejected with an error: K or n larger than N, a k that cannot be drawn, or negative or non-integer values.

Questions

What is the chance of exactly 2 defectives in a sample of 5 from 50 with 10 defective?
0.20984.
What is the chance of exactly one ace in a 5-card hand?
0.299474.
What is the chance of matching 3 of 6 lottery numbers from 49?
0.0176504.
What happens with impossible inputs, such as K larger than N?
The tool shows an error instead of returning 0.

Features

  • Sampling without replacement
  • Exact probability
  • Runs in your browser

Related resources

Guides and videos from around the web—opens on YouTube or the publisher’s site.

  • Variables, expressions, and equations

    Khan Academy

    Algebra language shared by many math calculators.

    Watch on YouTube
  • Rectangle area as product of dimensions

    Khan Academy

    Foundational area thinking across math tools.

    Watch on YouTube