The math behind mind-reading tricks
quantamagazine.org
quantamagazine.org
Morality aside, discovering that highly surprised me because I always thought that those techniques were transparent to all people. But I guess math literacy in the US wasn't always great...
> The birthday paradox is that, counterintuitively, the probability of a shared birthday exceeds 50% in a group of only 23 people.
If in a group 23 people at least two share a birthday with a ~50% chance, would that mean if I have a group of 22 people and pick a random day of the year, there’s also a ~50% chance of somebody having a birthday on that day?
You will see that asymptomatically you will reach 50k cases
It's not a 50% chance of being on the date you chose, but that any two dates are the same.
If you pick a random date, Alice has a 364/365 chance of not having a birthday that day. Bob has a 363/365 chance of not having a birthday on that day or on Alice's birthday independently of whether or not Alice's birthday is on the random date. So we take Alice's chances and Bob's chances and we can multiply them together to get our odds that none of these people share a date. And of course, if we know the odds of something not happening, the odds of it happening is the opposite.
One person, nobody shares a birthday because they’re alone.
Two people, it’s going to be a 364/365 ≈ 99.7% that they don’t share a birthday.¹
Now add a third person. We have the initial probability for the first pair and then the third person can’t share a birthday with either of them, so the probability is going to be 363/365 that they don’t share a birthday with either, but since we have two events that both must occur, we multiply the probabilities. That gives us (363364)/365² ≈ 99.2%
For the fourth person it becomes (362363364)/365³ ≈ 98.4%
You’ll notice that the probability is decreasing more and more with each step.²
In general, for n* people we would have³ P = 365!/((365-n!)365ⁿ). At n = 23, we drop below 50%.
This technique is useful for a lot of statistical calculations, e.g., for calculating the probabilities of poker hands, some of them are easier to calculate the probability of not getting the hand then the probability of getting the hand (a pair being the most obvious case).
⸻
1. We’re mostly programmers here so we’re going to pretend leap years don’t exist.
2. This will not continue indefinitely, obviously. The first derivative hits a minimum⁴ around n = 20 for this formula and at n=365. The graph kind of looks like cos θ over the range [0,π] but not exactly, it’s just the first well-known graph that comes to mind of this shape.
3. If you’re eagle eyed, you might notice that my examples before had a denominator of 365 raised to the n-1 power. Then you’ll also notice that my factorials have n terms and end with 365 and not 364. Remember our lonely birthday dude? His probability of not sharing a birthday (1) can be thought of as 365/365 and should also be part of the product, but when we’re doing the math for small numbers, it’s easier to just ignore that but for a general formula, keeping him in the product makes the formula clearer.
4. Minimum because we’re decreasing, remember.
A group of 23 people has 253 unique pairs. So if I ask, "In a room with 253 pairs of people, what are the odds that in one of those pairs, both have the same birthday?" Now around 50% seems a lot more intuitive.
It's unintuitive because the number of pairs increases quadratically with the number of people.
Suppose you're on a game show, and given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
In the original, the 3 doors muddles the odds. But with 100, you're choosing between the 1 you chose on the first try, or the 99 you didn't choose.
You pick door #1.
The host goes and, in order, one by one, opens doors 2-52, conspicuously skips door 53, and then opens 54-100. Would you like to stick with your original choice?
* Your first choice had a natural chance of 1% to be correct.
* After eliminating the 98 other options, a random choice of the remaining two is 50% likely to be correct.
* BUT, you know that the reason the door you picked was not opened is because you picked it! Its inclusion in the set-of-two is not random.
* So your first choice is isn't any more likely to be correct that it was when you first you chose it.
Perhaps this is some mathematical concept? To me i'm viewing every choice as a dice roll. I have no question that the first dice roll was worse than the 2nd. However to me the 2nd is a die with two faces. Two choices, of which both are equally possible.
To look at it differently. The doors changing probability to me sounds like.. imagine two people, the PersonA has this primary scenario. They had 100 doors, chose one, and are then asked if they'd like to switch. PersonB then is asked the second question, of the 2 doors, which do they want? PersonA and B are standing next to each other. The doors are the same for both of them. Why would PersonA have different odds than PersonB? And how could PersonB's odds be any different than 50/50 with no prior history of the doors?
Is there some fundamental difference between the grand idea of probability and "reality" as i'm trying to describe it here?
The probability that you have the winning door does not change when the 98 doors are opened. The simple reason for this is that it is always possible to open 98 doors without the prize regardless of which door you initially chose.
So it provides no extra information about your chosen door. But it does provide information about the single remaining door because in most situations, that specific door would need to have been opened.
> To look at it differently. The doors changing probability to me sounds like.. imagine two people, the PersonA has this primary scenario. They had 100 doors, chose one, and are then asked if they'd like to switch. PersonB then is asked the second question, of the 2 doors, which do they want? PersonA and B are standing next to each other. The doors are the same for both of them. Why would PersonA have different odds than PersonB? And how could PersonB's odds be any different than 50/50 with no prior history of the doors?
If PersonB saw everything happen, they have all the information PersonA has and therefore can make the same choice (99% correctly).
If PersonB came in after the door was chosen and the 98 doors were opened, (assuming they can't tell which door PersonA chose) their chance of picking the winning door is indeed 50%.
When thinking about probabilities, it is very important to think about the information that each person knows. The game master knows everything, so if they were playing their own game, they could win 100% of the time. PersonA can only win 99%. And PersonB can only win 50%. It all depends on what information you are given.
The other two rooms = %66
After host opens one of the rooms
The odds are still 33% vs 66%
The way i see it, the other door has a higher chance of being correct than the door you originally chose. However the two are fundamentally different, are they not?
In reality both doors are equally likely to be correct, no? So yes, changing would be better compared to your original answer - but "to change or not" evaluates both doors in my mind, and each is a 50% chance, no?
Which i think is what you're saying here:
> So your first choice is isn't any more likely to be correct that it was when you first you chose it.
But nevertheless the problem has me a bit confused in what is expected to be "right". It seems to me there is no right, it is a 50/50, unless you are strictly answering the moot point of "Which is better? The door you first chose, or the potential other door?".
Ie i guess i view the original choice as irrelevant the moment the variables change. I feel i misunderstand the goal of the "problem".
No, your original pick will always have a 1/3 chance of being correct. The door that gets opened will always have a 0/3 chance of being correct. The last door has to get all of the rest of the chance.
-----
edit: I haven't tried explaining it this way before, but instead of one winning door and two bad doors, there's one door with a brand new car, one door with a giant mousetrap, and one door with a stuffed toy dinosaur. These are the ways it can go.
A) You pick the door with the car. Monty either picks the dinosaur or the mousetrap, he doesn't really care. If you switch, you get the dinosaur or the mousetrap.
B) You pick the door with the dinosaur. Monty is forced to pick the mousetrap. If you switch, you win the car.
C) You pick the door with the mousetrap. Monty is forced to pick the dinosaur. If you switch, you win the car.
-----
edit 2: your intuition is actually comparing this problem to other problems and not seeing the difference. Take the above scenario for example, but change it so Monty always reveals the dinosaur, no matter what.
A) You pick the door with the car. Monty picks the dinosaur. If you switch, you get the mousetrap.
B) You pick the door with the dinosaur. Monty picks the same door, and shows you that it is the dinosaur. Now you will definitely switch, and have an even chance to win the mousetrap or the car.
C) You pick the door with the mousetrap. Monty picks the door with the dinosaur. If you switch, you will win the car.
That's your 50/50.
If you notice, the switching door is equivalent to the selection that a second player that was cheating would make, a cheater that checked inside all the doors that the first did not pick, and took which preferred from them. In this way, it is obvious that the second player will win as long as the first starts failing, which occurs 99 out of 100 times in the 100-doors version. And the revealed doors are like which neither of them picked.
So, when there are two doors remaining, you know that one is the first player's selection and the other is the cheater's selection, where the cheater was more likely to get the correct.
If the host opens other door randomly, then 1/3 times the host accidentally shows the prize, and you still have 2/3 chance of winning by switching (measured from before the door was opened), switching either to the unknown closed door or the known winning open door.
With 100 doors, switching gives you 1/100 * 0 + 99/100 * 1/99 * 1 + 99/100 * 98/99 * 1 = 1/100 + 98/100 = 99/100
But, measured from after the doors open, with host having opened other doors uniform randomly, in the case where you didn't already win by directly being shown the prize (free win happens with frequency (doors-2)/doors, since you have to pick a loser and the host has to pick a loser to hide), then your chance of winning by switching is 1/2, making the naive answer correct (and for the correct reason)!
But what I think that confuses most people is why one option has more probabilities than the other when there are two remaining doors and the car must be behind one of them, which does not occur with those conditions. It is needed that the host did it deliberately avoiding to reveal the car.
If that is the case. You can easily diagram the 9 different possibilities (you pick one of 3 doors x the car is behind one of 3 doors), and what happens if you switch.
To be clear, the "trick" is that the inference is invalid if the host is differently to open a door if you picked a non-prize door, with crossover where the host is more than twice as likely to open a door if you pick a non-prize door.
> Put down the number of your living brothers; multiply by two; add three; multiply the result by five. Now add the number of your living sisters. Multiply the total by ten. Add the number of your dead brothers and sisters, subtract 150 from the total. The right-hand figure will be the number of deaths; the middle figure will be the number of living sisters, and the left-hand figure will be the number of living brothers.
I found it in a book published in 1946 and describing the work of someone operating around 1900 (I will let you try and find the book yourself if you want further information, while I believe this item to be outdated other ideas from it are still in use).
magical hand motions
The result is your age!
The real trick would be finding a three digit number that can be multiplied by 77 and still be a three digit number.