8
$\begingroup$

This is a variation of the riddle of 2 guards and 2 doors:

You are stuck in a room with 3 doors. Each of the doors have a guard posted. One guard always tells the truth, one always lies, and the third sometimes tells truths and sometimes tells lies, but stabs you if you ask him more than 2 questions.

What is a reliable way to solve this?

$\endgroup$
7
  • 9
    $\begingroup$ Are we to assume one of the doors is a "good" door, the other two are "bad", and all of the guards know which are good and bad? $\endgroup$
    – Quark
    Commented Jan 8, 2015 at 4:26
  • 4
    $\begingroup$ I think it is impossible if the liar can lie in multiple ways - so he just doesn't have to say the truth. So if I ask him "Is this the right door" he can just answer "I don't know" and this gives me zero information from him... $\endgroup$
    – Falco
    Commented Jan 8, 2015 at 12:32
  • 6
    $\begingroup$ Is this in any way inspired by XKCD? "One always lies, one always tells the truth, and one stabs people who ask tricky questions." $\endgroup$
    – KSmarts
    Commented Jan 8, 2015 at 15:41
  • 1
    $\begingroup$ Ask them all 3 questions, to find out which guard has a knife. Take the knife from that guard, stab all three of them with it, then walk through the now-unguarded door. $\endgroup$
    – neminem
    Commented Jan 8, 2015 at 18:36
  • 4
    $\begingroup$ Wait for their shift to end, and then follow them out. $\endgroup$ Commented Jan 8, 2015 at 21:27

5 Answers 5

18
$\begingroup$

It seems that it is trivial to solve this. As long as we identify either the liar or the truth-teller, we can obtain 100% correct statements.

First, ask "Is 1+1 == 2" to all 3 guards. The liar will always say "no", while the truth-teller will always say "yes".

You will get 1 of 2 outcomes:

1 of them says yes while the other 2 say no. Since there must be at least one liar and one truth-teller, the merciless guard is lying in this case. Ask the guard who says yes which door is the true door by exhaustion.

1 of them says no while the other 2 say yes. The merciless guard is telling the truth, and we can perform the same operation with the liar, just with answers reversed.

We can therefore ignore the knave guard.

$\endgroup$
1
  • 3
    $\begingroup$ And you ask the liar 3 times "is this the right door?" And he lies by saying "I don't know" all three times :-X $\endgroup$
    – Falco
    Commented Jan 9, 2015 at 9:58
7
$\begingroup$

Ask all of the guards, "Are you the merciless guard?". If two of them respond "no" and one "yes", then you know that the one that said "yes" is the liar (and that the merciless one said "no") - and you can ask them "Will I escape through this door? How about this one?" - whichever one they say you won't escape through is the proper door to open. If, to your initial round of questions, you get two responses of "yes" and one "no", then you know that the one who said "no" is the truth-teller (and the merciless one said "yes"), and you can ask that guard which door is the escape.

This uses the fact that we know we will get one response of "yes" and one of "no" to the first question - from the liar and the truth-teller respectively. So, if we only have one "yes" or one "no", we can identify who said it, meaning that we can assuredly avoid asking the merciless one two questions and, moreover, that we will know exactly who we're talking to. Since there's only three guards and two possible answers, we are assured that this will always be the case.

$\endgroup$
3
  • $\begingroup$ It is unclear to whom you ask "Will I escape through this door?" and "How about this one?". $\endgroup$
    – Florian F
    Commented Jan 8, 2015 at 9:19
  • $\begingroup$ Do you use "them" as a gender-neutral pronoun? If so, then your answer looks correct. $\endgroup$
    – Florian F
    Commented Jan 8, 2015 at 10:15
  • $\begingroup$ @Florian Yes, "them" is meant to refer to "the guard that said "yes"" $\endgroup$ Commented Jan 8, 2015 at 23:11
2
$\begingroup$

In response to Taemyr It is most likely impossible, if the Guards can answer with other words than yes/no:

The liar can just answer "I don't know" to any question he knows, so we cannot get any information out of him, While the stabber can always answer exactly like the truth-teller, except for the final answer we need.

This means, whatever we do we can never decide between the Knave and the truth teller - that only leaves us with the liar. And he can just answer "I don't know" to any question we ask, If we ask him recursive questions, he can just replace it with anything "What would you answer if...." and he just says JELLYFISH!

As far as I can see - unsolvable.

Or the default method (If the liar always lies with opposites so yes->no):

Ask the first one: "If I would ask you if Guard 2 is merciful, what would you say?" The thruth-teller will answer thruthfull, the Liar will lie about his lie and also say the truth, the killer will say anything.

We then choose Guard2 if he is merciful, otherwise Guard3. If the first one was the Knave, we have a safe one, otherwise we got a thruthful answer and will also have a safe one.

Then we can just ask one or two question to the truthteller/liar:

If I would ask the other merciful guard (the one who doesn't stab people) is the first door safe, what would he say?

If he says no, take the door otherwise ask the same for the 2nd door, if no take it, otherwise take door 3.

So 3 Questions overall.

$\endgroup$
5
  • $\begingroup$ +1, however I am not completely happy with the second question. The liar could answer "He would say that both doors are equally dangerous.", an obvious lie - but then he is the liar. The questions can be asked as pure yes/no answers which removes this ambiguity. $\endgroup$
    – Taemyr
    Commented Jan 8, 2015 at 12:17
  • $\begingroup$ @Taemyr But then the Liar could also answer any question with "I don't know" And there would not be any surefire way to ever get a reliable answer :-o $\endgroup$
    – Falco
    Commented Jan 8, 2015 at 12:25
  • $\begingroup$ @Taemyr I changed my solution, so the last one are two yes/no question. I don't think it's possible to get one of 3 Doors with one yes/no question, if a lie is involved... $\endgroup$
    – Falco
    Commented Jan 8, 2015 at 13:00
  • $\begingroup$ OP doesn't really specify what the three doors are, if there is 2 safe doors and 1 lethal then 2 questions should be possible. If there is only 1 safe door we would need to get more than 1 bit of information to distinguish between the doors. This is impossible with a single yes/no question so we would either need a way to get information about the doors as part of the package when asking about the guards or ask a question that is not yes/no. I suspect both approaches is impossible. However I can't prove this. $\endgroup$
    – Taemyr
    Commented Jan 8, 2015 at 13:21
  • 1
    $\begingroup$ One needs to know a guard that is not merciful and the correct door. Guessing this from no information would have a 2/3*1/3=2/9 chance. This is less than 1/4, so two yes/no questions can not provide the needed information. $\endgroup$
    – Taemyr
    Commented Jan 8, 2015 at 13:24
1
$\begingroup$

Assuming that each guard can only answer yes or no questions, ask the left guard: - Will the middle guard say you are the merciless guard? - Will the right guard say you are the merciless guard?

The middle guard: - Will the left guard say you are the merciless guard? - Will the right guard say you are the merciless guard?

And to the right guard: - Will the left guard say you are the merciless guard? - Will the right guard say you are the merciless?

Since both the truth teller and the lier cannot predict the merciless guard's answer, they must answer "I don't know" when asked about the merciless guard since doing otherwise might cause them to lie or tell the truth, which is impossible.

The merciless guard knows which of the others is the truth teller and which is the lier so he is free to answer "yes", "no", or lie and say "I don't know".

Choose the door behind the guard which received two 'I don't know" answers. Even if the merciless guard replied "I don't know" twice he'll be alone in pointing to that guard.

So 6 questions if we allow the merciless guard yo answer I don't know and don't use Falco's double negative "If I were to ask you, what would you say?"

If the merciless guard can't lie and say I don't know then you only need to ask the questions to one person and choose the door behind the person that received the single "I don't know" answer or didn't give it.

If on the other hand the lier can also reply "I don't know" then I don't think you can solve it without a benchmark question like "1+1=2?"

$\endgroup$
0
$\begingroup$

This one doesn't have a prohibition on asking tricky questions.

If we assume that a lie is the opposite of what the truth telling guard would say, and that the number of safe doors is known, you can ask one guard one question: "Which doors are safe?". If he points at the correct number of doors, then you go through one that was pointed at, otherwise you go through a door not pointed at. Whether the merciless guard lies or not doesn't matter, because you know if the statement is truth or lie automatically.

However this version specifically allows asking multiple questions, and doesn't prohibit asking tricky questions.

A "tricky question" is a useful question that forces the liar to answer how the truth teller would. This includes any questions about future answers, or any trickery you would use to weasel out of it. But, "Are you the truth teller?" isn't a tricky question, even though the liar would give the same answer, because it doesn't actually help at all.

Therefore, if we do not know the number of safe doors, we can ask the following tricky question of two guards.

"If I were to ask you which doors are safe, which ones would you point at?" Both the truth teller and the liar will give the same answer, while the merciless guard can give either answer. If the two answers are the same, they are correct, and there is no need to ask the third guard. If they are different, then one of them is the merciless guard, and thus the third is either the truth teller or the liar, and thus will answer the question properly when asked it of them. Simple.

If we add back in the "no tricky questions" constraint from the comic, then the problem becomes trickier.

If the merciless guard is required to alternate between truth and lie, then the problem is solvable after all by the previously listed method. Or by asking a truth probing non tricky question of each guard twice to identify them, then asking the truth teller.

If not, there's still a solution. You first ask each guard how many fingers you are holding up. If the merciless guard lies, you've identified the truth teller, and can ask him what doors are safe. If the merciless guard tells the truth, you've identified the liar. you then ask the liar if another guard is the merciless guard. he will say no if it is, and yes if it isn't. You've now identified the truth teller, and only asked one question of the merciless guard.

Now if a liar can say they don't know when they do, then you are pretty screwed, because you can't do this trick. The liar will simply refuse to help you figure out who the merciless guard is, and the merciless guard can lie or tell the truth as needed to screw you over.

But in this case, the limit of two questions to the merciless guard isn't even needed. It doesn't matter how may questions you ask, you can't solve it without a tricky question.

Therefore we can presume that the guard is not free to make its own decision about whether to lie or tell the truth. If it can repeat an answer to the same question, you can't solve it because of the 2 question limit. But if it can't, then you only need to ask it the same question twice to identify it, and not ask it a third question.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.