Cards and Poker

Getting a Grip on Probability in Card Games

An introduction to the hypergeometric distribution for multi-card draws, with a checked 40 card deck example relevant to deck-building and collectible card games.

On this page
  1. When one card at a time is not enough
  2. The formula
  3. A worked example: a 40 card deck
  4. A cross-check by drawing one card at a time
  5. The expected number of copies
  6. Why not just use the binomial?
  7. Using it for other questions
  8. Keeping it in perspective

When one card at a time is not enough

Many card questions involve a group: how many copies of a key card will turn up in an opening hand, how many lands in the first ten cards, how many hearts in a bridge hand. The tool for these is the hypergeometric distribution. It describes how many “special” items you get when you draw several items from a finite pool without putting any back.

Multiplying probabilities card by card works for small cases, but it gets awkward when you want a total such as “exactly two” or “at least one.” The hypergeometric formula organises the counting.

The formula

Suppose the deck has N cards, of which K are the kind you care about (call them successes). You draw n cards. The probability of getting exactly k successes is:

P(k) = C(K, k) × C(N - K, n - k) / C(N, n)

Read it as counting hands:

  • C(K, k): ways to pick the k successes from the K available.
  • C(N - K, n - k): ways to fill the rest of the hand from the other cards.
  • C(N, n): all equally likely hands of n cards.

Here C(a, b) means the number of ways to choose b items from a without regard to order. This is the same counting idea behind combinations and permutations, applied to a deck with two kinds of card.

A worked example: a 40 card deck

As an illustration, imagine a 40 card deck containing 4 copies of a card you want, and an opening hand of 7 cards. Here N = 40, K = 4 and n = 7. Many deck-building games have similar sizes, but the numbers here are only an example.

Total hands. C(40, 7) = 18,643,560.

No copies. All 7 cards come from the other 36: C(36, 7) = 8,347,680. The chance of no copies is 8,347,680 / 18,643,560, which is about 0.4478, or 44.8%.

At least one copy. By the complement rule: 1 - 0.4478 = 0.5522, about 55.2%.

Exactly one copy. Choose the copy (4 ways) and 6 other cards from 36 (C(36, 6) = 1,947,792). That is 4 × 1,947,792 = 7,791,168 hands, so the probability is 7,791,168 / 18,643,560, about 0.4179, or 41.8%.

So even with four copies in the deck, roughly 45% of opening hands contain none. This often surprises players, and it is a plain consequence of the counts, not bad luck.

A cross-check by drawing one card at a time

You can verify the “none” result by multiplying the conditional probability of each step. The chance that the first seven cards avoid all four copies is:

36/40 × 35/39 × 34/38 × 33/37 × 32/36 × 31/35 × 30/34

Many terms cancel. What is left is (33 × 32 × 31 × 30) / (40 × 39 × 38 × 37) = 982,080 / 2,193,360, which is about 0.4478. The same answer from two methods is strong evidence the arithmetic is right.

The expected number of copies

The average number of successes in a hypergeometric draw is n × K / N. In the example, 7 × 4 / 40 = 0.7 copies per hand.

This is an average over many hands, not a prediction for any one hand. Individual hands will contain 0, 1, 2 or more copies, and the shape of that spread is exactly what the formula gives. The spread of a hypergeometric draw is slightly narrower than the one you would get from the binomial distribution with the same chances, because removing cards from a finite deck makes the results a little less variable.

Why not just use the binomial?

The binomial distribution assumes each draw has the same chance, as with repeated coin flips or drawing with replacement. For a 40 card deck, the chance of a copy changes after every card. Using the binomial would treat the deck as if each card were drawn and returned, which overstates the spread. For large decks and small hands the two are close, but for a 40 card deck and a 7 card hand the difference is real, so the exact method is worth using.

Using it for other questions

The same formula answers many deck questions once you identify N, K and n:

  • A 60 card deck with 24 resource cards and an opening hand of 7.
  • A 52 card deck, 13 hearts and a 5 card hand.
  • A game where you draw a fixed number of cards each turn from a shrinking deck.

Always check that the three parameters describe the same deck at the same moment. If cards have already left the deck, update N and K first. Also confirm the conditions: the draw must be random and without replacement, and the deck must be properly shuffled. Effects like partial shuffling or cards that stick together fall outside the formula.

Keeping it in perspective

Probabilities like these describe long-run frequencies across many shuffles. They cannot tell you what the next hand will be, and an unlucky hand does not make the next one luckier. In games played for money the same arithmetic does not remove the risk of loss, so treat these calculations as a way of understanding how decks behave and not as a route to winning.

The complete guide to cards and poker

Probability in Card Games: A Guide for Players
Read the guide

Keep exploring

Guides from other topics

All topics →