6 ms·
What an interesting thought experiment. Lying in bed last night, the best I could come up with (before seeing the optimal solution this morning) was an average
by ramblenode 10y ago
What an interesting thought experiment. Lying in bed last night, the best I could come up with (before seeing the optimal solution this morning) was an average of 83 with a minimum of 66.
The prisoners agree that every third prisoner, beginning with the first, uses "white" to convey that the subsequent two prisoners are wearing the same color and "black" to convey different colors. Since the second prisoner in each triple knows the color of the third, he can deduce his own color, leaving the third prisoner to also deduce his own color. And of course there's a 50/50 chance the sacrificial first prisoner in the triple still gets out. I suppose this could be improved upon by later prisoners having a longer memory, but I've already seen the optimal solution. ;)
Interested to hear others' attempts.