Can you solve the prisoner hat riddle? - Alex Gendler

TED-Ed
5 Oct 201504:34

Summary

TLDRIn a hypothetical scenario, ten individuals are captured by aliens who plan to eat them unless they can demonstrate logical cooperation. The aliens test them by placing them in a line with either black or white hats and requiring them to guess their own hat color without communication. The solution involves the first person to use 'black' or 'white' to indicate the parity of black hats seen, enabling the others to deduce their colors. This strategy, despite a 50% chance of the first person guessing wrong, ensures the survival of the group by logical deduction based on parity.

Takeaways

  • 👽 Aliens have captured 10 individuals and are considering eating them, but have a rule against eating highly logical and cooperative beings.
  • 🧢 The captives are lined up in a single file with hats of either black or white color, without knowing their own hat color.
  • 🚫 The captives are not allowed to look behind or communicate in any way other than guessing the color of their hat.
  • 🔢 The aliens will spare the captives if at least nine of them guess the color of their hats correctly.
  • ⏱ The captives have five minutes to devise a strategy to maximize their chances of survival.
  • 📣 The first person in line can see all the other hats and will use the color 'black' or 'white' to communicate coded information.
  • 🔑 The coded information is the parity (odd or even) of the number of black hats, which is the only piece of information needed for the strategy.
  • 🤔 The strategy involves each person deducing their own hat color based on the parity information and the number of black hats they see in front of them.
  • 🎩 The first person has a 50% chance of guessing wrong about their own hat but provides crucial information for the others to guess correctly.
  • 🔄 Each subsequent person in line adjusts their expected parity based on the information given by the previous person and what they observe.
  • 🏁 The strategy ensures that, except for the first person, everyone else can determine their hat color with certainty, thus saving the group.

Q & A

  • What is the situation presented in the video script?

    -In the script, ten individuals have been captured by super intelligent aliens who are considering eating them but need to determine if they are logical and cooperative enough to be spared.

  • Why does the alien civilization forbid eating highly logical and cooperative beings?

    -The script does not provide a specific reason, but it implies that the aliens have a moral or cultural code that respects the intelligence and cooperation of certain beings.

  • What is the test the aliens have decided to give the captured humans?

    -The test involves the humans standing in a line, each wearing a randomly assigned black or white hat, and guessing the color of their own hat based on the colors visible in front of them without any communication other than a single word.

  • Why is communication limited to only the words 'black' or 'white'?

    -Any other form of communication, including signals through intonation or volume, would result in the immediate execution of all humans, as per the rules set by the aliens.

  • What is the goal of the humans in this test?

    -The goal is for at least nine of the humans to guess the color of their hats correctly to ensure that all of them are spared from being eaten by the aliens.

  • What strategy is suggested by the script to solve the problem?

    -The strategy involves the person at the back of the line using the words 'black' or 'white' to communicate the parity (odd or even) of the number of black hats they see, which allows the others to deduce their own hat colors.

  • Why is the parity of the number of black hats a key element in the strategy?

    -Parity has only two possible values (odd or even), which fits the limitation of using only two words to communicate, and it provides enough information for the others to deduce their own hat colors.

  • What is the role of the first person in the line regarding the strategy?

    -The first person in the line is expected to communicate the parity of the black hats they see, which sets the expectation for the rest of the line to deduce their own hat colors.

  • How does the strategy ensure that all but one person can determine their hat color correctly?

    -By using the parity information and the expectation of odd or even counts, each person can determine their hat color with certainty unless their count doesn't match the expected parity, indicating that their hat is the color that makes the count match.

  • What is the expected outcome if the strategy is executed correctly?

    -The expected outcome is that nine people will guess their hat colors correctly, and one person (the first in line) may guess incorrectly, still meeting the requirement to be spared by the aliens.

  • What does the script imply about the aliens' perception of logic and cooperation?

    -The script implies that the aliens value logic and cooperation to such an extent that they are willing to spare beings who demonstrate these qualities, even if it means going hungry.

Outlines

00:00

👽 Alien Abduction and Logical Test

In this scenario, ten individuals are captured by intelligent aliens who are considering eating them. However, their civilization's rules prevent them from consuming highly logical and cooperative beings. To determine if the humans qualify, the aliens decide to test their logic by placing them in a line and giving each a randomly assigned black or white hat. The humans cannot see their own hat or communicate in any way other than guessing the color of their hat after the one in front of them. The challenge is to devise a strategy that allows at least nine to guess correctly to avoid being eaten. The aliens give the humans five minutes to discuss a plan before the test begins.

🎓 The Parity Solution to the Hat Puzzle

The solution to the hat puzzle involves using the concept of parity, which is the odd or even nature of a number. The person at the end of the line, who can see all the hats, will use the word 'black' or 'white' to communicate whether the total number of black hats is odd or even. This information allows the others to deduce their own hat color. The first person has a 50% chance of guessing wrong but provides crucial parity information. Subsequent individuals use this parity to determine their own hat color based on the count of black hats they see and the expected parity. This strategy ensures that all but the first person can guess correctly, thus meeting the aliens' condition for survival.

Mindmap

Keywords

💡Super intelligent alien overlords

The term 'super intelligent alien overlords' refers to the hypothetical extraterrestrial beings with superior intelligence who have captured the humans in the video script. They are the central antagonists in the scenario, setting the rules for the test that the humans must pass to avoid being eaten. This concept is crucial to the video's theme of logic and cooperation under life-threatening circumstances.

💡Cooperative beings

In the context of the video, 'cooperative beings' are individuals who work together towards a common goal. The aliens' civilization forbids eating such beings, which is why they devise a test to determine if the humans qualify. This concept is central to the video's narrative, as it sets the premise for the challenge the humans face and the need for them to demonstrate their cooperative nature.

💡Universal translator

A 'universal translator' is a hypothetical device or technology that can instantly translate languages, allowing communication between different species or beings. In the script, the alien uses it to communicate the rules of the test to the humans. This concept is important as it facilitates the interaction between the aliens and humans and sets the stage for the ensuing logic puzzle.

💡Single-file line

A 'single-file line' is a formation where individuals are arranged in a straight line, one behind the other. In the video's scenario, the humans are placed in such a line to participate in the hat guessing game. This arrangement is essential to the strategy that the humans develop to solve the puzzle, as it dictates the order in which they will make their guesses.

💡Random assignment

The term 'random assignment' refers to the process of distributing items or tasks without any specific pattern or order, often used in games or experiments to ensure fairness. In the script, the aliens randomly assign black or white hats to the humans. This element of randomness adds an element of uncertainty to the challenge and is key to the logic puzzle that the humans must solve.

💡Parity

Parity, in mathematics, refers to the property of numbers being either even or odd. In the video's context, the first person in line uses the parity of the number of black hats to communicate information to the others. This concept is central to the strategy that allows the humans to deduce their hat colors and is a key part of the solution to the puzzle.

💡Logic puzzle

A 'logic puzzle' is a type of problem that requires logical reasoning to solve. The video presents a classic logic puzzle where the humans must determine the color of their hats based on limited information. The puzzle is the main challenge of the video, testing the humans' ability to think logically and cooperatively under pressure.

💡Coded information

In the video, 'coded information' refers to the strategy devised by the humans where the first person uses the word 'black' or 'white' to convey the parity of the black hats seen. This coded message is vital to the solution, as it allows the rest of the group to deduce their hat colors without direct communication.

💡Deducing

To 'deduce' means to draw a conclusion based on reasoning from known facts or premises. In the script, the humans use deductive reasoning to figure out their hat colors after receiving the coded information from the first person. This process of deduction is the core of the strategy that leads to the solution of the logic puzzle.

💡Strategy

A 'strategy' is a plan or method designed to achieve a particular goal. In the video, the humans develop a strategy to ensure that at least nine of them guess their hat colors correctly. This strategy is essential to the video's theme of using logic and cooperation to overcome a challenge.

💡Absolute certainty

The phrase 'absolute certainty' refers to being completely sure without any doubt. In the context of the video, it describes the confidence with which the humans, except for the first one, can guess their hat colors after understanding the coded message. This concept highlights the effectiveness of their strategy in solving the logic puzzle.

Highlights

Aliens capture ten humans and plan to eat them unless they pass a logic test.

Aliens value logic and cooperation, will spare humans if they demonstrate these traits.

Humans are lined up in size order, cannot see their own hat color or communicate verbally.

Hats are black or white, assigned randomly, with unknown distribution.

Objective is for at least 9 out of 10 to guess their hat color correctly to be spared.

First person in line sees the hat colors of everyone else and must convey information.

Using parity (odd/even) of black hats seen, first person can communicate crucial information.

If first person sees odd number of black hats, they say 'black', if even, they say 'white'.

Subsequent prisoners use parity information to deduce their own hat color with certainty.

If a prisoner sees expected parity, they know their hat is the opposite color.

Strategy allows all but the first person to guess their hat color correctly.

First person has 50% chance of guessing wrong, but their role is vital for others.

Prisoners switch expected parity after each correct deduction by a preceding person.

This strategy works for any possible arrangement of black and white hats.

Aliens are outsmarted, humans are spared as they demonstrate high logic and cooperation.

Transcripts

play00:10

You and nine other individuals have been captured

play00:13

by super intelligent alien overlords.

play00:17

The aliens think humans look quite tasty,

play00:20

but their civilization forbids eating highly logical and cooperative beings.

play00:26

Unfortunately, they're not sure whether you qualify,

play00:29

so they decide to give you all a test.

play00:32

Through its universal translator,

play00:34

the alien guarding you tells you the following:

play00:37

You will be placed in a single-file line facing forward in size order

play00:43

so that each of you can see everyone lined up ahead of you.

play00:47

You will not be able to look behind you or step out of line.

play00:51

Each of you will have either a black or a white hat on your head

play00:55

assigned randomly,

play00:57

and I won't tell you how many of each color there are.

play01:01

When I say to begin, each of you must guess the color of your hat

play01:05

starting with the person in the back and moving up the line.

play01:09

And don't even try saying words other than black or white

play01:12

or signaling some other way, like intonation or volume;

play01:16

you'll all be eaten immediately.

play01:19

If at least nine of you guess correctly, you'll all be spared.

play01:24

You have five minutes to discuss and come up with a plan,

play01:27

and then I'll line you up, assign your hats, and we'll begin.

play01:31

Can you think of a strategy guaranteed to save everyone?

play01:36

Pause the video now to figure it out for yourself.

play01:39

Answer in: 3

play01:40

Answer in: 2

play01:41

Answer in: 1

play01:43

The key is that the person at the back of the line

play01:45

who can see everyone else's hats can use the words "black" or "white"

play01:50

to communicate some coded information.

play01:53

So what meaning can be assigned to those words

play01:56

that will allow everyone else to deduce their hat colors?

play02:00

It can't be the total number of black or white hats.

play02:04

There are more than two possible values,

play02:06

but what does have two possible values is that number's parity,

play02:11

that is whether it's odd or even.

play02:15

So the solution is to agree that whoever goes first will,

play02:19

for example, say "black" if he sees an odd number of black hats

play02:23

and "white" if he sees an even number of black hats.

play02:27

Let's see how it would play out if the hats were distributed like this.

play02:32

The tallest captive sees three black hats in front of him,

play02:35

so he says "black," telling everyone else he sees an odd number of black hats.

play02:40

He gets his own hat color wrong, but that's okay

play02:44

since you're collectively allowed to have one wrong answer.

play02:48

Prisoner two also sees an odd number of black hats,

play02:51

so she knows hers is white, and answers correctly.

play02:55

Prisoner three sees an even number of black hats,

play02:58

so he knows that his must be one of the black hats

play03:01

the first two prisoners saw.

play03:03

Prisoner four hears that and knows

play03:05

that she should be looking for an even number of black hats

play03:08

since one was behind her.

play03:10

But she only sees one, so she deduces that her hat is also black.

play03:16

Prisoners five through nine are each looking for an odd number of black hats,

play03:20

which they see, so they figure out that their hats are white.

play03:25

Now it all comes down to you at the front of the line.

play03:29

If the ninth prisoner saw an odd number of black hats,

play03:32

that can only mean one thing.

play03:35

You'll find that this strategy works for any possible arrangement of the hats.

play03:39

The first prisoner has a 50% chance of giving a wrong answer about his own hat,

play03:44

but the parity information he conveys

play03:46

allows everyone else to guess theirs with absolute certainty.

play03:52

Each begins by expecting to see an odd or even number of hats

play03:56

of the specified color.

play03:58

If what they count doesn't match, that means their own hat is that color.

play04:02

And everytime this happens,

play04:04

the next person in line will switch the parity they expect to see.

play04:08

So that's it, you're free to go.

play04:10

It looks like these aliens will have to go hungry,

play04:13

or find some less logical organisms to abduct.

Rate This

5.0 / 5 (0 votes)

Related Tags
Alien OverlordsHuman CaptivesLogic TestCooperative StrategyHat ColorsParity InformationEscape PuzzleSurvival ChallengeGuessing GameCaptive CooperationOdd Even Logic