The Three Card Problem
I have three cards:
- black-black: black on both sides
- white-white: white on both sides
- white-black: black on one side and white on the other
I pick one card at random, its first side is white. What is the probability that the other side is also white?1
Our intuition may lead us to say \(1/2\), as there are two cards with a white side: one with two white sides, the other with one black and one white side. From this observation, it would make sense to say that if the first side is white, then the probability of the other side being white is \(1/2\).
This reasoning is unfortunately flawed; the correct answer is \(2/3\).
If you do not believe me, you can run this simulation in Python and check the results:
Python code simulation
import random
= 100000
trials = ["white-white", "white-black", "black-black"]
cards = 0
white_first_count = 0
white_white_count
for _ in range(trials):
= random.choice(cards)
card if card == "white-white":
+= 1
white_first_count += 1
white_white_count elif card == "white-black":
if random.choice(["white", "black"]) == "white":
+= 1
white_first_count
= white_white_count / white_first_count if white_first_count > 0 else 0
probability print(f"Probability of the other side being white: {probability}")
Thinking of parallel worlds
To nudge our intuition into the right direction, we can reframe the problem: given that the first side of the card is white, what is the probability that the other is white?
Going one step further, it is important to remember how a white side could have been drawn:
- The white-white card could have been drawn on one of its sides
- The white-white card could have been drawn on its other side
- The black-white card could have been drawn on its white side
From this observation, we can see that of the situations that lead us to the first side of the card being white, 2 out of 3 were with the white-white card.
This can also be shown visually:
Each of the six sides has the same probability of being picked. There are three equally probable cases in which a white side is picked. In two out of three cases, the card is the white-white card.
The Bayes rule
This can also be verified using Bayes’ rule:
\[ P(A | B) = \frac{P(B | A)P(A)}{P(B)} \]
Where \(P(A | B)\) is the probability of event \(A\) given event \(B\).
Here, let’s note the events:
- \(A\): the card is white on the other side (it is the white-white card)
- \(B\): the first side of the card is white
We want to know: \(P(A | B)\), probability of \(A\) given \(B\).
Using Bayes’ rule, we get: \[ P(A | B) = \frac{P(B | A)P(A)}{P(B)} \]
Evaluating these one by one:
- \(P(A)\), probability of getting the white-white card: there are three cards, so this probability is \(1/3\)
- \(P(B|A)\), given that the card is white-white, what is the probability of having its first side white? That is \(1\)
- \(P(B)\), probability of getting the first side white, trickier to evaluate:
- Case 1: card is white-white, then this would be a probability \(1\)
- Case 2: card is white-black, then this would be \(1/2\)
- Case 3: card is black-black, then \(0\)
To get the total probability of \(B\), we sum all of these cases:
\[ \begin{aligned} P(B) &= P(B|\text{white-white}) \cdot P(\text{white-white}) + \\ &\quad P(B|\text{black-white}) \cdot P(\text{black-white}) + \\ &\quad P(B|\text{black-black}) \cdot P(\text{black-black}) \end{aligned} \]
\[ P(B) = 1 \cdot \frac{1}{3} + \frac{1}{2} \cdot \frac{1}{3} + 0 \cdot \frac{1}{3} = \frac{1}{3} + \frac{1}{6} = \frac{1}{2} \]
Plugging these values into Bayes’ rule, we get: \[ P(A | B) = \frac{1 \cdot \frac{1}{3}}{\frac{1}{2}} = \frac{2}{3} \]
Final Thoughts
I was introduced to this problem through David McKay’s brilliant lecture series on Information Theory and book.
It goes to show that beyond the Monty Hall problem we have learnt by heart, Bayesian inference does not come naturally to us. It is also a good reminder to keep thinking about the number of paths that could have led to an outcome.
Footnotes
This problem was initially shared in an article on the nature of thinking tokens. I thought that it deserved its own article.↩︎