Probability is the one area of mathematics where our gut feelings are most reliably wrong. Two famous puzzles, the Monty Hall problem and the birthday problem, have fooled students, teachers and even professional mathematicians. Working through them carefully is one of the best ways to sharpen your understanding of conditional probability and counting.
The Monty Hall Problem
The puzzle is named after Monty Hall, host of the American television game show Let's Make a Deal. In its standard form:
- There are three closed doors. Behind one is a car; behind the other two are goats.
- You pick a door, say Door 1.
- The host, who knows where the car is, opens one of the other doors to reveal a goat. He always does this, and if he has a choice, he picks at random.
- He then offers you the chance to switch to the remaining closed door.
Should you switch?
Most people reason: "Two doors are left, so it is 50-50. Switching makes no difference." This is wrong. Switching wins the car with probability \( \tfrac{2}{3} \).
A Simple Way to See It
When you first choose, you have a \( \tfrac{1}{3} \) chance of picking the car and a \( \tfrac{2}{3} \) chance of picking a goat.
- If you picked the car (probability \( \tfrac{1}{3} \)), switching loses.
- If you picked a goat (probability \( \tfrac{2}{3} \)), the host must open the other goat door, so the remaining door must hide the car. Switching wins.
So switching wins exactly when your first pick was wrong, which happens two times out of three. The host's action is not random: he is forced to avoid the car, and that gives you information.
Worked Example 1: Monty Hall with Bayes' Theorem
Let's confirm this formally. You choose Door 1, and the host opens Door 3. Let \( C_i \) be the event "the car is behind door \( i \)" and \( H_3 \) be "the host opens Door 3".
Prior probabilities: \( P(C_1) = P(C_2) = P(C_3) = \tfrac{1}{3} \).
Likelihoods of the host opening Door 3:
- If the car is behind Door 1, the host may open Door 2 or 3 at random: \( P(H_3 \mid C_1) = \tfrac{1}{2} \).
- If the car is behind Door 2, the host must open Door 3: \( P(H_3 \mid C_2) = 1 \).
- If the car is behind Door 3, he cannot open it: \( P(H_3 \mid C_3) = 0 \).
Total probability of \( H_3 \):
$$ P(H_3) = \frac{1}{3}\cdot\frac{1}{2} + \frac{1}{3}\cdot 1 + \frac{1}{3}\cdot 0 = \frac{1}{6} + \frac{1}{3} = \frac{1}{2} $$
Bayes' theorem for staying:
$$ P(C_1 \mid H_3) = \frac{P(H_3 \mid C_1)P(C_1)}{P(H_3)} = \frac{\frac{1}{2}\cdot\frac{1}{3}}{\frac{1}{2}} = \frac{1}{3} $$
Bayes' theorem for switching:
$$ P(C_2 \mid H_3) = \frac{P(H_3 \mid C_2)P(C_2)}{P(H_3)} = \frac{1\cdot\frac{1}{3}}{\frac{1}{2}} = \frac{2}{3} $$
Switching doubles your chance of winning.
The 100-Door Version
If you are still unconvinced, imagine 100 doors. You pick one. The host, knowing where the car is, opens 98 goat doors, leaving your door and one other. Would you stick with your original 1-in-100 guess? The other door now carries a probability of \( \tfrac{99}{100} \).
A Famous Controversy
The problem was posed by the statistician Steve Selvin in 1975, but it became famous in 1990 when Marilyn vos Savant answered it in her Parade magazine column and said "switch". She received thousands of letters, many from people with PhDs, insisting she was wrong. Even the great Paul Erdős reportedly remained unconvinced until he was shown a computer simulation. She was right.
A Crucial Detail
The answer depends on the host's behaviour. If the host opened a door at random and happened to reveal a goat, switching would genuinely be a 50-50 choice. The \( \tfrac{2}{3} \) answer relies on the host knowing where the car is and always revealing a goat. Probability problems must state their assumptions precisely.
The Birthday Problem
How many people must be in a room for there to be a better than even chance that two share a birthday? Many people guess around 183, half of 365. The real answer is just 23.
We ignore leap years and assume all 365 birthdays are equally likely.
Worked Example 2: Computing the Probability for 23 People
It is easier to find the probability that no two people share a birthday, then subtract from 1.
Line people up one at a time:
- Person 1 can have any birthday: \( \tfrac{365}{365} \).
- Person 2 must avoid person 1's birthday: \( \tfrac{364}{365} \).
- Person 3 must avoid both: \( \tfrac{363}{365} \).
- Continue until person 23, who must avoid 22 birthdays: \( \tfrac{343}{365} \).
Multiply these together:
$$ P(\text{no match}) = \frac{365}{365}\times\frac{364}{365}\times\frac{363}{365}\times\cdots\times\frac{343}{365} $$
Calculating the product gives approximately 0.4927. Therefore
$$ P(\text{at least one match}) = 1 - 0.4927 = 0.5073 $$
just over 50%.
Why Is It So Small?
The key is that we are not asking whether someone shares your birthday. Any pair will do. With 23 people, the number of pairs is
$$ \binom{23}{2} = \frac{23 \times 22}{2} = 253 $$
Each pair has a \( \tfrac{1}{365} \) chance of matching, and with 253 chances the odds add up quickly. A useful approximation is
$$ P(\text{no match}) \approx e^{-n(n-1)/(2 \times 365)} $$
For \( n = 23 \): \( e^{-253/365} = e^{-0.693} \approx 0.500 \), confirming the result.
The probability rises steeply:
| People | Chance of a shared birthday |
|---|---|
| 23 | 50.7% |
| 30 | 70.6% |
| 50 | 97.0% |
| 70 | 99.9% |
A typical school class of 30 has a better than 70% chance of containing a shared birthday.
Real-World Use: Hash Collisions
The birthday problem is vital in computer security. A hash function turns data into a fixed-length code. If codes have \( N \) possible values, a collision becomes likely after only about \( \sqrt{N} \) attempts, not \( N \). This "birthday attack" is why cryptographic hashes need very long outputs: a 128-bit hash can be attacked with roughly \( 2^{64} \) tries.
Did You Know?
- The birthday problem is often credited to Richard von Mises, who discussed it in 1939.
- Real birthdays are not uniformly spread, and uneven distributions actually make shared birthdays slightly more likely, not less.
- Pigeons have been shown in experiments to learn the switching strategy in Monty Hall-style tasks more readily than many humans.
Key Takeaways
- In the Monty Hall problem, switching wins with probability \( \tfrac{2}{3} \) because the host's choice is informed.
- Bayes' theorem confirms the answer formally, and the result depends on the host's exact rules.
- In the birthday problem, 23 people give a 50.7% chance of a shared birthday.
- Count the complement ("no match") and remember that the number of pairs grows like \( n^2 \).
- These ideas matter in practice, from medical testing to cryptography.
Want help with probability, Bayes' theorem or statistics assignments? Amathify's experts and PhD scholars provide step-by-step solutions via WhatsApp or the Ask a Question form.
Stuck on a problem or assignment?
Our experts and PhD scholars solve maths, physics and chemistry — step by step.