Answer to Monday’s Puzzle

Answer to Monday’s Puzzle

On Monday I posted the following puzzle:

“A prisoner is given a choice between two doors; one of which leads to freedom and the other of which leads to certain death. In front of the doors stand three guards, one of whom always tells the truth, one of whom always lies and the other of which answers randomly. The guards will only answer ‘yes’ or ‘no’ to questions. The prisoner does not know which guard is which.

In only two questions, how does the prisoner find out which door is safe?”

The trick to this problem is realising that – even more so than in the case of two guards and one question – you do not have enough questions to find out much of what you might like to know. You can’t find out the natures of all the guards; in fact, you can’t even definitively find out the nature of one of them, not and solve the problems. So what do you do?

Well, there are a number of solutions to this, but all of them involve identifying a guard who is definitely not the inconsistent guard. If we have a guard that always tells the truth or always tells lies, we know how to get through, regardless of whether they are a truth-teller or a liar. The problem reduces to the two guards and one question, along the lines of, “If I asked your exact opposite which door was the door to freedom, what would they say?” (and then going through the other door) will work. So the first question needs to identify such a guard.

This is where my instincts really misled me, when I first tried to solve it. The natural path is to try to identify the inconsistent guard, but it turns out that that’s not the way forward. What you can do, however, is to find a guard who is definitely not inconsistent – and that’s all you need.

I find the most elegant framing is to ask one guard (say Guard A), “Of the other two guards, which one tells the truth more often?”

– If Guard A is the truth-teller, they will point to the inconsistent guard, as that guard tells the truth more than the liar. The guard not pointed at is the liar.

– If Guard A is the liar, they will also point to the inconsistent guard, as that guard tells the truth less than the truth-teller, and the liar always lies. The guard not pointed at is the truth-teller.

– If Guard A is the inconsistent guard, they will point at either of the other two guards – either the truth teller or the liar.

We can therefore see that, in each case, the guard that is not pointed at will be consistent (either the truth-teller or the liar). We have then identified a consistent guard, either the truth-teller or the liar. This is all we need; we can then ask a question as set out above (“If I asked your exact opposite which door was the door to freedom, what would they say?”), go through the opposite door and be free.

3 thoughts on “Answer to Monday’s Puzzle

  1. Cool. I have always been slightly flummoxed by this extension of the famous puzzle, and never quite had enough patience to work it out. Is that natural: having become a professional mathematician, I have less patience to spend thinking time on puzzles of that nature, but am still interested in the answers…

    1. That definitely makes sense to me – that you’d still be interested in them, but not want to devote too much time to working it out after a day spent in similar activities! As an aside, I think I may actually have given this particular one to you as one of the challenges to enter the Valley of the Feathered Serpents, though you would have had a couple of other people to help work it out then…

      1. Yes I vaguely remember. I have certainly often come across this puzzle. Group puzzle solving is quite fun 🙂 though often it gets dominated by one particular individual.

Comments are closed.

Comments are closed.