Drawing without replacement: the hypergeometric world
Interactive card-dealing simulator. Deal hands from a 3D deck and compare empirical frequencies of aces, pairs and colors against exact hypergeometric probabilities, and see why a deck's memory matters.
A shuffled deck is a finite population, and every card dealt changes what remains: drawing is sampling without replacement. The distribution that governs it is the hypergeometric, which gives the probability of finding k successes in a hand of n cards drawn from a deck of N cards containing K successes.
The deck's memory is measurable. The chance of at least one ace in a five-card hand is about 34.1% under the hypergeometric, against 33.0% if every card were put back and the deck reshuffled before the next draw (the binomial, with a constant 4-in-52 chance each time). The gap is small at this scale, but the same distinction decides real problems where the sample is a large share of the population.
Auditors sampling invoices for errors, quality engineers testing items from a batch, and lottery calculations all run on hypergeometric probabilities. This module deals hands of 2 to 10 cards, tracks three events (at least one ace, at least one pair, all one colour) live against their exact probabilities, and for the ace event shows the with-replacement figure alongside, so the effect of the shrinking deck is visible rather than asserted.
Hypergeometric probability
P(X = k) = C(K, k) · C(N−K, n−k) / C(N, n)
N is the population size (52 cards), K the number of successes in it (4 aces), n the hand size and k the number of successes in the hand; C(a, b) is the binomial coefficient, the number of ways to choose b items from a.
Frequently asked questions
What is the difference between hypergeometric and binomial sampling?
Binomial sampling replaces each draw, so the success probability is constant and draws are independent. Hypergeometric sampling does not replace, so each draw shifts the odds for the next. When the sample is small relative to the population the two agree closely; when it is not, the hypergeometric is the correct model.
What is the probability of at least one ace in a five-card hand?
1 − C(48,5)/C(52,5) ≈ 34.1%. The subtracted term is the probability that all five cards come from the 48 non-aces.
Where is the hypergeometric distribution used in practice?
Audit and acceptance sampling (how many defective or erroneous items appear in a sample from a finite batch), ecological capture-recapture estimates, lottery odds and card-game analysis: any inference from a sample drawn without replacement from a known finite population.
Interactive explorer
The live model with sliders, charts and real-time statistics loads on this page. If it does not appear, enable JavaScript or open https://www.beyondaverages.org/cards in a modern browser.
Related modules
- Dice & convolution: Interactive 3D dice simulator. Roll up to five dice and watch the empirical sum histogram converge to the exact convolution probabilities: uniform to triangular to bell-shaped, the central limit theorem made visible.
- Frequency: Interactive Poisson distribution explorer for insurance claim counts and hospital admissions. Move the rate λ and watch P(X=k), the mode, and the probability of zero or extreme counts update live.
- Severity: Interactive loss severity explorer comparing Log-Normal, Pareto (heavy-tail) and Gamma distributions. Adjust parameters and see the mean, median, 95th and 99th percentile claim sizes, and the share of total cost from the largest 5% of claims, update in real time.
- Expected loss: Interactive aggregate loss model for a personal motor book: Poisson claim frequency with Log-Normal severity across a portfolio of policies. Compute expected loss and run a 20,000-year Monte Carlo to see the aggregate loss distribution and its 95th, 99th and 99.5th percentiles.