The two doors riddle

So one door tells the truth the other one always lies.

Why wouldn’t asking “are you a door”? Work?

IIRC, one door leads to a good result, and the other to a bad one, and you get to ask one question; your suggested question would reveal if it’s the honest door, and — now you’re out of questions.

So basically it’s not guaranteed the honest door is the one you want to go through?

Talking doors is not how it’s normally portrayed. Normally it’s 2 guards, neither of whom is associated with a particular door.

You don’t actually need the 2nd guard though, you can just ask a single guard “what would you say if I asked you whether the left door is safe?” and you will get a true answer.

Here’s a standard version. That page also talks about variants, answers, and reasons why the riddle needs to be posed exactly in order to make it solvable.

John and Bill are standing at a fork in the road. John is standing in front of the left road, and Bill is standing in front of the right road. One of them is a knight and the other a knave, but you don’t know which. You also know that one road leads to Death, and the other leads to Freedom. By asking one yes–no question, can you determine the road to Freedom?

This is the way this kind of story goes.

You have two individuals, Bob who always lies and Mary who always tells the truth. You don’t know which is which. You come to a fork in the road and both Bob and Mary are standing there. You want to know which is the correct way for you to go, right or left. You can get the correct answer with just one question even though you don’t know which person is the liar and which person is the truth teller.

You ask either Bob or Mary, it doesn’t matter which one, “If I ask the other person which is the correct way to go, what will they say?”

So for example you ask Bob, “If I ask Mary which is the correct way to go, what will she say?” Or you ask Mary, “If I ask Bob which way to go what will he say?”

And whatever answer you get from whichever person, do the opposite.

That won’t actually work, since you don’t know if you’re speaking to Bob or Mary. Your first formulation “if I ask the other person if this road is safe, what will they say?” does work.

You are correct. :check_mark:

To clarify, in puzzles of these sorts, a “knight” is someone who always tells the truth, and a “knave” is someone who always lies.

Of course, you also need some way to enforce Boolean answers, because if you ask a knave “What would the other guard say if I asked you which way to go?”, or the like, he could, according to his nature, answer “Cucumber”, because that is not, in fact, what the other guard would say, and hence a lie.

But there are techniques that avoid that problem, too.

I highly recommend Raymond Smullyan’s excellent book of logic puzzles, called What is the Name of This Book?. It has over 250 puzzles, many of them involving knights & knaves or variants thereof. For example, he adds “normals”, who sometimes lie and sometimes tell the truth; other characters who lie or tell the truth depending on the day of the week; knights and knaves who understand English but always speak a foreign language, so you can’t tell whether an answer they give means “yes” or “no”; knights and knaves who may be insane (eg. an insane knight always speaks what he believes to be the truth, but everything he believes is false and everything he disbelieves is true); and much more.

Years ago, Discover magazine had my favorite way to solve this sort of question. It presumes someone who will answer your question yes/no, and who’s really good at untangling logic. The question you ask is something like:

“If you were to answer the question ‘does this door lead to safety’ as honestly as you’re answering this question, would your answer be ‘yes’?”

LIE, SAFE DOOR: Would answer ‘does this door lead to safety’ as ‘no.’ Would their answer be yes? No. So they’re gonna lie about it and say “yes.”
LIE, DANGEROUS DOOR: Would answer ‘does this door lead to safety’ as ‘yes.’ Would their answer be no? Yes. So they’re gonna lie about it and say “no.”
TRUTH: They’ll tell you the truth, and then they’ll tell you the truth about that.

Basically, it doubles the liar’s lie, flipping it back to true.

Not quite. You get a lie, or the truth about the left door.

You have to ask the guard to state what the other guard would say, about a door.

Or are you saying that the lying guard would lie about lying too?

That’s generally what happens if you try to get random non-logicians in real life to roleplay the situation out. One or both of them almost inevitably does it wrong, making any logical questioning useless.

There is no other guard here, the other guy didn’t show up.

If the guy who did show up is a truther he will tell the truth about what he would say, and will tell me if the left door is safe. If he is a liar he will lie about the fact that he would lie to me and tell me whether the left door is safe.

I enjoy the barbarian solution. Cut one guard’s head off and ask the other guard “is he dead?” Then turn to the wizard who’s plotzing behind you and tell him “This one lies. Ask your question.”

I like the Order of the Stick solution.

Psst, Post 9.

You are on an island where there are three types of inhabitants:

  • always tell truth
  • always tell lies
  • vary their answers randomly :fearful:

You meet one representative of each (but they all look alike) in front of three roads. Only one road leads to the village.
You have one question only :roll_eyes:

Did you know they are serving free beer in the village?! :wink:

These riddles always presume that the two guards know each other’s status. Is that stated in the rules? Imagine that two random guys who never saw each other pulled guard duty on the same day.

I guess you’d have to trust that they were perfectly logical and could correctly handle the double-layered question that doesn’t involve the other guy.

One assumes that each guard at least knows their own status.

Though that does raise the question of what a knave would do, when asked a question to which they don’t know the answer. A knight can truthfully answer “I don’t know”, but “I know” isn’t really an answer to a question.

Three logicians walk into a bar. The bartender asks them “Will you each have a beer?”. The first logician say “I don’t know”. The second logician says “I don’t know”. The third logician says “Yes”.