- 821

- 419

I suggest reading again the question carefully. I also cannot understand thisHmm.. I assumed the procedure was:

(a) line-up

(b) look at the hats

(c) step up or not step up

That is the way to have any prisoners walking up or not by 10:00.

Say that prisoners 1, 2, 3, 4, 5 have the black hat, and prisoners 6, 7, 8, 9, 10, 11, 12 have a white hat. Then prisoners 1..5 all see N=4 black hats, and prisoners 6..12 all see N=5 black hats. Therefore, 1..5 all will step up at 10:05, and 6..12 will step up at 10:00. Problem will always be solved by 10:00 or 10:05. No need to wait for 10:00+5*N.