几个反直觉的概率问题
Info
已完成网站教程、网站习题、配套插件中所有多语言代码的校准,解决了之前 chatGPT 翻译可能出错的问题~
In the previous article Discussing Random Algorithms in Games, we talked about the Monte Carlo method for verifying probability algorithms. Today, let's dive into some lighter content: a few interesting problems related to probability.
There are two simplest principles for calculating probability:
Principle One: To calculate probability, you must have a reference frame called the "sample space," which includes all possible outcomes of a random event. The probability of event A occurring = Number of sample points in A / Total number of sample points in the sample space.
Principle Two: When calculating probability, it's crucial to understand that probability is a continuous whole. You cannot split continuous probability, which is known as conditional probability.
We learned these two principles in high school, but we still easily make mistakes. Interestingly, the process of making these mistakes often follows a similar pattern:
First, we overlook Principle Two and incorrectly calculate the sample space. Then, using Principle One, we arrive at the wrong answer.
Next, let's explore a few simple yet deceptive problems: the Boy or Girl problem, the Birthday Paradox, and the Monty Hall problem. Of course, the Monty Hall problem is probably the most familiar to everyone, so we'll delve into some interesting thoughts about it.
I. The Boy-Girl Problem
Imagine a family with two children. You are told that one of the children is a boy. What is the probability that the other child is also a boy?
Many people, including myself, might instinctively answer: 1/2, because the other child could either be a boy or a girl, with equal probability. However, the correct answer is actually 1/3.
Why is the initial thought wrong? It's because the sample space was not correctly calculated, leading to a mistake in the principle of probability calculation. With two children, the sample space consists of 4 possibilities: older brother and younger sister, older brother and younger brother, older sister and younger sister, and older sister and younger brother. Knowing that one child is a boy eliminates the older sister and younger sister scenario, reducing the sample space to 3. Only one of these scenarios involves both children being boys (older brother and younger brother), so the probability is 1/3.
Why does the calculation of the sample space often go wrong? It's because we overlook conditional probability, confusing the following two questions:
- If a family has only one child, what is the probability that the child is a boy?
- If a family has two children, and one of them is a boy, what is the probability that the other child is also a boy?
According to the second principle, probability problems are continuous, and these two questions should not be confused. The second question requires the use of conditional probability, which is the probability of one child being a boy given that the other child is a boy. Applying the formula for conditional probability makes this calculation straightforward.
Through this problem, readers should understand the relationship between the two principles of probability calculation. The most misleading aspect is the neglect of conditional probability. To avoid being misled, the simplest method is to enumerate all possible outcomes.
Finally, I've encountered a rather odd objection to this problem: What if the two children are twins and there is no age difference between them?
I must admit, there seems to be a hint of logic in this! However, we use age difference to represent the independence of the two children. Even if the children are of the same gender, there are still two distinct possibilities. So, let's not use twins as a counterargument.
II. Birthday Paradox
The Birthday Paradox arises from the question: How many people need to be in a room for there to be at least a 50% chance that two people share the same birthday?
The answer is 23 people. This means that if there are 23 people in a room, there is a 50% chance that at least two of them will have the same birthday. This conclusion seems不可思议 (incredible), hence the term "paradox." Intuitively, one might think that to reach a 50% probability, there should be at least 183 people, since there are 365 days in a year. However, this is not the case. The disbelief in this conclusion stems from two common misconceptions:
The first misconception is misunderstanding the word "exist."
Readers might think that if the probability of shared birthdays among 23 people is 50%, it means:
If there are 22 people in a room and I walk in, there's a 50% chance I'll find someone with the same birthday as mine. But how can that be?
This thinking is self-centered. The probability described in the problem refers to the group as a whole. The term "exist" means any two people among the 23, involving permutations and combinations, and likely has nothing to do with you personally.
If you want to calculate the probability of someone sharing your birthday, you can do it this way:
1 - P(all 22 people have different birthdays from mine) = 1 - (364/365)^22 ≈ 0.06
Doesn't this result seem more reasonable? The Birthday Paradox calculates probabilities for a group, not an individual, involving all possible permutations and combinations, which naturally sum to a higher probability.
The second misconception is thinking that probability changes linearly.
Readers might assume that if the probability of shared birthdays among 23 people is 50%, then for 46 people, the probability would be 100%.
This is not true. It's like a game with a 50% winning chance. If you play twice, does your winning chance become 100%? Obviously not. Your chance of winning at least once in two tries is 75%:
P(winning in two tries) = P(winning the first time) + P(not winning the first time but winning the second time) = 1/2 + 1/2 * 1/2 = 75%
The same logic applies to the Birthday Paradox. Probabilities do not simply add up; they involve a continuous process, so this conclusion is not unreasonable.
So why does the probability of shared birthdays among just 23 people exceed 50%? Let's first calculate the probability that all 23 people have unique birthdays. For one person, the probability of a unique birthday is 365/365
. For two people, it's 365/365 × 364/365
, and so on. The probability that all 23 people have unique birthdays is:
This calculates to about 0.493, so the probability of at least two people sharing a birthday is approximately 0.507, which is close to 50%. In fact, by this calculation, when the number of people reaches 70, the probability of shared birthdays rises to 99.9%, which is practically 100%. Therefore, from a probabilistic standpoint, it's not surprising at all for a small group of a few dozen people to have members with the same birthday.
Three, The Monty Hall Problem
This game is a classic: the participant faces three doors, behind two of which are goats, and behind one is a sports car. The participant can choose any door, and whatever is behind it becomes theirs (obviously, the sports car is more valuable). However, the host decides to help the participant: instead of immediately opening the chosen door, the host opens one of the remaining two doors, revealing a goat (the host knows what's behind each door), and then gives the participant a chance to switch doors. Should the participant switch or stick with their original choice?
To clarify for those seeing this problem for the first time, here's a more detailed description:
You are the participant. There are doors 1, 2, and 3. Suppose you randomly choose door 1, and then the host opens door 3, revealing a goat. Now, do you stick with your initial choice of door 1, or switch to door 2?
The answer is that you should switch. The probability of winning the car by switching is 2/3, while sticking with your original choice gives you a 1/3 chance. This might seem counterintuitive; it feels like the odds should be the same either way, since there are only two doors left, one with a goat and one with a car.
Similar to the boy-girl problem mentioned earlier, the simplest and most reliable method is to enumerate all possible outcomes:
It's clear that the probability of winning by switching is 2/3, while sticking with the original choice is 1/3.
There's an even simpler way to understand this: the host's action of opening a door effectively "concentrates" the probability. Initially, the chance of choosing the car is 1/3, and the probability that the car is behind one of the other two doors is 2/3. When the host eliminates a door with a goat, it's like concentrating that 2/3 probability onto the remaining unopened door. So, would you rather stick with your original 1/3 chance, or switch to the door with the "concentrated" 2/3 probability?
To make it more intuitive, imagine you initially choose one of three doors, and then 98 more doors with goats are added, making a total of 100 doors. If these are shuffled randomly, would you switch? Probably not, as it clearly dilutes the probability. Conversely, if you start with 100 doors, choose one, and the host eliminates 98 goat doors from the remaining 99, would you switch? Definitely, as your original door has a 1% chance, while the other door has a 99% chance. It's like choosing between one door and 99 doors.
Some readers might have thought through these ideas. Now, consider this: suppose, as you're deciding whether to switch, Xiao Ming bursts in and insists on making the choice for you. He knows nothing about what happened before and only sees two doors, one with a car and one with a goat. What's his probability of choosing the car?
Obviously, it's 1/2. This is why many people get the Monty Hall problem wrong. Similar to the birthday paradox, people often fall into the trap of a self-centered perspective, calculating the odds from Xiao Ming's viewpoint, which leads to a误区 (misunderstanding).
It's like having two boxes: box one has 4 black balls and 2 red balls, and box two has 2 black balls and 4 red balls. If you randomly choose a box and then a ball, what's the probability of drawing a red ball?
For the uninformed Xiao Ming, the probability of drawing a red ball is: 1/2 × 2/6 + 1/2 × 4/6 = 1/2.
For you, who knows better, you'd choose box two for a higher chance, so the probability of drawing a red ball is: 0 × 2/6 + 1 × 4/6 = 2/3.
The Monty Hall problem has practical implications. For instance, if you're guessing on a multiple-choice question and initially choose A, but later eliminate B and C, should you switch to D? The answer is yes, switch!
You might wonder, if you only eliminate one option, say B, should you switch to C or D? The answer is still yes, switch!
According to the "concentration" of probability, any elimination is a form of concentration, making the remaining options more likely than your initial 1/4 chance. For example, both C and D would have a 3/8 chance of being correct, while your original guess A only had a 1/4 chance.
Of course, this strategy for guessing questions assumes you're genuinely clue