Counting and Combinatorics

The Pigeonhole Principle in Games

How simple counting can guarantee outcomes, such as matching socks, repeated suits in a hand and shared birthdays, with checked examples and clear limits.

On this page
  1. A guarantee, not a probability
  2. Socks in the dark
  3. Suits in a hand
  4. The generalised version
  5. Dice and sums
  6. Birthdays
  7. Where the principle stops
  8. Design and puzzle uses

A guarantee, not a probability

Most of probability tells you how likely something is. The pigeonhole principle is different: it tells you that something must happen, with no luck involved, just from counting.

The statement is simple. If you place more than n items into n containers, at least one container holds two or more items. The name comes from imagining pigeons and the pigeonholes they roost in: 11 pigeons in 10 holes means some hole has at least two.

Socks in the dark

A drawer holds loose socks in only two colours, black and white, and you pull them out without looking. How many do you have to take to be sure of a matching pair?

Two colours act as two containers. Take three socks and, whatever the colours, at least two share a colour. Taking only two socks does not guarantee it, since you might get one of each. So the answer is 3.

Notice the careful wording: this is the minimum number that guarantees a pair in the worst case. You may get a pair sooner by luck, but luck is not what the principle relies on.

Suits in a hand

A standard deck has 4 suits. Deal 5 cards, and treat the suits as 4 containers. Five cards into 4 suits means at least two cards share a suit, always, whatever the shuffle. That follows from counting alone.

Similarly, there are 13 ranks. Deal 14 cards from a full deck and at least two share a rank. Deal 5 cards and no rank is guaranteed to repeat, since 5 is fewer than 13, and indeed many five-card hands have five different ranks.

This is the kind of fact that is sometimes mistaken for probability. Statements like “a five-card hand will always contain at least two cards of one suit” are certain, while statements like “a hand will contain a pair” are matters of chance. The count of hands that avoid a repeated rank is part of the analysis in the article on five card hands.

The generalised version

If N items go into k containers, at least one container holds at least ⌈N ÷ k⌉ items, where ⌈ ⌉ means round up to the next whole number.

Examples:

  • 9 cards, 4 suits: 9 ÷ 4 = 2.25, rounded up to 3. So some suit has at least 3 cards. Eight cards could be split 2-2-2-2, so 9 is the smallest number that forces three of a suit.
  • How many cards guarantee five of one suit? The worst case is 4 cards from each suit with none reaching five: 4 × 4 = 16 cards. One more makes 17, and then some suit must have 5. So 17 cards guarantee five of a suit. (That is a guarantee about a pile of cards, not a prediction about any deal.)

A useful approach for “how many to guarantee” questions: build the worst case that still avoids what you want, count it, then add one.

Dice and sums

Roll 7 six-sided dice. Each shows one of 6 faces, so at least two dice show the same face. With 6 dice this need not happen, because they could show 1, 2, 3, 4, 5 and 6, each once.

Two dice produce sums from 2 to 12, which is 11 possible totals. If you roll two dice 12 times, at least two of the rolls give the same total. This does not say which total, and it says nothing regarding how likely each total is. For likelihoods, see two dice totals, where seven turns up most often because it has the most ways to occur.

Birthdays

There are 366 possible birthdays if you include 29 February. Gather 367 people and, whatever their birthdays, at least two must share one. That is the pigeonhole principle, and it is certain. By contrast, the birthday problem asks how many people are needed to make a shared birthday more likely than not, which is a probability question with a much smaller answer and needs different tools. The two are easily confused: one is a guarantee, one is a chance.

Where the principle stops

The principle says a repeat must exist but not which one, how likely a given repeat is, or how soon it will appear. It cannot, for example, tell you what card is coming next, and it does not give any way to predict a result in a game of chance. Each shuffle and each roll remains independent, and thinking otherwise is the gambler’s fallacy.

It can also tempt people into overreading. “Five cards must include two of a suit” is a statement about a five-card set. It says nothing about the particular cards still in the deck, and it does not mean a missing suit is “due”.

Design and puzzle uses

Because it is a guarantee, the principle is handy in puzzle and game design. If a game has only 4 possible colours for tokens, any group of 5 tokens includes a colour repeat, whatever the shuffle. Designers can rely on that for rules that must always be satisfiable. It is also a standard tool in the wider set of counting principles for proving that a situation cannot be avoided, and the same style of reasoning appears in discussions of probability puzzles.

As with other card and dice topics, these are mathematical ideas, not strategies. Casino games carry a house edge, gambling can be harmful, and anyone worried about their own play can reach out to a local support service.

The complete guide to counting and combinatorics

Counting Principles Every Probability Learner Needs
Read the guide

Keep exploring

Guides from other topics

All topics →