# Two doors with three guards - one lies, one tells the truth, and one is unreliable

This is an extension of Two doors with two guards - one lies, one tells the truth, but in this situation you are a prisoner in a room with 2 doors and 3 guards. One of the doors will guide you to freedom and behind the other is a hangman - you don't know which is which. One of the guards always tell the truth, another always lies, and the third is unreliable and sometimes tells the truth and sometimes lies. You don't know who is who, but the guards do.

After asking two yes/no questions you have to choose and open one of the two doors. You can ask one guard both questions or you can ask two different guards a single question each.

What and who do you ask to lead you to the door of freedom?

This is a rather weird form of the knight, knave and joker puzzle, with a twist.

This part is from Ben Aaronson in this answer.

So say the people are A, B and C. You ask A:

Is exactly one of these statements true:

• You are the knight
• B is the joker"

If you get back the answer yes, then the possibilities are:

• A is the knight and B is the knave (1 is true, 2 is false, so one statement true, so the answer is yes which knight truthfully gives)
• A is the joker
• A is the knave and B is the knight (both statements false, so the answer is no which knave lies about)

In all three cases, B is safe

If you get back the answer no, then the possibilities are:

• A is the knight and B is the joker (both statements true, so the answer is no which knight truthfully gives)
• A is the joker
• A is the knave and B is the joker (1 is false, 2 is true, so one statement is true so answer is yes which knave lies about)

In all three cases, C is safe

Then, just point to a door and ask the safe person:

If you ask the Knave and:

• The Knave says No:

• The Knight would tell the truth (Yes), but the Knave lies (No).
• The door is safe; go through.
• The Knave says Yes:

• The Knight would tell the truth (No), but the Knave lies (Yes).
• The door is unsafe; choose the other one.

If you ask the Knight and:

• The Knight says No:

• The Knave lies (No), and the Knight tells the truth (No).
• The door is safe; go through.
• The Knight says Yes:

• The Knave lies (Yes), and the Knight tells the truth (Yes).
• The door is unsafe; choose the other one.

This puzzle was an interesting mix of two puzzles.

Alternate (but similar) answer again based on determining who is unreliable in the first question

This relies on the ability of the truth teller to never lie, and the liar to never tell the truth. It assumes that if they are unsure they may not answer as the answer they give may break these absolute rules

## Question 1

If I asked "which door is the good door" to the other two guards would their answers be the same?

• If asked to the truth teller he cannot answer as he doesn't know, and therefore may lie if he answered.
• If asked to the liar he cannot answer as he doesn't know, and therefore may tell the - truth if he answered.
• If asked to the unreliable he will answer definitively either way

Now, we can identify a "reliable" guard. If they have not answered we know they are reliable, and if they have answered we know the other 2 are "reliable".

Note that, unlike in Florian's answer in the "Two Guards" version, the problem that we can't know whether the guard can't answer or is still picking the answer, is irrelevant, because once we start talking to the guard while it's picking the guard will tell us to wait.

## Question 2

We can now ask an identified "reliable" guard

On average if repeatedly asked "Is (identify a door here) the good door?" would the other two guards be more likely to say yes.

if the identified door is the good door:

• The truth teller he will say "No"
• The liar he will say "No"

if the identified door is the bad door:

• The truth teller he will say "Yes"
• The liar he will say "Yes"

So if the answer is "No" we go through the door we identified, otherwise, if the answer is "Yes" we go through the other door.

• Making assumptions about how the guards behave when they don't know the answer is unnecessary for this problem. – Taemyr Jul 11 '16 at 14:24

The other answers makes this much harder than it needs to be.

Label the guards A, B, and C. And the doors D1 and D2

Question 1

Of yes/no questions that both B and C knows the answer, can B tell the truth to a higher proportion of the questions than C?
Knave will answer Yes if and only if C is the truth teller.
This because the Joker can occasionally lie, so he can have a proportion less than 1.
Conversely the Knight will answer yes if and only if C is the liar.
The Joker will answer arbitrarily. But we don't care.

Question 2

If Question 1 got yes we ask C otherwise we ask B.