You are standing in a Heptagonal room (has seven sides). Each side of the heptagon has a closed door, totaling four white doors and three black doors. In front of each door is a guard. Four of the guards will always tell the truth, and the other three will always lie.

No two black doors are adjacent to each other.

You know that there are two liars standing in front of two white doors.

You are allowed to ask three yes-or-no questions to three, two, or only one of them (as you like).

The treasure is behind one of these seven doors.

What are you going to ask to find the treasure?

You are not allowed to ask more than one guard at a time.

  • $\begingroup$ I dont know if this is dumb question or not, but the information you have listed above, is known to us, right? $\endgroup$
    – smriti
    Oct 5, 2016 at 10:27
  • $\begingroup$ Can you only ask one question to a single guard? $\endgroup$
    – halfmang
    Oct 6, 2016 at 2:49

3 Answers 3


The usual trick to these problems:

If you want to ask if X is true, then ask anyone the question "Is it true that either you are a liar or X is true, but not both?"

No matter who the guard is, his answer will be the truthful answer for "is X true".

Now simply ask:

Is it true that either you are a liar or the treasure door is white, but not both?

Is it true that either you are a liar or the treasure door is one of those two (point to two doors of the right color), but not both?

Is it true that either you are a liar or the treasure door is that one (point to one of the two remaining doors), but not both?

Each question eliminates half the choices, so this would work even in an octagonal room.

  • $\begingroup$ As is now, your second and third questions only eliminate one door each, not half of total possibilities. $\endgroup$
    – justhalf
    Oct 5, 2016 at 9:10
  • $\begingroup$ second question eliminates either 2 doors (if white OR the answer is no) or 1 door (if black AND the answer is yes.) My point is: it leaves you with 2 doors. $\endgroup$
    – mr23ceec
    Oct 5, 2016 at 10:44
  • $\begingroup$ @justhalf The second question removes 2 doors, since it says "one of those two". As you're pointing to two doors and only asking if the treasure room is one of them. $\endgroup$
    – dcfyj
    Oct 5, 2016 at 12:14
  • $\begingroup$ @dcfyj ah, yes, I was imagining that the answer would eliminate only one of them. But it will actually either eliminate those two or eliminate the rest $\endgroup$
    – justhalf
    Oct 5, 2016 at 12:17
  • $\begingroup$ This is (yet again) the optimal solution: you need three bits (= three yes/no questions) to uniquely identify the door, so none of that extra information given in the question affects the solution… $\endgroup$
    – Arkku
    Oct 6, 2016 at 12:10

I stand facing the black door that leaves two white doors behind me and the pattern of doors semetrically to my sides. I ask him, "If I were to ask you if your door or one adjacent was the exit, would you say yes?" Then I ask him, "If I were to ask you if the exit is one of the four to my right, would you say yes?" If he says yes to both, I walk through the door to the right of him from my perspective. If he says yes to the first and no the second answer, I ask him, "If I were to ask you, Is the exit the door to your right, would you say yes?" I then walk through the door to his right if he says yes or through his door if he says no. If the guard answered no to my first question, I approach the guard in front of the black door to my right if his answer was yes to the second question or I approach the guard in front of the black door to my left if the answer to my second question was no. Then I ask the appropriate guard, "If I ask you if your door is the exit, would you say yes?" If the guard says yes, I take his door. If the guard says no, I take the door to his side which is further from the first guard that I questioned.

  • $\begingroup$ Except you just left without the treasure.. and your wife is super pissed because all you had to do was one simple thing and you can't even get that right and now you're all out of questions and you have to drive all the way to the next treasure room and your whole night's just ruined :( $\endgroup$ Oct 6, 2016 at 21:56
  • $\begingroup$ I wasn't challenged to aquire the treasure from the guards. Only to "find the treasure." $\endgroup$
    – RobStone
    Oct 7, 2016 at 11:07

(The answer is wrong)

My first question will be to any of the guards: "1+1 is equal to 3. The treasure is behind a black door. Are both these statements correct?"

The answer to this question will reveal whether the guard is a liar or not. And the answer will also reveal the color of the door behind which the treasure is there.

After this, all my questions will be to the same guard, and the solution from here is trivial.

  • $\begingroup$ The answer to your first question won't reveal the color of the door. Truthteller will always say no and liars will always answer yes, no matter what is your second statement. $\endgroup$ Feb 24, 2017 at 15:17
  • $\begingroup$ @dorianfusco Thanks! So, the only ways seems to be to ask liars what they will say, to make them say the truth.... I wonder if there is another way... $\endgroup$
    – Prem
    Feb 25, 2017 at 13:07
  • $\begingroup$ Well, I know two ways. First one is ffao's answer, using "Are you a liar or [actual yes/no question], but not both?". Make a truth table of this and you'll see it works. The other way around is to ask a guard what other guards would answer like so : "if I asked guard 2 what would guard 3 answer if I asked him what would guard 4 answer [...] if I asked him (guard 7) [actual yes/no question]" : like this, you are 'combining' the truth operator of all 7 guards, since there is an odd number of liars, the answer will be a lie (try with 2 or 3 guards to see how this works) $\endgroup$ Feb 27, 2017 at 9:27

Your Answer

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