dreamz Veteran Posted August 30, 2004 Veteran Share Posted August 30, 2004 (edited) my interviewer for a consulting job asked me this riddle during the interview, and i solved it. it's fun! an evil demon captures 3 men, and he tells them there are 5 hats, 2 white and 3 black. he puts one hat on each man without telling them the color (so no one knows), and he places them on steps. they can only look forward, so the last guy can see the two men in front of him, the second guy can only see the first guy in front of him, and the first guy can see no one. each man must tell the demon the color of his hat. if he is correct, he may leave. if he is incorrect, he gets executed. after 30 seconds, the first guy walks off with his life. what color is his hat? extra bonus points: solve it in under 30 seconds. :) i'll post the answer later, after i get some responses, hehe. edit: answer posted, so don't read it if you want to solve it first. Edited August 30, 2004 by dreamz Link to comment Share on other sites More sharing options...
spiegel Posted August 30, 2004 Share Posted August 30, 2004 this is gameguy's problem just put them in a patter of w b w b w and they live and if its not the answer i dont care Link to comment Share on other sites More sharing options...
dreamz Veteran Posted August 30, 2004 Author Veteran Share Posted August 30, 2004 it's actually not gameguy's problem, and it doesn't involve an algorithm of any sort. you can't sort them, and no one can move. they can only look straight ahead. it's just a game theory question that involves common knowledge analysis. Link to comment Share on other sites More sharing options...
bush Posted August 30, 2004 Share Posted August 30, 2004 15th minute and counting. i can't solve it :bag: Link to comment Share on other sites More sharing options...
lostspyder Posted August 30, 2004 Share Posted August 30, 2004 red Link to comment Share on other sites More sharing options...
pimpshiznid Posted August 30, 2004 Share Posted August 30, 2004 his hat is white. And that is a guess. Link to comment Share on other sites More sharing options...
gwai lo Posted August 30, 2004 Share Posted August 30, 2004 black? Link to comment Share on other sites More sharing options...
rezza Veteran Posted August 30, 2004 Veteran Share Posted August 30, 2004 The guy in front has a black hat. If the last guy saw two white hats in front of him, he'd know his was black, so he'd say "black" and walk off. Since he doesn't, that means that there's less than two white hats on the front two guys. If the middle guy saw a white hat on the front guy's head, he'd know his was black, because there are less than two white hats on the front two guys' heads. Since the middle guy doesn't say "black" and walk off, that means the guy in front must be wearing a black hat. Got it in about 15 seconds ;) Link to comment Share on other sites More sharing options...
John Veteran Posted August 30, 2004 Veteran Share Posted August 30, 2004 The third guy (who can see the other two) gets his right almost immediately because he sees two white hats on the other two guys; he says black. The second guy, now knowing this, says his must be black, because the previous guy couldn't be sure his was white unless both #1 and #2 have white hats (#2 sees a black hat on #1 in front of him). #1 hears all of this going on behind him and says he must have a black hat on otherwise #2 would have never made it out alive. That's assuming #1 and #2 have white hats on. If they don't have white hats, then #3 wouldn't know what to do, and as a result, #2 wouldn't know what to do, so #1 would know his was a black hat. Link to comment Share on other sites More sharing options...
lostspyder Posted August 30, 2004 Share Posted August 30, 2004 The guy in front has a black hat.If the last guy saw two white hats in front of him, he'd know his was black, so he'd say "black" and walk off. Since he doesn't, that means that there's less than two white hats on the front two guys. If the middle guy saw a white hat on the front guy's head, he'd know his was black, because there are less than two white hats on the front two guys' heads. Since the middle guy doesn't say "black" and walk off, that means the guy in front must be wearing a black hat. Got it in about 15 seconds ;) yeah that works if the FIRST guy wasnt in front........ Link to comment Share on other sites More sharing options...
dreamz Veteran Posted August 30, 2004 Author Veteran Share Posted August 30, 2004 The guy in front has a black hat.If the last guy saw two white hats in front of him, he'd know his was black, so he'd say "black" and walk off. Since he doesn't, that means that there's less than two white hats on the front two guys. If the middle guy saw a white hat on the front guy's head, he'd know his was black, because there are less than two white hats on the front two guys' heads. Since the middle guy doesn't say "black" and walk off, that means the guy in front must be wearing a black hat. Got it in about 15 seconds ;) highlight to see answer. sort of. there are only 3 people, so the middle guy can only see the guy in front. we can reason like this: suppose the first guy thinks he's white. if the second guy is also white, then the 3rd guy would've known he was black, and he would've left already, but he doesn't. if the second guy is white, and he sees the first guy is white, he knows that the last guy would see both hats and know he's black, and he would've left. thus, the second guy knows he cannot be white. therefore, he is black. since the second guy knows he's black, he can say 'black" and leave. now, the first guy knows that neither guy behind him have left yet, he knows that they don't know their own colors. thus, his hat must be confusing them, hence, it is black. Link to comment Share on other sites More sharing options...
John Veteran Posted August 30, 2004 Veteran Share Posted August 30, 2004 I'm right :D With not-so-much detail :p BTW dreamz, I fixed your post (Y) Link to comment Share on other sites More sharing options...
lostspyder Posted August 30, 2004 Share Posted August 30, 2004 what if the third guy was a mute? Link to comment Share on other sites More sharing options...
John Veteran Posted August 30, 2004 Veteran Share Posted August 30, 2004 what if the third guy was a mute? What if the first guy was mute? :o How did he walk off alive? :alien: Link to comment Share on other sites More sharing options...
dreamz Veteran Posted August 30, 2004 Author Veteran Share Posted August 30, 2004 thanks gameguy. i couldn't get it working right. :laugh: and i got your answer. ;) congrats to those who got it. if you enjoyed that, you should consider taking game theory at your university. :) Link to comment Share on other sites More sharing options...
rezza Veteran Posted August 30, 2004 Veteran Share Posted August 30, 2004 highlight to see answer. That was exactly the same as my solution, just worded differently... Link to comment Share on other sites More sharing options...
dreamz Veteran Posted August 30, 2004 Author Veteran Share Posted August 30, 2004 That was exactly the same as my solution, just worded differently... yeah, read it wrong. good job. (Y) Link to comment Share on other sites More sharing options...
+John Teacake MVC Posted August 30, 2004 MVC Share Posted August 30, 2004 I was just going to say he wasnt wearing a hat. Link to comment Share on other sites More sharing options...
Recommended Posts