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

Toggler brain teaser

Separating the truthteller from the togglers! Created by Sal Khan.

Want to join the conversation?

  • female robot grace style avatar for user Jade
    Can't you just ask {not to anyone particular ,so they all answer} "Would the truthteller step forward?" Then take note of who stepped forward. Next ask the same question and the person who took 2 steps in total or stayed in the same place is the truthteller. Right?
    (302 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user joseph.grn
    THE SOLUTION IN THE VIDEO IS WRONG. If the person answers "no" to the first question, he can answer "everyone" or "no one" to the second question. They are both valid lies and do not violate the terms of the riddle. If he does say "everyone" or "no one", then you don't really get anywhere and still don't know who the truth-teller is.

    I'm not trying to be a troll. But this logic does not conflict with any of the premises.
    (28 votes)
    Default Khan Academy avatar avatar for user
  • aqualine ultimate style avatar for user Malvar
    I think there's a simpler way to solve this:
    Just ask anyone: "Who are the togglers?"

    If the person names 4 people, then the only person not mentioned is the truth teller

    If the person lies and names 1 person, then the person mentioned is the truth teller

    That way you can ask one question to anyone and know the truth teller. Am I right?

    EDIT: You guys realize that my comment was about 2 years ago? HAHAHA It's just that I still get notifications about people commenting here
    (42 votes)
    Default Khan Academy avatar avatar for user
  • old spice man green style avatar for user Ivo van der Hoeven
    My solution: "If I would ask you to point out the truthteller after this question, who would you not point out?". Either the toggler points out the truthteller, or the truthteller points out a random other guy. Ask any other than the two involved (who is definitely a toggler) the same question, and he'll point out the real truthteller.
    (16 votes)
    Default Khan Academy avatar avatar for user
  • female robot amelia style avatar for user Miso
    i think i solved it by asking are you a toggler and if they said yes, they would have to be a truth telling toggler so then asked who is not the truth teller and they give me the truth teller, if they said no they are either a liar or the truth teller, so then ask who is the truth teller, the truth teller would say "i am" the toggler that lied now has to be telling the truth and would give me the truth teller. anyone see how that doesnt work?
    (11 votes)
    Default Khan Academy avatar avatar for user
  • orange juice squid orange style avatar for user João Louro
    Why can't you just ask someone the question 'Who are the toddlers?'

    If the answerer only pointed one person, That person you asked the question to would be a lying toddler, and the person he pointed would be the truthteller.

    If the answerer pointed several people, he would be the tuthteller.

    Is this method right?
    (6 votes)
    Default Khan Academy avatar avatar for user
    • marcimus pink style avatar for user Jenny Jiang
      That was my original answer too, but his makes sense

      .He wrote three questions, but he'd only ask two, and only the questions that he actually asks counts as a question.
      If the toggler/truthteller answered "yes", he wouldn't ask two more questions, he'd only ask "who is the truthteller?" and know the answer.
      Same thing the other way around. If the toggler answered "no", then he would just ask "who is not the toggler?" and know the answer.
      (4 votes)
  • blobby green style avatar for user Dave SpiderMonkey Moon
    Should be able to do it in one question - Ask one person, "Who here can lie to me?" TT - points to the other four / TogTruth - Points to self and other three Togs / TogLie - points to TT - no need for a second question.
    (5 votes)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Dbolin
    In question #2 why would the Toggler have to tell you who the "truthteller" is, if he is able to lie then he could just say George Washington or something. Therefore leaving you without an answer! Instead ask the same person "who are the Togglers" twice, which will give you the answer!
    (3 votes)
    Default Khan Academy avatar avatar for user
  • starky sapling style avatar for user 1gnis
    Another answer.
    ask any person who is a toggler
    if he lies he has to point to the truth teller
    if he tells the truth he has to point to the togglers
    so in the first case you get 1 answer
    in the second case you get 4 answers so the remaining person is the truth teller
    then ask the person if he is a truth teller
    (4 votes)
    Default Khan Academy avatar avatar for user
    • ohnoes default style avatar for user Tejas
      If you ask someone who is telling the truth, the answerer will just point to one person. That is because the question is "who is a toggler", which is a singular question. A singular question demands a singular answer, so a truth teller or a truthful toggler must answer with just one toggler.
      (2 votes)
  • blobby green style avatar for user corbindperez
    Couldn't you just ask who the truth teller is twice to the same person
    (3 votes)
    Default Khan Academy avatar avatar for user
    • leaf red style avatar for user Joe Runner
      No, because unless he says I am the truthtelller, both times you ask him, then he is a toggler, and the second person he says will be the truthteller. But if he points to two different people and does not point to himself, then you have no way of knowing who really is the truthteller. Really, only sal's way does it work every time just asking two questions. Hope that answered your question.
      (3 votes)

Video transcript

This brain teaser in this video is once again not one that I made up. I actually don't remember the first time that I heard it. I think it was in the back of a magazine. I want to say Scientific American. And me and a bunch of buddies, we were traveling through Europe. And it kind of became our pastime to do these brain teasers in the back of magazines. And just so you know, I think a lot of you think that these type of brain teasers, you can just read them and solve them. And if you can't solve them, then you're not good at this type of thing. This brain teaser I'm about to give you, I just kind of sat and thought about it, and me and my buddies, we argued about it for literally about a day. And then I just slept on it. And then first thing in the morning, I woke up all my friends, I was like, I figured it out! So this isn't some kind of easy thing. And I encourage you, just listen to the statement, understand it, and then pause the video. And then think about it for 24 hours. And then come back to it. One, you'll probably solve it yourself. And if you don't, in 24 or 48 hours, then you'll probably find the solution that much more satisfying. So this is the problem of the togglers. Not toddlers. Togglers. I have an infant, so words like toddler are in my brain. But this is the problem of the togglers. So there are five guys in front of you. That's one of them. Two. Three. Four. Five. They don't have to be guys. They can be of any gender. And four of them are what we call togglers. So four of them. Four togglers. And what a toggler does is, the first time you ask them a question, they're either going to tell the truth or they're going to lie. So truth or a lie. But then the second time that you ask them, they're going to toggle. They're going to switch. So the second time you ask them a question, if they told the truth the first time, then the next time you ask that same person a question, they're going to switch to lying. But if they lied the first time you asked them a question, then they're going to switch to telling the truth. And then it goes on, and so on, and so forth. So if you ask the same person the third question, if they told the truth the first time, then they'll lie the second time you ask them a question, and then the third time they'll tell the truth again. It's like, if I was a toggler and you said, hey you, what is your name? And if I said, oh my name is Bill. Then clearly I'm lying that first time. And then you pointed to me again, and you say, what is your name? And I say, oh my name is Sal. And if you ask me again, what is your name? I would say, oh, my name is Susan. And if you ask me again, my name is Sal. So the first time, I just decided to lie. But just as easily, I could've decided to tell the truth the first time. You might have said, hey you, what's your name? I would have said, Sal. And then you ask me, what's your name again? And I would have said Elizabeth. And then you ask me, what's my name again? I would say, oh, my name is Sal. And then again, what's your name? And I would say, you know, George Washington or something arbitrary. But I think you get the idea. A toggler-- I don't know who's a toggler. Let's say that this is a toggler. The first time you ask them a question, they might lie, they might tell the truth. But if they lie, the next time you ask the same person a question, they're going to tell the truth. But the first time you ask them a question, and they did tell the truth, the next time you ask the same person a question, he or she is going to lie. So that's a toggler. So you can already imagine, this is-- I don't know. The first time that I read the problem it kind of made my brain hurt. This notion of a toggler. It's much easier when there's a reality where people only lie or only tell the truth. It's much harder when they toggle. And not only do they toggle, but their initial state, whether they start telling the truth or they start off lying. You don't know. That's arbitrary. There's no way of predicting whether this person-- First of all, we don't know if this person is a toggler, because I said there's only four togglers. But even if they are toggler, I don't even know if the first time I ask them a question whether they're going to tell the truth or whether they're going to lie. So four of them are togglers. What's the fifth? Well, you probably could guess because this is how these brain teasers go. The fifth is a truth teller. And he is much simpler. Or he or she. I don't want to give any clues on who it might be. Is a truth teller. And a truth teller always tells the truth. So the goal of this brain teaser is to figure out who is the truth teller. So you want to know which of these five people is-- So let's say, goal. Who's truth teller? And as you can imagine, you don't have infinite questions to do this with. You have exactly two questions to do this with. And you have two questions. And those two questions, they can be one question to this guy and another question to this guy. Both questions could be to this guy. Both questions could be to her right over there. So the questions don't have to be to the same person, although they can be to the same person. Or they could be to two different people. So you have two questions. Any question to ask of any combination of either two questions to one person or two questions to two people. And by the end of those two questions, you should know for sure who is the truth teller. And that is the brain teaser statement. So pause it now if you don't want any hints or the solution, or anything else. So I encourage you to pause it and think about it for at least a day. And sleep on it. Because a lot of the real math problems or logic problems that are worth solving aren't the ones that you can solve right when you see them. They're the ones where you kind of sit and let your brain do a little background processing while you sleep. So that said, hopefully you've stopped it and now you've resumed it after really struggling with this for a long period. Not eating and sleeping and all the things that normal people do. And now you're ready for the solution. Or even better, you're ready to confirm your solution. So first I'll give you a hint. I mean, it's a tough question. I struggled with this at first. I was like, when you ask someone a question how do you know if they're lying or not? How do you know if they're the truth teller? How do you know if they're a toggler? You don't have any information. So the crux of this problem is, essentially, it doesn't matter who you're asking the question to the first time around. And actually the solution is that it doesn't matter who you're asking the question to the second time around. You want to ask a question so that no matter what they say, you know what they're going to do the second time around. You know whether they're going to tell the truth the second time around, or you know whether they're going to lie the second time around. And that's a hint. And if you just want a hint and then to keep thinking about it, pause it again. Because I'm about to give you the solution. So question one. And you can pick any of the five people to ask this question to. And that's kind of the nature of one of these solutions. There's no reason for you to pick one of the five over the other. They're all equally likely to be the truth teller. So you ask them, are you the truth teller? So let's think about a couple of-- Well first of all, they're either going to answer to this, yes or no. So there could be two situations. They're either going to say yes, or they're going to say no. So if someone says yes to are they the truth teller, it means that either they are the truth teller telling the truth. Or they are a lying toggler. If they say that they are not the truth teller, they clearly cannot be the truth teller, because the truth teller cannot lie about not being the truth teller. And so they have to be a toggler. And they'd be an honest toggler. They'd be a toggler who's telling the truth. Right? So it would be a truthful toggler. Remember, I ask anybody, any of these five people right here, say, are you the truth teller? If they say yes, I immediately know that they're either the truth teller telling the truth, or they're a lying toggler. If they say no, I know that they are a truthful toggler. Now, what's interesting is, in this scenario, if they say yes, what do I know that they're going to do next? So if this is the truth teller, and they told the truth, on the second question, they're going to tell the truth again. They're going to tell the truth on question number two. If they're the lying toggler, what are they going to do when you ask them another question? Well, they toggle. If they lie the first time you ask them, they're going to tell the truth the second time you ask them. So they're going to tell the truth on question number two. So if the person says yes to, are you the truth teller? You immediately know that no matter who they are, that they're going to tell the truth on question number two. So if you can know for a fact that the person's going to tell the truth on question number two, you ask them, who is the truth teller? So this is number two. Who is the truth teller? So it's kind of weird. You go to someone and say, are you the truth teller? And they'll say yes. And then you ask them again, who's the truth teller? And then, because they have to tell the truth, they will actually either say, if it was this case, they'd say I am the truth teller. Or if it's this case, they'd say no, that dude over there is the truth teller. And then you'll know who the truth teller is. Now what happens in this situation? That they're a truthful toggler? Well on the second question, what are they going to do? They're going to lie. They're going to lie on the second question, right? On question number two. So if you know for a fact that someone's going to lie, how can you phrase a question so you can figure out who the truth teller is? Well, if they say no to this first question, and you know they're going to lie on the second one, your second question should just be, who is not the truth teller? So the only way to lie on this question-- and this person has to lie now-- is to tell you who the truth teller is. And so, using the first question, are you the truth teller? We can immediately predict what the person's going to do on the second question. And then we can phrase the second question, depending on that response, to definitely know who the truth teller is. Anyway, I thought you'd enjoy that. And hopefully you see why the liar game show brain teaser was a bit of a warm up for this one. See you in the next video.