Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Here's another version of #9: http://www.xkcd.com/blue_eyes.html


I don't get either one. The announcement just seems redundant. Everybody already knows that there is at least 1 so-and-so. In fact, everybody already knows that there is more than one. I can't see how the announcement adds knowledge.


SPOILER

It took me a long time to articulate what new information was being given; much longer than answering the question itself. The trick is to imagine a smaller scale. Lets say there were three each of brown- and blue-eyed people. And let's call the blue-eyed people 1, 2, and 3. Everyone knows that everyone sees at least one blue-eyed person, so no new information, right?

Look at this fact: before the announcement, 1 doesn't know if 2 knows if 3 sees a blue-eyed person. (2 knows if 3 sees a blue-eyed person, because 2 knows that 1 has blue eyes, but 1 doesn't know any of that.)

Then, after the announcement, the first night passes and 3 doesn't go home -- so now 1 knows that 2 knows that 3 sees a blue-eyed person. That's the new knowledge.

To finish the riddle, now 1 can reason like this: if my eyes are brown, then 2 knows her eyes are blue, because 2 knows 3 sees a blue-eyed person. (That's the new knowledge.) So if 2 goes home, my eyes are brown. And if my eyes are blue, then 2 will know that 3 sees a blue-eyed person that isn't me, and 2 won't go home. Either way, 1 goes home the 3rd night. And 2 and 3 are actually in the same position, and they go home too.

(It seems like the brown-eyed people go home the next night, but I forget and am too lazy to think about it rigorously again.)

If you want to analyze this for n=4, start with this fact: 1 doesn't know if 2 knows if 3 knows if 4 sees a blue-eyed person. Don't try this if you're sleepy.


Another way to think about it: forget about how many people there are in total, I can observe x blue eyes. Let m be the minimum globally known number of people with blue eyes. After the announcement m = 1.

On that day (and any subsequent) if your x < m you know you have blue eyes. If at the end of the day noone leaves, m must be at least m + 1.


Spoiler: Knowing Mathematical induction (http://en.wikipedia.org/wiki/Mathematical_induction) really helps.

It was not that hard at all.


To correct myself: It was a little bit harder than it seemed at first. I forgot to prove that my solution was optimal.


Or if N = number of people with blue eyes.

(N=1 blue) 1B goes home 1st night. (N=2 blue) 2B go home 2nd night. (N=2 blue) 3B go home 3rd night.

To see why this works at N=4 B1, sees 3 blues so if his eyes are not blue everyone goes home on the 3rd night. But they don't go home on 3rd night so he and all the other blues go home on the 4th night.

etc So at N=100 all blue go home on the 100th night and everyone else stays.

Note: brown and green don't get to go home because having 2, 1, or 0 green eyes presents blue with the same information. AKA Blue and brown eyed people know their eyes are not blue but they could be brown or green. So having 10 or 10,000 people with brown eyes does not change what happens.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: