Classic logic problem
Pit your wits against this logical challenge

Without a doubt my favourite interview logic question. Typically, you'll be asked this question in person around the second interview, and asked to explain your thinking as you work your way through it.

You'll normally be given somewhere between 10 and 15 minutes to work it out.

(This question is slightly altered from its original form to hinder recollection)

Question
Please explain your thinking as you work through the question.

Suppose you're on a game show, and you're given the choice of three containers.

  • In one container there is $1,000,000
  • In each of the other two containers, there is a $10 bill

You pick a container, and the host, who knows what's in each container, opens a different one.

The container he opens has a $10 bill in it. He then says to you:

“Do you want to change your choice, or do you want to stick with the container you chose originally?”

Is it to your advantage to switch your choice?

Answer
So let's work through this together.

Clearly there are three possibilities for the initial state. Let's call the initial states P1, P2 and P3.

Possibility Container 1 Container 2 Container 3
P1 $1,000,000 $10 $10
P2 $10 $1,000,000 $10
P3 $10 $10 $1,000,000

If we take a look at initial state P1

If you were to choose container 1...

The question states that the host will open a different container, and that it will contain $10.
     Suppose the host opens container 2. It contains $10.
          If you stick with your choice (container 1), you ... WIN
          If you switch your choice to container 3, you ...... LOSE


Remembering that P1, P2 and P3 are equally likely, we can sum up in this table

P1/P2/P3 You choose Host opens You stick You switch
P1 C1 C3 WIN LOSE
P1 C1 C2 WIN LOSE
P1 C2 C3 LOSE WIN
P1 C3 C2 LOSE WIN

So... It's a 50/50 chance whether you should stick or change, right ?

Well, no. Not really.

Your choices, C1, C2 or C3, are all equally likely.

So it should really look like this :

P1/P2/P3 You choose Host opens You stick You switch
P1 C1 C3 or C2 WIN LOSE
P1 C2 C3 LOSE WIN
P1 C3 C2 LOSE WIN

Summing it all up.

Now each case P1, P2 and P3 are intuitively the same, and indeed they are.

P1/P2/P3 You choose Host opens You stick You switch
P1 C1 C3 or C2 WIN LOSE
P1 C2 C3 LOSE WIN
P1 C3 C2 LOSE WIN
P2 C1 C3 LOSE WIN
P2 C2 C1 or C3 WIN LOSE
P2 C3 C1 LOSE WIN
P3 C1 C3 LOSE WIN
P3 C2 C1 LOSE WIN
P3 C3 C1 or C2 WIN LOSE

So, if we stick, we have 3 wins out of 9.
If we switch, we have 6 wins out of 9
In 2/3 of all cases, it's better to switch. In other words, it makes sense to switch!