Jugami Statistics

Jugami › Statistics and Probability › Counting and Combinations

Statistics · Unit 11

Counting and Combinations

How many ways? Count them fast, and the probability follows.

In Probability you met the multiplication principle, permutations, combinations and a 6-from-49 lottery. This unit goes further. You'll see why 0! = 1, count arrangements with repeated letters, build Pascal's triangle and read the binomial coefficients from it. Then you'll use counting to work out real lottery odds, the birthday problem and poker hands.

The top six rows of Pascal's triangle in hexagon-shaped cells, with the entry 10 in gold and the two entries above it, 4 and 6, in rose, beside five white lottery balls and a red one. How many ways? 11112113311464115101051 71933486111 4 + 6 = 10: each entry is the sum of the two above.

1 in 292,201,338

Powerball's official prize chart gives the odds of winning the grand prize with one $2 play as 1 in 292,201,338. Where does such an exact number come from? Nobody played the game 292 million times to find out. It comes from counting.

To play, you pick five different white-ball numbers from 1 to 69 and one red Powerball number from 1 to 26. The five white balls can match in any order; the red ball must match exactly. So the count is:

(ways to choose 5 of 69) × (ways to choose 1 of 26) = 11,238,513 × 26 = 292,201,338

By the end of this unit you'll be able to find the 11,238,513 yourself, and the odds of the other prizes too. The same tools answer questions that have nothing to do with lotteries: how many passwords, how many committees, how likely two people in your class share a birthday.

What you already know

From Probability: when outcomes are equally likely, P(event) = (number of outcomes in the event) ÷ (total number of outcomes). So hard probability questions are often counting questions. You've also seen three counting tools:

This unit adds the reasons behind these formulas, the cases they don't cover, and bigger examples.

The multiplication principle, again

The principle works for any number of steps, as long as the number of choices at each step doesn't depend on what was picked before.

A useful trick is counting the complement. How many 4-digit PINs have at least one repeated digit? Counting those directly is messy. It's all PINs minus those with no repeats: 10,000 − 5,040 = 4,960.

Factorials

The number of ways to line up n different things is n × (n − 1) × … × 2 × 1, written n! (“n factorial”). Five books on a shelf: 5! = 120 orders. Factorials grow very fast: 10! = 3,628,800, and 52! (the orders of a shuffled deck) is about 8 × 10⁶⁷.

Why is 0! = 1? There is exactly one way to arrange nothing: do nothing. It also keeps the pattern working. Since n! = n × (n − 1)!, we get 1! = 1 × 0!, so 0! must be 1. And it makes formulas like ₙCₙ = n! ÷ (n! × 0!) = 1 come out right.

Factorials let us write permutations compactly: ₙPₖ = n! ÷ (n − k)!. The (n − k)! cancels the factors we don't use. For 8 runners and 3 medals, 8! ÷ 5! = 8 × 7 × 6 = 336.

Arrangements with repeats

How many different “words” can you make from the letters of BOOK? If the two O's were different (O₁ and O₂), there would be 4! = 24 arrangements. But swapping O₁ and O₂ gives the same word, so each word was counted 2! = 2 times. The answer is 24 ÷ 2 = 12.

In general, n objects where one kind repeats a times, another b times, and so on, can be arranged in

n! ÷ (a! × b! × …) ways

Worked example: MISSISSIPPI. 11 letters: M once, I four times, S four times, P twice. Arrangements: 11! ÷ (1! × 4! × 4! × 2!) = 39,916,800 ÷ 1,152 = 34,650.

The same idea gives the combination formula. Choosing 3 of 8 people is like arranging 3 “in” labels and 5 “out” labels: 8! ÷ (3! × 5!) = 56.

Combinations and why they divide

ₙCₖ, also written as the binomial coefficient (n choose k), counts the ways to choose k of n things when order doesn't matter:

ₙCₖ = n! ÷ (k! × (n − k)!)

Every group of k can be put in order in k! ways, so the ordered count ₙPₖ is k! times too big. Dividing by k! fixes it.

Powerball's white balls. ₆₉C₅ = (69 × 68 × 67 × 66 × 65) ÷ 5! = 1,348,621,560 ÷ 120 = 11,238,513. Times 26 red-ball choices gives the official 292,201,338.

Pascal's triangle

Write 1 at the top. Each row starts and ends with 1, and every other entry is the sum of the two entries above it. Row n (counting the top row as row 0) lists ₙC₀, ₙC₁, …, ₙCₙ.

Why the sum rule works: to choose k of n people, single out one person, Ana. Either Ana is chosen (then pick k − 1 of the other n − 1) or she isn't (pick all k from the other n − 1). So ₙCₖ = ₙ₋₁Cₖ₋₁ + ₙ₋₁Cₖ.

The triangle gives the binomial coefficients: the numbers in (a + b)ⁿ. For example, (a + b)⁴ = a⁴ + 4a³b + 6a²b² + 4ab³ + b⁴, using row 4: 1, 4, 6, 4, 1. They're the same numbers as in the binomial distribution: the chance of exactly k heads in n fair coin flips is ₙCₖ ÷ 2ⁿ. Adding a whole row gives 2ⁿ, the number of possible subsets.

Lottery odds

Counting also gives the smaller prizes. Take “match all 5 white balls but not the Powerball”. You must pick the 5 winning white numbers (1 way out of 11,238,513) and one of the 25 losing red numbers:

P = (1 × 25) ÷ 292,201,338 = 1 in 11,688,053.52

That matches the official chart, which lists 1 in 11,688,053.52 for the $1 million prize. Here's a harder one: match exactly 4 white balls and the Powerball. Choose 4 of the 5 winning white numbers (₅C₄ = 5), 1 of the 64 losing ones (64), and the 1 winning red number:

5 × 64 × 1 = 320 tickets, so P = 320 ÷ 292,201,338 = 1 in 913,129.18

That's the official odds for the $50,000 prize. Every line of the chart can be checked this way.

A sense of scale: buying 100 tickets for every drawing, three drawings a week, you'd expect to wait about 292,201,338 ÷ 300 ≈ 974,000 weeks, roughly 18,700 years, for a jackpot.

The birthday problem

How many people must be in a room before there's a better than even chance that two share a birthday? Most people guess around 183. The answer is 23.

Assume 365 equally likely birthdays (ignore February 29 and seasonal patterns). The trick is the complement: count the ways that everyone's birthday is different.

For n = 23 this is 1 − 0.4927 ≈ 0.507. With 50 people it's about 0.970, and with 70 about 0.999. The surprise comes from the number of pairs: 23 people make ₂₃C₂ = 253 pairs, and any one of them can match.

Poker hands

A poker hand is 5 cards from a 52-card deck, and order doesn't matter, so there are ₅₂C₅ = 2,598,960 hands. Count a hand type, divide by this, and you have its probability.

Counting three poker hands
HandCount it step by stepHandsProbability
Four of a kindRank of the four (13) × the fifth card (48)624≈ 0.00024
Full houseRank of the three (13) × ₄C₃ suits (4) × rank of the pair (12) × ₄C₂ suits (6)3,744≈ 0.00144
Flush (not straight)Suit (4) × ₁₃C₅ ranks (1,287), minus the 40 straight flushes5,108≈ 0.00197

This is why a full house beats a flush: there are fewer of them. Notice the full house uses 12, not 13, for the pair, because the pair can't be the same rank as the three.

Which tool?

Choosing a counting method
QuestionMethodExample
Separate steps, repeats allowednᵏ4-digit PIN: 10⁴
Order matters, no repeatsₙPₖ = n! ÷ (n − k)!President, VP, treasurer from 10
Order doesn't matterₙCₖ = n! ÷ (k!(n − k)!)Committee, lottery ticket, poker hand
Arrange letters with repeatsn! ÷ (a! b! …)MISSISSIPPI
“At least one”1 − P(none)Birthday problem

Common mistakes

Practice

History

Quiz

Ten questions. Pick an answer for each, then check.

1. A 4-digit PIN uses the digits 0–9, and digits may repeat. How many PINs are possible?

2. What is 0! (zero factorial)?

3. Twelve runners race. In how many ways can gold, silver and bronze be awarded?

4. How many ways can 4 students be chosen from 10 for a team?

5. How many different arrangements are there of the letters in BOOK?

6. Row 5 of Pascal's triangle is 1, 5, 10, 10, 5, 1. What is the third entry (position 2) of row 6?

7. Powerball picks 5 white balls from 69 in any order and 1 red ball from 26. Why is the jackpot count ₆₉C₅ × 26?

8. With 23 people and 365 equally likely birthdays, the chance that at least two share a birthday is about

9. Why do we usually find P(at least one shared birthday) as 1 − P(all different)?

10. There are 2,598,960 five-card hands and 3,744 full houses. A full house counts 13 × 4 × 12 × 6. Why 12, not 13?

Talk about it

Sources