logo Sign In

Post #90465

Author
DanielB
Parent topic
The DanielB Prisoners and Lightbulbs Thread
Link to post in topic
https://originaltrilogy.com/post/id/90465/action/topic#90465
Date created
27-Jan-2005, 4:15 PM
It means I can caculate the average running time. At the moment the it's about 3600.

That's using these settings:

Phase1: 30, 20, 18, 16, 15.
Phase2: 750, 450, 400, 250.
Phase3: 450. (450,450,450,450).

It could be possible to do better by tweaking Phase3 further, something like:

Phase3: 550, 350, 350, 450.

Phase1:

Get counter.
Get as many people as possible on zero, by creating other members with counts.

Phase 2:

Group the tokens together in powers of 2. Starting at 2 and ending at 16.

Phase 3:

Count all remaining tokens.

For Phase 3 to work you need to allocate time to count all the 16 grouped tokens to the counter, then all the (remaining) 8 ones, 4 ones, 2 ones and then all the single tokens (there shouldn't be any, but it can happen that there is).