Statistics
Bertrand's box paradox calculator
Three boxes, six coins, one gold coin drawn. The calculator shows why the other coin is gold two times in three, and lets you change the boxes to see how the answer moves.
| Box | Gold | Silver | P(gold first | box) | P(box | gold first) |
|---|---|---|---|---|
| GG | 2 | 0 | 1 | 2/3 ≈ 0.6667 (66.7%) |
| SS | 0 | 2 | 0 | 0 (0%) |
| GS | 1 | 1 | 1/2 ≈ 0.5 | 1/3 ≈ 0.3333 (33.3%) |
Before the draw every box had probability 1/3 ≈ 0.3333. Boxes holding more gold coins gain weight; boxes with none drop to 0.
Show the working, step by step
Each box is picked with probability 1/3. The chance of drawing that colour first depends on how many of that colour the box holds.
GG: 2/2 SS: 0/2 GS: 1/2
Total probability of a gold first coin:
P(gold) = (1/3) × Σ = 1/2 ≈ 0.5
Bayes' theorem weights each box by how likely it was to produce that coin.
P(GG | gold) = 2/3 ≈ 0.6667 P(SS | gold) = 0 P(GS | gold) = 1/3 ≈ 0.3333
Average the chance that the next coin is gold over those weights.
P(next gold) = 2/3 ≈ 0.6667
The tempting answer is 1/2 (“it is either the GG box or the GS box”). But the GG box has two gold coins you could have drawn and the GS box only one, so GG is twice as likely: 2/3.
The formula
Each box is picked with probability 1/k, and a coin is drawn from it at random. After seeing the colour of that coin, Bayes' theorem gives each box a new weight, and the answer is the weighted chance that the next coin from the same box is gold:
P(box i | gold) = (gᵢ/nᵢ) ÷ Σⱼ (gⱼ/nⱼ) P(next gold | gold) = Σᵢ P(box i | gold) × (gᵢ − 1)/(nᵢ − 1)
Here gᵢ is the number of gold coins in box i and nᵢ is the total number of coins in it.
Worked example: the classic three boxes
The defaults are Bertrand's boxes: GG (two gold), SS (two silver) and GS (one of each). You draw a gold coin.
- The chance of drawing gold first is 1 from GG, 0 from SS and 1/2 from GS. Averaged over the three boxes, P(gold) = (1 + 0 + 1/2) ÷ 3 = 1/2.
- So P(GG | gold) = (1/3 × 1) ÷ (1/2) = 2/3, P(GS | gold) = (1/3 × 1/2) ÷ (1/2) = 1/3 and P(SS | gold) = 0.
- In GG the other coin is gold; in GS it is silver. So P(other coin is gold) = 2/3 × 1 + 1/3 × 0 = 2/3.
The calculator also shows the naive answer of 1/2, which comes from treating the two boxes that could contain a gold coin as equally likely. They are not: the gold–gold box gave you twice as many ways to see gold.
If you draw a silver coin instead, the answer to "is the next coin gold?" is 1/3, by the same argument with the colours swapped.
Counting coins instead of boxes
A quick way to check the answer is to label the six coins. Three are gold: G₁ and G₂ in the first box, and G₃ in the mixed box. You are equally likely to have drawn any of the three. If you drew G₁, the other coin is G₂. If you drew G₂, it is G₁. If you drew G₃, it is silver. Two of three cases give gold.
Try your own boxes
Change the table to test variations. With three boxes holding GGG, GGS and GSS, and a gold coin drawn first, the boxes get weights 3 : 2 : 1, and the chance the next coin is gold is again 2/3. Add a fourth box, or give one box many silver coins, and the answer shifts. Every box needs at least two coins, because the question is about a coin left behind.
Choose a simulation size to check the exact answer against random draws. The simulated value should land close to the exact one, and closer with more draws.
How to read the result
The headline is the probability that the next coin drawn from the same box is gold. The table lists each box's posterior probability: how likely it is that you are holding that box, given the coin you saw. A box with no coin of the observed colour drops to zero.
Common mistakes
- Counting the remaining boxes as equally likely. The evidence is more likely from some boxes than others, and Bayes' theorem accounts for that.
- Answering a different question. "Is this the GG box?" and "Is the other coin gold?" have the same answer only in the classic setup, where each box holds exactly two coins.
- Forgetting that the coin was drawn at random. If someone deliberately showed you a gold coin whenever the box had one, the answer would change.
Common questions
What is Bertrand's box paradox?
Three boxes hold two gold coins, two silver coins, and one of each. You pick a box at random, draw one coin without looking at the other, and it is gold. What is the chance the other coin in that box is also gold? Most people say 1/2. The correct answer is 2/3. Joseph Bertrand posed it in 1889 in his Calcul des probabilités.
Why is the answer 2/3 and not 1/2?
There are three gold coins you could have drawn, each equally likely. Two of them sit in the gold–gold box, where the other coin is gold. Only one sits in the mixed box. So two of the three equally likely ways of seeing gold leave a gold coin behind: 2/3.
Is this the same as the Monty Hall problem?
It has the same structure. In both, people count the remaining possibilities as equally likely when the evidence you saw was more likely under one of them. Bayes' theorem fixes both: weight each possibility by how likely it was to produce what you observed.
Can I use boxes with more than two coins?
Yes. Enter any number of boxes with any mix of gold and silver coins, as long as each box has at least two coins. The calculator then answers: given the first coin drawn from the chosen box was gold (or silver), what is the chance the next coin drawn from the same box is gold?
How does the simulation work?
It repeats the experiment many times: pick a box, draw a coin, and keep only the trials where the coin matched the colour you chose. Among those, it counts how often the next coin from the same box was gold. With 100,000 draws the estimate is usually within about 0.005 of the exact answer.
Related calculators
-
Bayes' theorem
Posterior probabilities from priors and likelihoods.
-
Boy or girl paradox
The two-child problem: 1/3, 1/2 and 13/27.
-
Conditional probability
P(A|B) from probabilities or a two-way table.