Skip to content

DIY Cost Tools

Hypergeometric Probability Calculator

Compute the probability of exactly k successes when a sample is drawn uniformly without replacement from a finite population. Specify how many population members count as successes before sampling. Unlike a binomial model, the chance changes after each draw because selected members are removed.

Enter every field in the stated units. Decimal and scientific notation are accepted for non-integer fields; blanks, commas, fractions and non-finite entries are rejected. Zero is accepted only where a field permits it.

P(X = k)0.3873839009
Expected successes1.75
Variance0.8980263158

How to use this calculator

  1. Identify the quantities required by the model and use the field units.
  2. Replace the example values, then select Calculate or press Enter.
  3. Read the labeled outputs and check the interpretation below.

Formula and interpretation

P(X=k) = C(K,k)C(N−K,n−k)/C(N,n); mean = nK/N; variance = n(K/N)(1−K/N)(N−n)/(N−1), with variance 0 for N=1.

Calculations run in your browser. The previous results are hidden when an input changes or validation fails. This prevents an old answer from being mistaken for the new calculation. Results are displayed to approximately ten significant digits using floating-point arithmetic; that precision does not imply equal precision in measured inputs.

Worked example

Population size N = 20; Successes in population K = 7; Sample size n = 5; Sample successes k = 2. P(X = k) = 0.3873839009; Expected successes = 1.75; Variance = 0.8980263158.

Substitute the example inputs into the stated formula in the same order as the labeled fields. These are the default values shown above, so the explanation and the working interface describe the same case.

Limitations

Population and count inputs must be integers no larger than 200. Sampling must be uniform without replacement. Impossible success counts return probability zero; counts exceeding the sample size are rejected. This model does not handle biased or clustered sampling.

This is an educational mathematical model. Check the assumptions and units for your situation. Geometry results do not establish material strength, and probability outputs do not predict an individual outcome.

Frequently asked questions

Why does sampling without replacement matter?

Each draw changes the remaining mix. The hypergeometric model includes that finite-population dependence.

Why does the calculator reject my entry?

Each field shows its supported range. Integer fields reject fractions; mathematical conditions such as a zero divisor or invalid shape produce a separate explanation. Correct the indicated field or condition and calculate again.

How many digits should I use?

Use enough digits to retain your input accuracy. Round the final answer to the precision justified by the data; tiny residuals around theoretical zero can result from floating-point arithmetic.

Review notes and reference

Reviewed October 3, 2026. The calculator script was tested against the default example and separate boundary cases. Checks covered blank, text, comma-formatted, non-finite and out-of-range entries, plus recovery after errors. Background reference for the mathematical method. Explanations and worked examples are original.

Related calculators

Math calculators · Binomial Probability Calculator · Poisson Probability Calculator · Geometric Probability Calculator · Search all calculators