epochs

Learn · Module 15 · Statistics and experiments · Lesson 1 of 5

Probability puzzles

A handful of probability puzzles come up again and again in data and ML work. Each has a trick worth knowing.

3 minute read

In short
  • 'At least one' is usually easiest as 1 minus 'none'.
  • For rare events, false positives can outnumber true positives; count with a concrete population.
  • The average number of tries until success is 1 ÷ probability.

Four classics

  1. 1
    At least one head in 3 coin flips

    Trick: work out the opposite. The only way to get no heads is tails three times.

    1 − (1/2)³ = 1 − 1/8 = 0.875
  2. 2
    A positive medical test

    A disease affects 1% of people. The test catches 99% of cases, but also flags 5% of healthy people. You test positive. How likely are you to have it?

    sick and positive:    0.01 × 0.99 = 0.0099
    healthy and positive: 0.99 × 0.05 = 0.0495
    chance you're sick:   0.0099 ÷ (0.0099 + 0.0495) = 0.167
  3. 3
    How many rolls, on average, to get a six?

    For something with probability p per try, the average number of tries is 1/p.

    1 ÷ (1/6) = 6 rolls
  4. 4
    The birthday problem

    In a room of 23 people, chance that two share a birthday. Trick again: compute the chance all birthdays differ, then take the opposite.

    1 − (365/365 × 364/365 × … × 343/365) = 0.507

The medical test surprises most people: a 99%-accurate test, and only a 1 in 6 chance you're sick. Because the disease is rare, false alarms from the 99% of healthy people outnumber the true cases. The same logic explains why fraud and spam detectors produce many false alarms.

Your turn

A test for a rare condition (1 in 1,000 people) catches every real case and has a 1% false-positive rate. Roughly how likely is a positive person to have the condition?

Habits that prevent mistakes

Decide your approach before calculating: 'It's easier to find the chance of none, then subtract from one.' Write the numbers for a concrete population, like 1,000 people, which makes Bayes problems much easier to explain. Sanity-check the answer: is it between 0 and 1, and does its size make sense?

Common mistakes

  • Adding the chances, 1/6 four times, which gives 4/6 and would exceed 1 with seven rolls.
  • Forgetting to state that the rolls are independent.
  • Jumping to a formula without explaining the 'opposite event' idea.
Check yourself

Answer in your own words, out loud or on paper, before you open the model answer.

What's the probability of at least one six in four rolls?

It's easiest to work out the opposite: the chance of no six at all, then subtract from one. On one roll, the chance of not getting a six is 5/6. The rolls are independent, so for four rolls it's 5/6 multiplied four times, which is 625 over 1,296, about 0.482. So the chance of at least one six is 1 minus 0.482, about 0.518, or just under 52%. A common mistake is to add 1/6 four times to get 4/6; that double-counts cases with more than one six, and with seven rolls it would give a probability above one, which is impossible. The 'one minus none' trick works for most 'at least one' questions.

More to think about
  • A test is 99% accurate for a disease affecting 1% of people. You test positive. What's the chance you have it?
  • How many people do you need for a 50% chance of a shared birthday?

Go further

Was this lesson clear?