Free preview
74 lessons
Essential Probability & Statistics for ML
Free preview
Essential Probability & Statistics for ML · 74 lessons
No surprise gaps
Actually remember it
Skip what you know
One subscription. All learning paths included.
Our content is best on a larger screen
The probability of no match
The birthday problem is a famous probability puzzle: how many people must be in a room before it is more likely than not that two of them share a birthday? The answer surprises most people, and the method behind it applies well beyond birthdays.
We start with three people. How likely is it that no two of them share a birthday?
We take each person's birthday to be equally likely to fall on any of days, which is a close approximation to real birthdays.
An outcome lists the three birthdays in order, one per person, and a day can appear more than once. That is an ordered sample of size from days with replacement, so
No match means the three birthdays are all different. The first person can have any of days, the second any of the left and the third any of the left. That is the count of ordered samples without replacement, so
Nothing here depends on there being three people or days.
Theorem
For people whose birthdays are equally likely to fall on any of days, with ,
The same count applies whenever each of things is equally likely to land in any of places, such as people's birth months (). In that general setting, a match is called a collision.
Five people each pick a whole number from to at random, every number equally likely. Let be the event that no two people pick the same number. Write as a ratio of counts.
Solution
Each person is equally likely to pick any number, so every outcome is equally likely and
Here counts the people and the numbers:
An outcome lists the number each of the five people picks, in order, and a number can be picked more than once, so:
The outcomes in are those where the five people pick five different numbers. The first person can pick any of the numbers, the second any of the left, and so on down to the fifth, who has left:
Dividing the second count by the first:
Practice questions
4 questions
Four people are chosen at random, and each person's birthday is equally likely to fall on any of days. Which expression gives ?
Select the correct answer:
+ 3 more questions
A match with a given person
We've seen how to find the probability that no two people in a group share a birthday. A different question is how likely it is that someone shares one particular person's birthday, say Ana's.
Picture Ana in an empty room, with the others arriving one at a time. For no one to share Ana's birthday, each new arrival only has to avoid Ana's day, so every one of them has of the days available.
Suppose the group has people: Ana and others. Ana's birthday is already set, so an outcome lists the birthdays of the others, and
The bottom counts every outcome for the others, and the top counts the outcomes in which each of them avoids Ana's day.
By the complement strategy,
Nothing here depends on birthdays. Each person is a draw from days and Ana's is the first, so the same count works for any ordered sample.
Theorem
In an ordered sample of size drawn with replacement from values, all samples equally likely, the probability that at least one of the later draws collides with the first is
In words: each of the later draws has values out of that avoid the first draw's value, and a collision is the complement of all of them avoiding it.
Leo and three friends compare birth months, each equally likely to be any of the months. Find the probability that at least one friend shares Leo's month.
Solution
Every outcome is equally likely, so we find the probability that no friend shares Leo's month by counting outcomes.
Leo's month is fixed, so an outcome lists the months of the three friends, each one of :
No friend shares Leo's month when each friend avoids that one month. Each friend has the same months left:
Dividing the second count by the first:
By the complement strategy,
Practice questions
4 questions
Ravi is in a room with other people, and each person's birthday is equally likely to fall on any of days. Which expression gives the probability that at least one of the others shares Ravi's birthday?
Select the correct answer:
+ 3 more questions
Any match versus a match with a given person
Back to the puzzle: how many people does a room need before a shared birthday is more likely than not? More likely than not means a probability greater than , so we want the smallest number of people for which .
How does a match between any two people compare with a match with Ana? By the complement strategy, . The graph shows it in blue for each number of people , with a match with Ana in green.
Drag the red point
A match between any two people passes at . In the same group, the chance that someone shares Ana's birthday is only about .
Why the gap? To have no match with Ana, each new arrival only needs to avoid her one day, so every arrival has safe days. To have no match at all, each arrival must avoid every birthday already in the room, so the safe days shrink: , then , down to for the rd person.
| Event | Days each person can have, in turn | |
|---|---|---|
| Any two people share a birthday | ||
| Someone shares Ana's birthday |
Details
Zoe and four friends each spin a spinner with equal sections, numbered to . Which is more likely: that at least one friend lands on Zoe's number, or that at least two of the five land on the same number?
Solution
For a match with Zoe, her number is fixed and each of the other people has numbers that avoid it:
For a match between any two of the five, no match means five different numbers. The first person has numbers, the second the left, and so on down to for the fifth:
By the complement strategy,
A match between any two of the five is about twice as likely, because it can come from any of the pairs of people, not only the pairs that include Zoe.
Practice questions
4 questions
A class has students, and each student's birthday is equally likely to fall on any of days. Which expression gives the probability that at least two students share a birthday?
Select the correct answer:
+ 3 more questions