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

Blue forehead room brain teaser

What happens when 100 perfect logicians have to figure out if they each have a blue forehead? Created by Sal Khan.

Want to join the conversation?

Video transcript

There's a new reality television program, and it's called the Blue-- I should probably write it in blue-- but it's called the Blue Forehead Room. And what they do in this reality television program-- and you'll have to bear with me, because the show probably wouldn't be that interesting to watch-- but it's interesting to predict what happens. What they do is, they take a room. They'll call it the blue forehead room. And let's see, that's kind of a top view of the room. And let's say there's a door here. None of this is relevant to the actual problem. This is the door, right there. And what they do is they get 100 perfect logicians to sit in this room, in a circle. So they're all sitting in a circle in this room. Now, before the game even starts, before they even enter the room the first time, the logicians are told two things. They're told, One: that at least one of you has your forehead painted blue. At least one of you has your forehead-- And they all get their foreheads painted, so that obviously if you're the only guy who has your forehead painted. But you just don't know what color it is. So all of them have different color foreheads. Or, we don't know. But all they're told is, obviously I've painted your forehead. At least one of the people in the room that you will enter will have their forehead painted blue. And then they're also told that as soon as you deduce that your forehead is blue, you need to leave the room. And what's going to happen is-- and it's very important that I set this up properly. They're all outside of the room. No-one's inside the room. And let's say they're blindfolded. And while they're blindfolded, they essentially have the thing painted onto their forehead. So they can't see the paintbrush or anything. So they really don't know what's on their forehead. And then after that, they all enter the room. And they all sit in a circle like this, so that they can all look at each other. And let's say when they enter, the lights are off. So the lights are off, and then the protocol is that the lights will be turned on, and then they can all look around at each other. There's no reflective surfaces. They can't look into each other's eyes and try to see the reflection. No tricks like that. There are no mirrors in this room. Nothing like that. All they can do is look at each other. So, just as an example, let's say that this is me right here. As soon as the lights get turned on the first time, I'll be able to look at all the other people in the room. And I could see, it'll be pretty obvious to me if anyone has a blue forehead. Maybe that guy has one, that guy doesn't. I don't know, right? And I can see them. I can't see my own forehead. And what happens is, then they will turn off the lights, and the way they're going to do it is you have to leave the room after you have realized that you have a blue forehead. So for example, let's say I enter into the room, and because I'm a perfect logician I see things that allow me to perfectly deduce that I have a blue forehead. Then what they're going to do is they're going to turn off the lights again. And then, if I know that I have a blue forehead while the lights are turned off, I would leave the room. And then when they turn the lights back on, I'd be gone. So there would be no Sal here. So let's say there were 100 before, then there would be 99 guys sitting in the room. Right? As soon as I realize I have a blue forehead, when the lights get turned off, I leave. And just remember these are perfect logicians. So everyone in the room. And not only are they all perfect logicians, but they all know that everyone else is a perfect logician. So, everyone is also told, and this is true, everyone is a perfect logician. Which means they have infallible powers of logic. So my question to you-- Just remember, I have each of these perfect logicians. We set them up outside of the room, paint their foreheads. They're blindfolded. They have no clue. Then we have all of them walk into a dark room, sit in a circle like this. And then what we tell them is, as soon as you realize that you have a blue forehead, as soon as you have a blue forehead, you have to leave the room. Now my question to you is, let's say that we've actually painted everybody's forehead blue. What happens? So remember, this is what we've told each of the people. Right? As soon as you realize your forehead is blue, you leave the room. And now I've just asked you, the producers like to really play with these logicians. They've actually painted everybody's forehead blue. So when everyone goes in the room the first time, what's going to happen? Let's say I'm one of the logicians. This is me right here. As soon as I open my eyes, I'm going to see 99 other fellow logicians with blue foreheads. And then, maybe I can somehow deduce something about my own. I don't think you can. And the lights will go off. And then if I haven't deduced anything about my own blueness of my forehead, then they'll turn the lights back on. And then maybe some other guy will have left. I don't know. Or maybe not. And then I'll see the same 99 guys again. And that'll just keep occurring until something happens. And my question to you is what happens? When? And why? I'm thinking whether I should give you a hint right now. Well let me tell it to you this way. That's the problem. You should be able to solve it. And just so you know where this came from, if I remember correctly I think this was on a computer science exam I had at MIT. So just so you know, this isn't just for fun. I don't want to go into all of the applications that this type of problem can apply to, because that by itself would be a bit of a hint. So if you don't want a hint, turn off the video now or pause it. If you do want a hint, I'm about to give it to you. So my hint is-- and remember turn this off if you don't want to hint-- but the hint is what happens when there are less than 100 people. So I gave the situation where we have 100 logicians. But this problem is actually a lot easier if you try it with a smaller number. Anyway I'll see you in the solution video.