Bertrand’s Boxes#

In 1889 Joseph Bertrand posed and solved one of the oldest paradoxes in probability. But his solution is not quite correct – it is right for the wrong reason.

The original statement of the problem is in his Calcul des probabilités, Gauthier-Villars, 1889. As a testament to the availability of information in the 21st century, I found a scanned copy of the book online and pasted a screenshot into an online OCR server (optical character recognition). Here is the result.

Trois coffrets sont d’apparence identique. Chacun a deux tiroirs, chaque tiroir renferme une médaille. Les médailles du premier coffret sont en or; celles da deuxième coffret, en argent; le troisième coffret contient une médaille d’or et une médaille d’argent. On choisit un coffret; quelle est la probabilité pour trouver, dans ses tiroirs, une pièce d’or et une pièce d’argent? Trois cas sont possibles et le sont également puisque les trois coffres sont d’apparence identique. Un cas seulement est favorable. La probabilité est 1/3.

Le coffret est choisi. On ouvre un tiroir. Quelle que soit la médaille qu’on y trouve, deux cas seulement restent possibles. Le tiroir qui reste fermé pourra contenir une médaille dont le métal diffère ou non de celui de la première. Sur ces deux cas, un seul est favorable au coffret dont les pièces sont différentes. La proba-bilité d’avoir mis /a main sur ce coffret est donc 1/2.

Comment croire, cependant, qu’il suffira d’ouvrir un tiroir pour changer la probabilité et de 1/3 l’élever àr 1/2.

Le raisonnement ne peut être juste. Il ne l’est pas en effet.

Après l’ouverture du premier tiroir deux cas restent possibles. Sur ces deux cas, un seul est favorable, cela est vrai, mais les deux cas n’ont pas même vraisemblance.

Si la pièce qu’on a vue est en or, l’autre peut être en argent, mais on aurait avantage à parier pour qu’elle soit en or.

Supposons, pour en faire paraître l’évidence, qu’au lieu de trois coffrets on en ait trois cents. Cent contiennent deux médailles d’or, cent deux médailles d’argent et cent une médaille d’or et une médaille d’argent. Dans chaque coffret on ouvre un tiroir, on voit par conséquent trois cents médailles. Cent d’entre elles sont en or et cent en argent, cela est certain ; les cent autres sont dou-teuses, elles appartiennent aux coffrets dont les pièces ne sont pas pareilles : le hasard en réglera le nombre.

On doit s’attendre, en ouvrant les trois cents draies, à y voir moins de deux cents pièces d’or la probabilité pour que la pre-mière qui se présente appartienne à l’un des cent coffrets dont l’autre pièce est en or est donc plus grande que 1/2.

Then I pasted the French text into an online translation service. Here is the result, which I edited lightly for clarity:

Three boxes are identical in appearance. Each has two drawers, each drawer contains a medal. The medals in the first box are gold; those in the second box, silver; the third box contains a gold medal and a silver medal.

We choose a box; what is the probability of finding, in its drawers, a gold coin and a silver coin?

Three cases are possible and they are equally likely because the three chests are identical in appearance. Only one case is favorable. The probability is 1/3.

Having chosen a box, we open a drawer. Whatever medal one finds there, only two cases are possible. The drawer that remains closed may contain a medal whose metal may or may not differ from that of the first. Of these two cases, only one is in favor of the box whose parts are different. The probability of having got hold of this set is therefore 1/2.

How can it be, however, that it will be enough to open a drawer to change the probability and raise it from 1/3 to 1/2? The reasoning cannot be correct. Indeed, it is not.

After opening the first drawer, two cases remain possible. Of these two cases, only one is favorable, this is true, but the two cases do not have the same likelihood.

If the coin we saw is gold, the other may be silver, but we would be better off betting that it is gold.

Suppose, to show the obvious, that instead of three boxes we have three hundred. One hundred contain two gold medals, one hundred and two silver medals and one hundred one gold and one silver. In each box we open a drawer, we see therefore three hundred medals. A hundred of them are in gold and a hundred in silver, that is certain; the hundred others are doubtful, they belong to boxes whose parts are not alike: chance will regulate the number.

We must expect, when opening the three hundred drawers, to see less than two hundred gold coins the probability that the first that appears belongs to one of the hundred boxes of which the other coin is in gold is therefore greater than 1/2.

Now let me translate the paradox one more time to make the apparent contradiction clearer, and then we will resolve it.

Suppose we choose a random box, open a random drawer, and find a gold medal. What is the probability that the other drawer contains a silver medal?

Bertrand offers two answers, and an argument for each:

  • Only one of the three boxes is mixed, so the probability that we chose it is 1/3.

  • When we see the gold coin, we can rule out the two-silver box. There are only two boxes left, and one of them is mixed, so the probability we chose it is 1/2.

As with so many questions in probability, we can use Bayes theorem to resolve the confusion. Initially the boxes are equally likely, so the prior probability for the mixed box is 1/3.

When we open the drawer and see a gold medal, we get some information about which box we chose. So let’s think about the likelihood of this outcome in each case:

  • If we chose the box with two gold medals, the likelihood of finding a gold medal is 100%.

  • If we chose the box with two silver medals, the likelihood is 0%.

  • And if we chose the box with one of each, the likelihood is 50%.

Putting these numbers into a Bayes table, here is the result:

Hide code cell source
import pandas as pd
import numpy as np

def make_table(hypos, prior, likelihood):
    table = pd.DataFrame(index=hypos)
    table['Prior'] = prior
    table['Likelihood'] = likelihood
    table['Product'] = (table['Prior'] * table['Likelihood'])
    total = table['Product'].sum()
    table['Posterior'] = table['Product'] / total
    return table
from fractions import Fraction

hypos = "Two gold", "Two silver", "Mixed"
prior = Fraction(1,3)
likelihood = 1, 0, Fraction(1,2)
make_table(hypos, prior, likelihood)
Prior Likelihood Product Posterior
Two gold 1/3 1 1/3 2/3
Two silver 1/3 0 0 0
Mixed 1/3 1/2 1/6 1/3

The posterior probability of the mixed box is 1/3. So the first argument is correct. Initially, the probability of choosing the mixed box is 1/3 – opening a drawer and seeing a gold coin does not change it.

And the Bayesian update tells us why: if there are two gold coins, rather than one, we are twice as likely to see a gold coin.

The second argument is wrong because it fails to take into account this difference in likelihood. It’s true that there are only two boxes left, but it is not true that they are equally likely.

This error is analogous to the base rate fallacy, which is the error we make if we only consider the likelihoods and ignore the prior probabilities. Here, the second argument is wrong because it commits the a “likelihood fallacy” – considering only the prior probabilities and ignoring the likelihoods.

Right for the wrong reason#

Bertrand’s resolution of the paradox is correct in the sense that he gets the right answer in this case. But his argument is not valid in general. He asks, “How can it be, however, that it will be enough to open a drawer to change the probability…”, which implies that it is impossible in principle.

But opening the drawer does change the probabilities of the other two boxes. Having seen a gold coin, we rule out the two-silver box and increase the probability of the two-gold box. So I don’t think we can dismiss the possibility that opening the drawer could change the probability of the mixed box. It just happens, in this case, that it does not.

Let’s consider a variation of the problem where there are three drawers in each box: the first box contains three gold medals, the second contains three silver, and the third contains two gold and one silver.

In that case the likelihood of seeing a gold coin is each case is 1, 0, and 2/3, respectively. And here’s what the update looks like:

hypos = "Three gold", "Three silver", "Two gold, one silver"
prior = Fraction(1,3)
likelihood = 1, 0, Fraction(2,3)
make_table(hypos, prior, likelihood)
Prior Likelihood Product Posterior
Three gold 1/3 1 1/3 3/5
Three silver 1/3 0 0 0
Two gold, one silver 1/3 2/3 2/9 2/5

Now the posterior probability of the mixed box is 2/5, which is higher than the prior probability, which was 1/3. In this example, opening the drawer provides evidence that changes the probabilities of all three boxes.

I think there are two lessons we can learn from this example. The first is, don’t be two quick to assume that all cases are equally likely. The second is that new information can change probabilities in ways that are not obvious. The key is to think about the likelihoods.