When outcomes are equally likely, a probability is a ratio of two counts, and the counts are rarely small enough to list. This lesson builds the three tools that do the counting, checks them against a deck of cards, and then uses them on a question whose true answer almost nobody guesses within a factor of two.
Choices in sequence
Everything here rests on one observation. If a first choice can be made in ways and, for each of those, a second in ways, then the pair can be made in ways. Lay the possibilities out as a rectangular grid with rows and columns and the claim is just the area of a rectangle. Extend to any number of stages and it becomes the product rule: multiply the number of options at each stage, provided the number of options at each stage does not depend on which options were taken earlier.
That proviso is the whole art. Two dice give sequences because the second die does not care what the first did. A four-character password from the lowercase letters gives , again because letters may repeat. But drawing two cards from a deck gives ordered pairs, not , because the second draw has one fewer option: the count at each stage changed, though crucially it changed by the same amount regardless of which card went first, and that is enough for the rule to apply.
Sampling with replacement leaves the pool intact and gives sequences of length . Sampling without replacement shrinks it and gives , a product of falling terms. When the second product uses up the whole pool and is written , read " factorial", with by the convention that there is exactly one way to arrange nothing.
Ordered selections
The falling product has a name. The number of permutations of items chosen from distinct items, where order matters and nothing is reused, is
The second form is the first with the unused tail divided away, which is often the easier thing to compute. The five-card deal from a shuffled deck, if you insist on tracking the order they arrived in, gives possibilities.
Repeated items collapse the count. The letters of MISSISSIPPI can be arranged in ways if the letters are all treated as distinct, but the four S's are not distinguishable, so every genuine arrangement has been counted times over on their account, and likewise for the I's and for the P's. Divide those out:
That division, cancelling the orderings you did not want to distinguish, is the single most useful move in combinatorics, and the next section is nothing but the same move applied once.
Unordered selections
A poker hand is a set of five cards, and the order it was dealt in is nobody's business. Each such set of five was counted times among the ordered deals, once for each arrangement of the same five cards. So the number of distinct hands is that figure divided by , giving .
In general the number of ways to choose items from when order is irrelevant is written , read " choose ", and
Two properties are worth carrying. First, , because choosing which to take is the same act as choosing which to leave. Second, : fix any one item, and every selection either includes it, which leaves to pick from the other , or excludes it, which leaves to pick from the other . That identity generates Pascal's triangle row by row, and it will return in the lesson on the binomial distribution.
Example. A lottery draws numbered balls from , order irrelevant. What is the probability that one particular ticket matches all six?
The number of possible draws is , and exactly one is the ticket, so the probability is . Buying one ticket a week, the expected wait for a win is about years.
Now you. How many ways are there to choose a committee of people from a group of , and what is the probability that a randomly chosen committee contains one particular person?
Answer
committees. Those containing the given person are the committees made by adding two others from the remaining nine, so there are , and the probability is . Equivalently, the person occupies one of places and are taken, so .
Poker as a test bench
A ranked list of poker hands is a good check on the machinery, because the ranking was fixed by players long before anyone computed it, and the counts must come out in the same order.
Take two pair. Choose the two ranks that will be paired: ways. Choose two suits for each of them: ways each, so . The fifth card must avoid both chosen ranks, leaving cards. That gives hands, and
Note the order of the two ranks was never used, which is why and not appears. Choosing "kings and threes" is the same hand as choosing "threes and kings", and counting it twice would double the answer.
Now a flush. Choose a suit, ways, then any five of its cards, ways, giving . Of those, are also straights and are ranked higher, so a plain flush has hands and probability . Two pair is about times commoner than a flush, and duly ranks below it. The same method gives full houses () and four-of-a-kinds (), and the ranking players arrived at by experience is exactly the ranking these counts produce.
Example. How many five-card hands are three of a kind, meaning exactly three cards of one rank and two other cards of two different ranks?
Pick the tripled rank in ways and its three suits in ways. The other two cards must be of two distinct ranks, neither equal to the first: choices of ranks, and choices of suit. That gives hands, a probability of about .
Now you. How many five-card hands contain exactly one pair, meaning two cards of one rank and three others of three different ranks?
Answer
hands, a probability of about . Nearly half of all hands, which is why one pair is worth almost nothing.
The birthday problem
Take people at random. What is the probability that two of them share a birthday? The usual guess is a few percent, on the grounds that is small next to . The right answer is slightly over one half.
Count the complement, as always. Ignore leap years and assume all days equally likely, an assumption examined below. Sequences of birthdays number , all equally likely. Those with no repeat are ordered selections without replacement, , so
and the probability of at least one shared birthday is .
The reason intuition fails is that people compare with , when the right comparison is with the number of pairs. Twenty-three people form pairs, and against no longer looks small. Each pair matches with probability , so the union bound of the previous lesson caps the answer at , which is loose but already in the right neighbourhood, and it is loose in the right direction: the pairs overlap heavily, since any three people share three pairs among them.
The curve climbs fast. Ten people give , thirty give , fifty give . The real-world assumption of uniform birthdays is not quite true, with seasonal peaks and a deficit around late December in many countries, but the effect only ever pushes the probability up, since any unevenness makes coincidences commoner. The figure is therefore a safe upper bound on the number of people needed.
Example. What is the probability that among people at least two share a birthday?
Multiply the falling ratios: , so the answer is , about one chance in nine. Small, but far larger than the that a careless comparison suggests.
Now you. Four fair dice are rolled. What is the probability that at least two show the same number?
Answer
The same structure with in place of : , so at least one repeat has probability .
What counting assumes, and when it stops working
Every calculation above began by declaring a set of equally likely outcomes and then measuring a subset of it. That is a strong assumption, and it is doing more work than the algebra. If the deck is not well shuffled, or the birthdays are not uniform, or the lottery machine favours a ball, the counts are still right and the probabilities are wrong. Counting is a technique for evaluating a model, not evidence that the model is correct.
There is a second and sharper limit. The whole method treats the sample space as intact: all hands are live, all birthday sequences are live. The moment any information arrives, most of them are not. Told that the first two cards dealt are aces, the remaining possibilities are a much smaller set, and the probability of four of a kind is no longer . Told that one person in the room was born in March, the birthday calculation changes.
Recounting from scratch after every piece of news is unworkable, and it is also unnecessary, because the effect of information on a probability follows one rule that can be derived once. Deriving it, and finding that it makes independence into a definition rather than a feeling, is the next lesson.