yego.me
💡 Stop wasting time. Read Youtube instead of watch. Download Chrome Extension

Can you solve the demon dance party riddle? - Edwin Meyer


3m read
·Nov 8, 2024

Once each year, thousands of logicians descend into the desert for Learning Man, a week-long event they attend to share their ideas, think through tough problems... and mostly to party.

And at the center of that gathering is the world’s most exclusive club, where under the full moon, the annual logician’s rave takes place. The entry is guarded by the Demon of Reason, and the only way to get in is to solve one of his dastardly challenges.

You’re attending with 23 of your closest logician friends, but you got lost on the way to the rave and arrived late. They're already inside, so you must face down the demon alone. He poses you the following question:

When your friends arrived, the demon put masks on their faces and forbade them from communicating in any way. No one at any point could see their own masks, but they stood in a circle where they could see everyone else’s.

The demon told the logicians that he distributed the masks in such a way that each person would eventually be able to figure out their mask’s color using logic alone. Then, once every two minutes, he rang a bell. At that point, anyone who could come to him and tell him the color of their mask would be admitted.

Here’s what happened: Four logicians got in at the first bell. Some number of logicians, all in red masks, got in at the second bell. Nobody got in when the third bell rang. Logicians wearing at least two different colors got in at the fourth bell. All 23 of your friends played the game perfectly logically and eventually got inside.

Your challenge, the demon explains, is to tell him how many people gained entry when the fifth bell rang. Can you get into the rave?

Pause here to figure it out yourself.

Answer in 3. Answer in 2. Answer in 1.

It’s initially difficult to imagine how anyone could, using just logic and the colors they see on the other masks, deduce their own mask color. But even before the first bell, everyone will realize something critical.

Let’s imagine a single logician with a silver mask. When she looks around, she’d see multiple colors, but no silver. So she couldn’t ever know that silver is an option, making it impossible for her to logically deduce that she must be silver. That contradicts rule five, so there must be at least two masks of each color.

Now, let’s think about what happens when there are exactly two people wearing the same color mask. Each of them sees only one mask of that color. But because they already know that it can’t be the only one, they immediately know that their own mask is the other.

This must be what happened before the first bell: two pairs of logicians each realized their own mask colors when they saw a unique color in the room. What happens if there are three people wearing the same color? Each of them—A, B and C—sees two people with that color.

From A’s perspective, B and C would be expected to behave the same way that the orange and purple pairs did, leaving at the first bell. When that doesn’t happen, each of the three realizes that they are the third person with that color, and all three leave at the next bell.

That was what the people with red masks did—so there must have been three of them. We’ve now established a basis for inductive reasoning.

Induction is where we can solve the simplest case, then find a pattern that will allow the same reasoning to apply to successively larger sets. The pattern here is that everyone will know what group they’re in as soon as the previously sized group has the opportunity to leave.

After the second bell, there were 16 people. No one left on the third bell, so everyone then knew there weren’t any groups of four. Multiple groups, which must have been of five, left on the fourth bell. Three groups would leave a solitary mask wearer, which isn’t possible, so it must’ve been two groups.

And that leaves six logicians outside when the fifth bell rings: the answer to the demon’s riddle. Nothing left to do but join your friends and dance.

More Articles

View All
The Queen's University Talk: The Rising Tide of Compelled Speech
[Applause] Thank you. Well, welcome everyone. I’m assuming that applause was not for me. [Laughter] My name is Bill Flanagan, and I’m the dean of law here at Queen’s University. I am pleased to welcome all of you here today for the inaugural Liberty lectu…
Homeroom with Sal & US Sec. of Education, Dr. Miguel Cardona - Thursday, April 29
Hi everyone, Sal Khan here from Khan Academy. Welcome to the Homeroom live stream. We’re very excited to have a conversation with U.S. Secretary of Education Miguel Cardona today. But before we jump into that conversation, I will remind you a few of my ty…
Angle of x' axis in Minkowski spacetime | Special relativity | Physics | Khan Academy
We’ve been doing some interesting things in the last few videos. We let go of our Newtonian assumptions that the passage of time is the same in all inertial frames of reference, that time is absolute, that one second in my frame of reference is the same a…
Calculations using Avogadro's number (part 1) | Chemistry | Khan Academy
I have about 3.21 grams of sulfur powder over here. My question to you is, how many atoms of sulfur are there? At first, this question sounds ridiculous. I mean, there’s going to be lots and lots of atoms. How in the world are we going to count that? That…
Lecture 4 - Building Product, Talking to Users, and Growing (Adora Cheung)
Thanks for having me. Um, so today I am going to be talking about how to go from zero users to many users. Um, uh, I’m just assuming that you have many great ideas in your head at this moment, and um, you’re kind of thinking about what the next step is. S…
Why Blue Whales Don't Get Cancer - Peto's Paradox
Cancer is a creepy and mysterious thing. In the process of trying to understand it, to get better at killing it, we discovered a biological paradox that remains unsolved to this day: Large animals seem to be immune to cancer, which doesn’t make any sense.…