If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Liar truth-teller brain teaser

How to get correct advice when you can only ask one question from either a liar or a truth-teller (when you don't know who is what). Created by Sal Khan.

Want to join the conversation?

  • blobby green style avatar for user erniecyc
    My question is, can't you simply ask either one of them the question:
    Do you know which door has the treasure?
    The truthteller will tell the truth saying yes and the liar says no.
    This is based on your assumption that both of them know the door to the treasure.
    (0 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user Dominic Behe
    I like this because there are a few different questions that would work. My answer was that you can ask either one of them "Suppose many people had come before me and asked which was the door of the riches. Which would you have pointed to?" The truth-teller would point to the correct door, and the liar would lie about his previous answers (for which he would have pointed to the wrong door), and point to the correct door!
    (80 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user WoodyG
    an alternate question to asked to either the truth teller or liar would be " If I were to ask you which door opens to the treasure what would you answer" Both the truth teller and the liar would answer with the correct door.
    (46 votes)
    Default Khan Academy avatar avatar for user
    • blobby green style avatar for user BASuby
      this is tough. would the liar straight out lie, or would he know he would lie and lie against his predicted lie. It comes down to a human characteristic, so I wouldn't chance asking this question. I'd just ask:"What would the other guy say is the incorrect door?", and then both would would say the correct door.
      (28 votes)
  • orange juice squid orange style avatar for user Adam G
    Another way I think is to ask them both a math problem like 5x5
    the liar would say -25 and the truth teller would say 25.
    (3 votes)
    Default Khan Academy avatar avatar for user
  • mr pants teal style avatar for user Alyssa.Nayar.172
    if you ask the lier and he tells you the brown guy would open door two how do you know that hes the liar and hes not just lieing
    (0 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user EscobedoKM
    you could just ask each one to open their door
    (4 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user go2pranav
    Hi, this brainteaser was fun but it also confused me. Any one who can explain it more thoroughly
    (3 votes)
    Default Khan Academy avatar avatar for user
    • duskpin sapling style avatar for user 12
      Oh yeah, this also confused me but I understood it later. So basically what Sal is saying is that if you ask the truth teller "What would the other guy say?" the truth teller would tell you the truth and say that the other guy would say Door Number 1 (which let's assume is the misery door). If you ask the liar "What would the other guy say?" then the liar , who knows that the truth teller would say Door Number 2, would say Door Number 1. In this case you know the incorrect door. Just pick the other door and you will have the correct door!
      (4 votes)
  • male robot hal style avatar for user Austin9389
    how do you know who is true but not a liar
    (3 votes)
    Default Khan Academy avatar avatar for user
    • male robot hal style avatar for user go2pranav
      You dont know who the liar or truthteller. Thats the point. You need to ask a question that would always give the correct answer . It should be a question that both the liar and the trutheller would tell you the same answer. The question Sal asks is correct because if he were to ask the truthteller , he would get the same answer the liar would vave given if he asked the liar. They both give the wrong door so you have to choose the opposite one
      to get the AMAZING TREASURE! hOPE THIS HELPED YOU!
      (2 votes)
  • mr pants teal style avatar for user Ryan Slater
    I don't get the solution even after thinking about it for a while!
    (3 votes)
    Default Khan Academy avatar avatar for user
    • mr pants teal style avatar for user tetris65
      Let us say that in this scenario, door L is the correct one, and door R is the wrong one. When you ask the liar, "What would the other guy say is the correct door to open" the liar knows that the truthteller would say door L, so instead, being the liar that he is, he replies, saying that it is the door R. However, if you ask the truthteller (but remember that you don't know who lies or tells the truth) the truthteller knows that the liar would say door R, so the truthteller would reply truthfully that is is door R. Although you can only ask one person, if you think about both scenarios, then you now know that door L is correct, because the liar would lie, saying that it is the opposite door, and the truthteller would tell the truth, which is the fact that the other guy would say door R. So you would go into the door that is opposite to what the person said.
      (4 votes)
  • starky ultimate style avatar for user matthew
    in several parts such as , i strictly disagree about the "brown guy." he is orange.
    (3 votes)
    Default Khan Academy avatar avatar for user

Video transcript

This brain teaser is a bit of a classic, and I'm sure a bunch of you have heard it before. But I wanted to include this in the brain teaser playlist that I'm making right now. Because this one is actually a good build up, and a bit of a nice warm up session for a slightly harder brain teaser that deals with people telling the truth and lying. So this one, we could call it the truth teller and the liar. So we're on some type of adventure quest, and we get to a fork in a road, right? So let's say that there's two doors. That's even better. So there's two doors. And I've gotten to the end of my adventure quest. And I know that my treasure is behind one of these two doors. Unfortunately, behind the other door is slow and painful death, and all of the misery in the world. So I want to pick the door carefully. And beside the doors, there are two people sitting there. There's one guy that looks like this. And then there's another guy that looks like this. And I know for a fact - the gods of brain teasers have come and told me - that both of these guys know which door has the treasure, and both of these guys know which door has the unbelievable despair that would ensue if I opened that door. So both of these guys know which door I should be opening. And I also know, and both of them know, that one of them always tells the truth. One is always honest. And then one of them always lies. And the problem is I don't know who's who. And I only have one chance. Obviously I can't just open a door and close it. If I open the wrong door, the despair will come out and kill. And you know, all of the pain will happen. And I can only ask one question of one of them to decide which door to open. So remember, they both know the correct answer. But one of them always lies. One of them always tells the truth. And I only have one question to ask of one of them. So the brain teaser is: What question do you ask? Who do you ask it to? Do you ask it to the green guy or to the brown guy? And then what do you do based on what they tell you? So that is the problem description. And I will now give you the solution. So if you don't want the solution, and I encourage you not to. I think if you think about this one for maybe 20 or 30 minutes, or at most a day. Sometimes when you sleep on a brain teaser it might come to you. So I encourage you to do that. So pause it, stop it, whatever. Don't listen anymore. Because here is the solution. So what you do is-- I mean, you don't know who's who. So it's not like there's a correct answer on who you ask a question of. But what you do is you ask you either of the people, what would the other guy say is the correct door to open? So let's think about this. So I could ask this guy, I'm asking the green guy, what would this guy say is the correct door to open? Now what happens if this guy tells the truth? If this guy tells the truth, then this guy's the liar, right? And so he will actually tell me what this guy would tell me to do. So what would the other guy say is the correct door to open, right? So this guy, if you were to tell him the correct door to open, he would tell you the incorrect door to open. Right? So when you ask this guy what would that guy say, he'll be honest about what this guy would say. And since he's a liar, he would tell you the incorrect door. So the answer to this question, you would get the incorrect door. Incorrect door would be the answer to that question if this guy's the truth teller and this guy's the liar. Now what happens if it's the other way around? What if I ask this guy and he happens to be the liar? So this guy's the liar, this guy's the truth teller. So the liar, he can't help himself. He will lie. So he knows that this other guy is the truth teller there, right? There's only two of them there. He knows this guy's the truth teller. And he knows that this guy when asked will say the correct door to open. So if you happened to be lucky and you ask this guy the correct door, he would tell it to you. This guy will lie. Let's say that this is the correct door, door number two is the correct door. So let's say that door number two is the correct door. If you ask this guy directly, he'll say oh yeah, door number two. You'll find all your happiness behind door number two. Now if this guy's a liar, he knows that the truth teller will say door number two. But he's a liar, so he'll tell you door number one. So once again, if I ask the same question of the liar, I still get the incorrect door. Right? So no matter who I ask this question to, their answer will be the wrong door, the incorrect door, or the door that I get all of the pain from. So what you do is you ask this question, what would the other guy say is the correct door to open? And no matter who you ask that to, they're going to answer the incorrect door. And so you do the opposite. So I ask this guy, mister green guy, what would mister brown guy say is the correct door to open? And green guy will say brown guy will tell you to open door number one. Well green guy says that brown guy will tell me to open door number one, then I should open up door number two. And likewise, if green guy says brown guy will say to open door number two, then I should open door number one. Anyway that's a nice warm up brain teaser for the next one I'm going to give you.