Fog Creek Software
g
Discussion Board




assassin problem

Why not just say the color of the hat for the person in front of you. The first person does not know the color of their hat and has a 50% chance of dieing, but every other person gets to know the color of their own hat and gets to live. KISS!

Owen Borseth
Thursday, July 1, 2004

I don’t think that this works good. For example, if 100 is wearing a red hat, 99 a blue one and 98 a red one again. 100 will say ‘Blue’ and 99 repeats the same to save his life but he is supposed to say ‘Red” as 98 is wearing a red hat. So this also results in 50% success only.

Deepa
Friday, July 2, 2004

You're right. It doesn't work.

Owen Borseth
Wednesday, July 7, 2004

number 100 will say red if the number of red is even, blue is the number of redd is odd. number 99 counts the red infront of him if it is the same evenness or oddness as the one before him then he knows he's blue other wise he know he's red, each of the next persons listens and calculates accordingly

b
Thursday, July 8, 2004

Hope that is the solution given in the problem.

Deepa
Friday, July 9, 2004

*  Recent Topics

*  Fog Creek Home