"jr" <cre### [at] gmailcom> wrote:
> ideally that code/macro would take two args - the number of prisoners/boxes, and
> the number of chains (and perhaps dictate their lengths too?). (have a feeling
> this code can find other uses :-))
If I understand correctly, a chain that's too long can be split into two chains
by altering only two slips. I'm guessing that it would be just as easy to
combine two chains into one. So what you're suggesting is very possible.
I was so intrigued by the riddle that I thought it would be fun to conduct a
successful simulated exercise with one million prisoners. It looks like that
will take about three weeks using POV-Ray so I probably won't do that after all.
But I think the array of randomly numbered slips could be analyzed quickly to
determine the longest chain and therefore if the actual exercise would succeed.
If anyone is interested, here's a version with a much quicker slip randomization
algorithm. That part was a lot of fun too because it depends on balancing two
slow operations (moving large numbers of array elements around versus randomly
picking array elements that haven't already been picked) and the balance point
turned out to be much different than I thought it would be.
Post a reply to this message
Download 'riddle3.pov.dat' (6 KB)