Hypergeometric Distribution Calculator: Exact Odds & Tables

A 60-card deck holds 4 copies of the card you want, and you draw an opening hand of 7. A quick estimate says each card has a 4/60 chance, so 7 cards give 7 × 4/60 = 46.7%. The real chance of drawing at least one copy is 39.95%. The 46.7% figure is really the average number of copies per hand (0.467), and it counts every hand with two or more copies more than once. The hypergeometric distribution counts each hand once and allows for every drawn card leaving the deck.

This calculator gives exact hypergeometric probabilities (exactly, at most, at least, fewer than, more than or between), with the fraction behind each answer, a full table and a comparison with drawing with replacement. Other tabs find how many draws you need for a target chance, work out a mix drawn from several groups at once, and list the odds of every number of matches in a lottery. It opens on the deck.

Hypergeometric Calculator

Draws are made without putting anything back. “Between” includes both end counts.

Hypergeometric probability –
The distribution
Step by step
    Probability table

    One Formula: Ways to Succeed × Ways to Fail ÷ All Draws

    Four numbers describe any draw without replacement:

    • N, the population size: 60 cards
    • K, the number of successes in it: 4 copies
    • n, the number of draws: 7 cards
    • k, the number of successes you ask about

    Every hand of 7 is equally likely, and there are C(60, 7) = 386,206,920 of them. A hand with exactly k copies takes k of the 4 copies and the other 7 − k cards from the 56 non-copies:

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

    For the deck:

    Copies in hand kWaysProbability
    0C(4, 0) × C(56, 7) = 231,917,4000.6005
    1C(4, 1) × C(56, 6) = 129,873,7440.3363
    2C(4, 2) × C(56, 5) = 22,918,8960.0593
    3C(4, 3) × C(56, 4) = 1,469,1600.0038
    4C(4, 4) × C(56, 3) = 27,7200.0000718

    The ways add up to 386,206,920, because every hand lands in exactly one row. The calculator prints this table and highlights the rows in your answer.

    The possible values of k have limits on both sides. You can’t draw more copies than exist (k ≤ K) or more cards than you draw (k ≤ n). If the non-copies run out, some copies are forced into the hand: drawing 58 of the 60 cards guarantees at least 2 copies. The calculator shows this range as max(0, n − (N − K)) to min(K, n).

    “At Least One” Is Easiest From “None”

    The chance of at least one copy is 1 minus the chance of none:

    P(X ≥ 1) = 1 − C(56, 7) ÷ C(60, 7) = 1 − 0.6005 = 0.3995, exactly 38,962/97,527.

    More copies raise it, but with diminishing returns:

    Copies in a 60-card deckP(at least one in 7 cards)
    111.67%
    222.15%
    331.54%
    439.95%
    865.36%

    Doubling from 4 to 8 copies does not double the chance, because the second copy in a hand adds nothing to “at least one”. The same logic covers any “at least one” question without replacement: the chance that a sample of 20 from a batch contains at least one faulty part, or that a drawn hand contains at least one ace.

    How Many Draws for a 90% Chance?

    The Draws needed tab runs the question backwards. With 4 copies in 60 cards:

    Target chance of at least one copyCards you must see
    50%10 cards (52.77%)
    90%26 cards (90.49%; 25 cards give 89.26%)
    95%31 cards (95.13%)

    So a 7-card hand plus three more draws gives slightly better than even odds of having seen a copy. Wanting two copies is a different story: in those same 10 cards the chance of at least two is only 12.58%. Type 2 in the “successes wanted” box to plan for it.

    Without Replacement vs With Replacement

    If each card went back into the deck after being drawn, every draw would have the same 4/60 chance and the binomial distribution would apply: 1 − (56/60)⁷ = 38.30%, against the true 39.95%. Taking cards out helps, because each non-copy you draw makes the remaining deck richer in copies.

    The gap shrinks as the population grows relative to the sample. Keeping the same share of copies (1 in 15) and a 7-card hand:

    Deck sizeCopiesP(at least one)
    60439.95%
    120839.10%
    6004038.46%
    6,00040038.32%
    with replacement38.30%

    The spread differs in the same way. The hypergeometric variance is the binomial variance times (N − n) ÷ (N − 1), the finite population correction. For the deck it is 53/59 = 0.898. When you draw less than about 5% of the population, the factor is close to 1 and the binomial is a fair shortcut; for larger shares the calculator flags the difference. The binomial distribution calculator covers the with-replacement case and fixed-chance trials.

    Checking a Batch: Acceptance Sampling

    A buyer receives 200 parts, of which 6 are faulty, and inspects 20 chosen at random. Under a plan that accepts the batch only if the sample has no faulty parts:

    • P(accept) = C(194, 20) ÷ C(200, 20) = 52.69%.

    Nearly half the time, a batch with a 3% fault rate is rejected, and just over half the time it passes. Allowing one faulty part in the sample raises acceptance to 88.83%.

    The same plan treats batches of different quality very differently. With the zero-fault rule, a batch holding only 2 faulty parts passes 80.95% of the time, while one holding 10 passes 33.98% of the time. Running these numbers for several fault counts gives the plan’s operating characteristic, which shows how well it separates good batches from bad ones. Because the sample is 10% of the batch, the binomial shortcut would give 54.38% for the zero-fault plan instead of 52.69%.

    Estimating a Population You Can’t Count

    Biologists use the same distribution in reverse. Catch 50 fish from a lake, tag them and release them. Later, catch 40 and count the tagged ones. If 5 are tagged, the share of tagged fish in the catch (5 in 40) suggests the same share in the lake, so the Lincoln–Petersen estimate is N ≈ 50 × 40 ÷ 5 = 400 fish. This needs a closed population: no births, deaths or movement between catches, and no lost tags.

    The hypergeometric shows how loose that estimate is. Even if the lake holds exactly 400 fish, a catch of 40 contains exactly 5 tagged fish only 19.76% of the time. Four tagged fish would suggest 500 fish; six would suggest about 333. In the Probability tab, set N = 400, K = 50 and n = 40 to see the whole spread.

    Lottery Matches

    A lottery that draws 6 numbers from 49 is a hypergeometric draw: the 6 winning numbers are the successes, and your 6 picks are the sample.

    MatchesWaysChance
    611 in 13,983,816
    52581 in 54,201
    413,5451 in 1,032
    3246,8201 in 57
    21,851,15013.24%
    15,775,58841.30%
    06,096,45443.60%

    On average a ticket matches 6 × 6 ÷ 49 = 0.73 numbers, and 43.6% of tickets match none. Every combination has the same chance, so choosing “random-looking” numbers changes nothing. The Lottery matches tab takes any pool size and any number of picks; bonus balls and prize tiers depend on each game’s own rules.

    More Than Two Kinds: Several Groups

    When the population has several kinds, the formula extends by multiplying one combination per group. A bag holds 10 red, 8 green and 6 yellow sweets. The chance that 6 drawn at random are exactly 2 of each colour is:

    C(10, 2) × C(8, 2) × C(6, 2) ÷ C(24, 6) = 45 × 28 × 15 ÷ 134,596 = 18,900 ÷ 134,596 = 675/4,807 ≈ 14.04%.

    This is the multivariate hypergeometric distribution. The Several groups tab handles up to 30 groups and shows the expected count from each (here 2.5 red, 2 green and 1.5 yellow), so you can see how far your target mix is from a typical draw.

    A Famous Test Built on It: Tasting Tea

    In The Design of Experiments (1935), Ronald Fisher described a test for a colleague, Muriel Bristol, who said she could tell whether milk or tea had been poured into the cup first. She was given 8 cups, 4 of each kind, and asked to pick the 4 milk-first cups.

    By pure guessing, she picks 4 of the 8 cups and matches all 4 with probability 1 ÷ C(8, 4) = 1/70. Exactly 3 correct happens with probability C(4, 3) × C(4, 1) ÷ 70 = 16/70, so 3 or more correct by luck has a chance of 17/70 = 24.3%. Fisher argued that only a perfect score gave strong evidence. According to accounts collected later, she identified all eight cups correctly.

    This setup is the hypergeometric behind Fisher’s exact test for 2 × 2 tables. The chi-square calculator runs that test alongside the chi-square for small tables.

    Mean and Spread

    The expected number of successes is n × K ÷ N, the same as with replacement. The standard deviation is smaller:

    SD = √(n × (K/N) × (1 − K/N) × (N − n) ÷ (N − 1))

    For the deck: mean = 7 × 4 ÷ 60 = 0.467 copies; SD = √(7 × 0.0667 × 0.9333 × 53/59) = 0.626. With replacement the SD would be 0.660. The calculator lists both moments, the most likely count and the range of possible counts.

    Hypergeometric Probabilities in Excel and Google Sheets

    Both use HYPGEOM.DIST(sample_s, number_sample, population_s, number_pop, cumulative):

    What you wantFormula (deck)Result
    Exactly 1 copy=HYPGEOM.DIST(1, 7, 4, 60, FALSE)0.3363
    At most 1 copy=HYPGEOM.DIST(1, 7, 4, 60, TRUE)0.9368
    At least 1 copy=1 - HYPGEOM.DIST(0, 7, 4, 60, TRUE)0.3995

    The argument order is easy to mix up: the sample comes before the population. Microsoft’s example (1 success in a sample of 4, 8 successes in a population of 20) gives 0.4654 cumulative and 0.3633 for exactly one, and this calculator returns the same values.

    Which Distribution Fits Your Draw?

    Your situationDistributionCalculator
    Draws from a fixed group, nothing put backHypergeometricthis page
    Fixed number of independent tries with the same chanceBinomialbinomial distribution calculator
    Draws put back after each oneBinomial with p = K ÷ Nbinomial
    Sample under about 5% of a large groupHypergeometric ≈ binomialeither
    Chance of one specific outcome or a simple combinationBasic countingprobability calculator
    Counting the hands themselves, not their chancesCombinationspermutation and combination calculator