Hypergeometric Drawing
For sampling without replacement (Magic decks, urn problems, QC lots). Shows the full PMF, cumulative distribution and a use-case advisor that translates "what's the chance the batch has at least 5 defects" into a quality-control plan with sample size.
E[X] = n·K/N = —
Var(X) = n·K·(N−K)·(N−n) / [N²·(N−1)] = —
| k | P(X=k) | P(X≤k) | P(X≥k) |
|---|
Use cases
MTG / deck thinning
"How likely am I to draw at least one of these 4 in a 7-card opening hand?" Classic hypergeometric.
Quality control
A batch of 1000 with 3% defect rate. Sampling 50: P(zero defects detected) = ? Decide accept/reject.
Inventory depletion
"How likely is the rack empty by hour 6 if it has 30 items and we sell ~5/hr?" Set K and watch the cumulative.
Method note
P(X = k) = [C(K,k) · C(N−K, n−k)] / C(N,n). We compute the entire PMF via a 1D recurrence (Neumann) for stability at large n.
When not to trust this
- If sampling is done with replacement (e.g. cards returned to a deck), use the binomial instead.
- Sampling bias (e.g. clusters) requires finite-population correction across strata; not modelled.
FAQ
When does hypergeometric ≈ binomial?
When (n/N) < 10%. With small K/N the convergence is even faster.
How is the QC accept number chosen?
Two competing metrics: producer's risk (α) and consumer's risk (β). The calculator lets you read off a "sample size to reject if observed k > threshold" plan.