# How to find the treasure?

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.

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

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".

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.

• As is now, your second and third questions only eliminate one door each, not half of total possibilities. Oct 5 '16 at 9:10
• 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. Oct 5 '16 at 10:44
• @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. Oct 5 '16 at 12:14
• @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 Oct 5 '16 at 12:17
• 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… Oct 6 '16 at 12:10

• 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 :( Oct 6 '16 at 21:56
• I wasn't challenged to aquire the treasure from the guards. Only to "find the treasure." Oct 7 '16 at 11:07