Main content
Math for fun and glory
Course: Math for fun and glory > Unit 2
Lesson 1: Brain teasers- Cheryl's birthday
- Heavier ball
- Liar truth-teller brain teaser
- Toggler brain teaser
- Alien abduction brain teaser
- Blue forehead room brain teaser
- Blue forehead room solution
- Forehead numbers brain teaser
- Light bulb switching brain teaser
- Path counting brain teaser
- 3D path counting brain teaser
© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice
Alien abduction brain teaser
Saving Earth from becoming a mushroom farm. Created by Sal Khan.
Want to join the conversation?
- A beggar's brother died, but the man who died had no brother.
How could this be?(51 votes)- The beggar is a girl because it doesn't say that the beggar was a boy we just assumed that.(4 votes)
- Is there a way to save everyone?(5 votes)
- There is a 50 50 chance that the first person will live, so technically if he gets it right all the people could be saved.(4 votes)
- I have a teaser:
A soldier needs to store his 70-centimeter sword, but the only chest available measures 40 centimeters long, 30 centimeters wide, and 50 centimeters high. Will the sword fit in the chest?(6 votes)- Sometimes, I try to fit myself in a small box, and I fit myself in the diagonal. So I will attempt to prove that the soldier may do this with his sword.
The diagonal of a rectangular prism is the hypotenuse of a triangle whose legs are the diagonal of the bottom and the height of the rectangular prism. So the diagonal of the chest is √((50 cm)² + ((30 cm)² + (40 cm)²)). This is 70.7106... cm. The diagonal of the chest is just 0.7106... cm longer than is necessary to store the sword, so yes, the sword will fit in the chest.(5 votes)
- I know that the other way works too, but that system means that you have to remember everything that everyone else said. If one person messes up, the rest of the people are thrown off. I propose that, if the person next in line is wearing a green hat, the person behind them immediately answers with their hat color. If the person in front of them is wearing a purple hat, the person pauses for a moment, then they answer the question.(3 votes)
- No information can be communicated by verbal trickery. This includes uses silence as an indicator of information. "Information" here has a precise definition that forces you along a logical pathway. Nice try, but it is technically cheating.(3 votes)
- Awesome! Puzzle....those aliens would be cynical to judge humanity based on our ability to reason.. what if humans were still primitive and had not discovered math or logical reasoning.. they would kill us!(4 votes)
- They would know if we were primitive, and if they are democrats the votes to kill them would be 23 against 65 or something like that. One does not simply judge a fish by its ability to climb a tree, because they don't climb trees.(2 votes)
- one guy have 50% to live..... which is very unfair....... there there is not justice nor fairness in the word....... and I cant believe i live in this kind of place..... so the question is, will there be a way to save the last guy?? I mean like for sure. 100%(6 votes)
- @sbowden514 What do you mean? African or European swallow?(2 votes)
- What if the guy in the back is very short?
or the aliens told you not to look leaning to the side?
WELL, HAVING A MIRROR WILL BE THE MOST USEFUL THING(4 votes) - Cant the last guy just say the color of the guy in front of him and onword..(2 votes)
- no because if they say the color of the person in front of him the person in front of him would have to say his color, not the next person's color in order to be saved.(3 votes)
- Im confused. At, Does the person in the back ask " What is the color of the hat" to the person in front or him. 3:32
Can someone explain this to me!(4 votes)- I think he meant the alien asked, "What color is the hat on your head?"(1 vote)
- At about, Khan says that you could pronounce it in some weird way. What if a simpler system was devised where if the person in front of you had a green hat, you could make your own guess in a British accent, and if the person in front of you had a purple hat, you could guess in an American accent? It would be easier for the people to work out who had what color hat, and it would still save the same amount of people. 6:19(3 votes)
- Sal was actually trying to say that you can't pronounce it some weird way, and that the only information you can give is your own hat color.(2 votes)
Video transcript
Ten of us have been abducted by
aliens because they view us as being representative
of the human race. And what they're going to do is
they're going to test us to see if the human race is
worthy of joining the intergalactic council
of planets. And if we're not, they're going
to kill us all and and turn Earth into a mushroom
farm, because that's their oil. So they take us together in
their spaceship and they say, you ten represent all of
humanity, and the fate of humanity rests in your hands. And we'll give you a test.
And the test is tomorrow. 24 hours from right now, we're
going to put you all in a completely dark room,
and line you all up one behind the other. So if this is one guy-- let me
see if I can draw-- so if this is the guy in the front. He's looking a little worried. Someone described me as the
Bob Ross of mathematics. So I'll attempt to do a little
Bob Ross work right here. So this would be the
first of us. He has a business tie
on, and whatever. He's facing in this direction. And then there's ten
more of them. So instead of redrawing them,
let me just copy and paste it. We all look mysteriously
similar to each other. That's the second one. And the third one. There's ten of us like this. I'll do one more. Oh that's good enough. There's ten of us, and we're
essentially lined up front to back, so that this guy, all
he sees is the back of this guy's head. And he can also see the back
of this guy's head. Maybe there's a slight
incline, maybe the floor is like this. Let me see if I can draw it. The floor is at a slight
tilt, so one guy is standing right here. Another guy is standing
right here. Another guy's standing
right here. There's ten of us in a line. We're all facing in
that direction. All this guy right here
can see is the wall. This guy can see the two
guys in front of him. This guy can see the one
guy in front of him. There's ten of them. It goes all the way
back to ten So what they tell us
is we're going to line you up like this. They even draw a nice diagram
like this, because they want to give us a fair chance of
preventing Earth from turning into a mushroom farm. And they say, while the room
is completely pitch dark, we're going to place a hat
on each of your heads. And the hat will either
be mauve-- so this would be a mauve hat. Or they'll be green. So they either get a mauve
or a green hat on the back of your head. And the hat will be designed
in such a way, it won't have a big rim. So that you can't look
up and see your hat. This is alien technology, so it
is completely impossible to see the hat on your own head. And the distribution of the
hats will be random. It could be all green hats. It could be all-- well, I'll say
purple-- because I'm not quite sure how to
pronounce mauve. So it could be all purple hats,
it could be half purple, half green. It could be nine green
and one purple. They don't know. It could be any combination
of hats. And what they're going to do--
and they tell us all of this-- is that they're going to start
with the person in the back. So this is the front wall,
this is the floor. This is the first guy right
here, second guy, third guy, fourth guy, fifth guy, sixth
guy, seven, eight, nine. So there's the tenth guy. They're all faced in
that direction. They're going to start with
this guy right here. And say, what color is
the hat on your head? And he'll answer, either
purple or green. He can only say purple
or green. I have to be exact here. He can only say purple
or green. And he can say it as
loud as he wants. But he has to say it at an even
tone, so that not more information can be conveyed,
other than the fact that he thinks his hat is
purple or green. Although this guy is close
enough that he can hear it. Everyone's going to hear what
everyone's going to say. But there's no intonation. And if you're right, if you say,
my hat is purple and you are wearing a purple
hat, you will live. And the 600 million
people that you represent will also live. And where they live
will not be turned into a mushroom farm. And if you're wrong, then they
will immediately-- what is that Star Trek weapon? Displace you. And they'll also do it to all
the people you represent. And turn all of their land
into mushroom farms. So there's this huge incentive
to try to get this right. So they say, we're going
to do this tomorrow. And your goal, obviously, is to
try to save as many lives as you can. And so we're going to put you
in a room, and you guys can discuss this for the next 24
hours, to come up with a system so that when we put you
in the dark room and we put the hats on each
of your heads. I shouldn't be drawing
brown hats. We'll put the hats
on your head. And then turn on the lights. I forgot to tell you that. They're going to put us in a
dark room, you can't see anything, we're all lined up. Then they're going to
turn on the lights. And so then they'll ask this
guy, what color is the hat on your head? He obviously can't look at his
own head, but he'll see everyone else's hats. And likewise this guy, he can't
see his own hat, and he can't see the guy behind him. But he'll hear what this guy
says, and he can see all of the hats in front of him. So they'll turn on the lights,
and then after this guy-- if he's right he lives, if he's
wrong he'll be displaced. And then they'll go
to the next guy. And then ask him. If he's right he lives,
and all the people he represents lives. If he's wrong he also
will get displaced. And they'll keep going all the
way up to the first guy. So our goal to essentially save
civilization, or at least human civilization, is to come
up with a system to save as many of us as possible. So that's the first take
of the brain teaser. So if you want to kind of
pause it right here. And actually before you pause
it, let me just clarify. All you can say is either
purple or green. No intonations. You can't say "pur-puuul" or
"purp-l" to kind of convey any type of information. All you can say is
purple or green. Or pronounce it in
some weird way. And there's no weird trick where
you can kind of look with the side of your eyes
or anything like this. You have to do it completely
based on what you hear and what you say. And if the aliens catch
any hint of you guys trying to cheat. Or all of us. I'm one of us. To cheat this, they'll just
evaporate everything and turn everything into mushroom
farms. So that's the problem
statement. How do you save as many
people as possible? And if you want to pause now,
feel free to do so. And now I'll give you kind of
a small hint, because this doesn't help you. It's easy to think of a lot of
solutions that might save a couple of people. But there's actually a solution
that will guarantee saving nine people. So that's the solution that
you have to come up with. And for the rest of this video
I'm just going to keep giving hints, and then eventually
give you the solution. So the goal is actually really
to save nine people. And you can which nine people
it's going to be. And so once again, pause it if
you don't want any more hints. It's going to be these
nine people. These nine people are guaranteed
to be saved. And this guy obviously is just
going to be guessing. He is the first guy to be asked
what color his hat is. He has no information. He can see the people in front
of him, but he has absolutely no information as to what
color this hat is. So he just guesses. So there's a 50% chance
that he's right. Without any other information,
we assume that there's a 50-50 chance that the hat on the
top of your head is a purple or a green one. So your expected number of
people you're going to save is nine and a half. With the system. So these people are guaranteed
to be saved. And so, there's a couple
of things that are more probabilistic that don't
quite get you there. That might come to
mind immediately. And once again, stop
this video. Because it's fun to think
of these yourself. But this guy might just see,
OK how many green hats are there, and how many purple
hats are there? And then whichever there are
more of, he might say, oh my hat is-- let's say there's six
purple and three green in front of him-- he might
say my hat is purple. And he's either right
or wrong, and he might get displaced. But at least he'll have conveyed
that information to the rest of the group. That hey, the majority of the
hats are purple, so you're better off guessing purple than
green, and it'll save at least six of these
people because they'll all guess purple. And that's OK, and in this
situation you're guaranteed to save more than half of these
nine people, so you're guaranteed to save at least
five of these nine people. And then probablistically
maybe you can get up to seven or eight. Then there's the other method. Well, there's a ton of them. I don't go into them because
I realize I don't have a lot of time. So here is the real
deal solution. So really pause it and wait and
watch it tomorrow, unless you don't want the solution. The guy in the back,
what he does. So there are a bunch
of people. One, two, three, four,
five, six, seven, eight, nine, ten people. And they're all wearing hats. And remember, we have 24 hours
to come up with a system. So everyone has the system. And we don't know who's going
to be in what order also. That's the other thing. But that actually doesn't help
or hurt you much anyway. So the guy in the back, what
he does is he counts the number of green or
purple hats. Right? This is the system we've
come up with. And so this is true of whoever's
in the back. Whoever's in the back has
to do this, right? So if he counts that the number
of green-- let's say this is our system. He counts the green
actually only. So count the green. And he determines that
the number of green is an odd number. If he determines that the number
of green that he sees in front of him is an odd
number, then he is going to say green. For the guess on the
top of his head. If the number of green is
an even number, he's going to say purple. And of course, he doesn't know
what his hat color is, but at least, well, one,
he has a 50-50 chance of saving himself. But now, what happens? Now, by giving this information
to the rest of the group, by screaming
green or purple. If this guy screams,
my hat is green! Then this guy, who's the next
guy in line, the next guy to be quizzed, knows that the
person behind him saw an odd number of green hats. Now this is interesting. If he counts the number of green
in front of him, and he also sees an odd number of green
hats, then that means that he was not one of the green
hats that this guy saw. So he must be a purple hat. So he'll just say, I
have a purple hat. And he will live. Right? And then you'll go
to this guy. And let's go the other
situation. Let's say that this guy,
he screamed green. Which means that he saw
an odd number of green hats in front of him. If this guy counts the green
hats of the eight people in front of him, and he says wow,
there's only an even number of green hats, he could say, wow
I must have a green hat. And so then he'll say green. And then he'll be right. Likewise, this guy-- let's say
it's the first situation that I said, this guy has
a purple hat on. So this guy saw an odd
number of green hats. He screamed green. And so this guy, he also sees
an odd number of green hats, because he's not one
of the green hats. So he says purple, he lives. This guy all of a sudden,
because this guy said purple. And he lived. I mean, you didn't
hear any buzzer. Actually you know he's going
to live, because the system will work. He knows that there must be an
odd number of green hats from him down forward, right? Because this guy didn't
say green. So if he knows that there's an
odd number of green hats from him down forward, and if he sees
an even number of green hats, he knows that he must be
one of the green hats, so he'll say green. And in that situation, if this
guy screamed green then that means that if this guy saw an
odd number of green hats from here on down, and one of these
guys behind him, or every time someone behind you says green
after that, then the number of green hats that are odd or even
in front of that person will change. And so they have to keep track
of that in their minds to figure out if the hats in front
of them are going to be green or purple. Actually let me give an
example because that's probably the easiest way. So there's one, two-- Actually
let me just do it in a neutral color so I don't waste time. So let's say the hats are green,
purple, purple, green, green, purple, green, green. How many is that? One, two, three, four, five,
six, seven, eight, nine, ten. So you go to the first
guy right here. And so he counts. He says, OK, how many
greens are there? There's one, two, three,
four, five. There are five greens. So the greens are odd. Which says that he is
going to say green. That's the system we've
come up with. So when they go up to this
guy, he says green. And he's wrong. So he actually gets
eliminated. And maybe the aliens were
willing to give us a pass on the first guy, but let's
say he gets eliminated. But he said green, so then this
guy on down knows that in front of that guy there was an
odd number of green hats. Now, this guy, he looks forward
and he counts one, two, three, four,
five green hats. So he also sees an odd number
of green hats, so he knows that he must not have a green
hat, because if he had a green hat, then it would turn the
number of green hats that he saw into even. So he doesn't have
a green hat. He says, I have a purple hat. And he lives. Now this guy, he counts
the number of green hats in front of him. One, two, three, four
green hats. He says, well gee, I only see an
even number of green hats. Up until this guy, he saw an
odd number of green hats. I must be a green hat. So he says green. Check. Now this guy's turn. So first of all, he knows how
many green hats this guy saw. He knows that this guy saw
exactly four green hats. Because if this guy had seen
five green hats, he would have said purple. So this guy knows that this
guy saw four green hats. But he sees only one, two,
three green hats. Right? So he knows that he must be
one of the green hats. So he screams green. So check. So then this guy knows, wow
there must be only three green hats from him on down. Because this guy must have
seen three green hats. If he saw four, he would
have said purple. So that guy uses that same logic
to say OK, there must be three green hats from
me on down. I see three green hats, so I
must not have one of them. I must be purple. And you just keep on going
down all the way until everyone answers correctly. And you save at least
nine people. And the bulk of humanity. And if you gave a pass
on the first guy, you save all of humanity. Anyway, I hope you found
that one enjoyable. This is one of my favorite
brain teasers. And I apologize because I
realize when I was trying to explain it without the example,
it might have gotten a little confusing. But hopefully this example
explains things a little bit better. Although it might be confusing
to see green and purple written in blue. See you in the next video.