Hacker News new | ask | show | jobs
by Retric 2975 days ago
> What did you think was missing from the Wikipedia article?

Oddly enough as stated the problem fails. It essentially assumes an evenly distributed random placement of numbers. However if the warden simply adds the same random number to every single box it ends up as a very long cycle and they all fail.

Worse, they have to communicate which order to count from. Is box 1 the top left or bottom left box?

PS: The problem shows up in many such puzzles because 'the problem' was based on the math rather than the math being chosen to solve the problem.

3 comments

From the problem description on Wikipedia.

The director _randomly_ puts one prisoner's number in each closed drawer.

Random does not mean independently chosen random number.

Consider, if you pick a completely random location then two numbers could end up in the same box so one prisoner's number implies there is some order.

Further, random does not mean even distribution. The logic is really based on a very specific kind of random distribution.

Colloquially, "random" does imply a uniform distribution.
Depends on context, I randomly tossed it does not imply all locations it might end up are equally likely. As it rolls after impact it's more likely to end up in a dip than on top of a hill etc. At best the direction is random but not necessarily the angle with respect to the ground.

Basically, even distributions are very rare in the real world.

Even if the warden's assignment of numbers to boxes is not random (perhaps he knows the suggested winning strategy and wants to foil it), the players can make it random by randomly permuting the numbers on the outside of the boxes. This guarantees their 31% success rate even against an adversarial warden.
Players can't communicate. So, this comes down to what that means, but your suggestion is reasonable and might depending on how the problem was carried out apply.

aka, they can't all individually come up with the same random numbers without communicating. But, they could all independently come up with the same strategy if the all saw the same numbers on the outside of the boxes.

If you shuffle a deck of cards, do you ever get a 2/5 of heart/diamonds?
One operation to shuffle a deck of cards is to cut it creating a random offset.

So, I have seen someone just move the top few cards when asked to shuffle the deck. This makes a small offset more likely than you might assume. Remember the odds should be evenly spread across 52! which means in all of human history each deck should be unique, but in practice people have played with a default deck. (http://www.philly.com/philly/news/new_jersey/20120904_A_C__s...)

Funny thing: if that added number isn't relatively prime to 100 - and 60% of random numbers would share a factor - then they've just made a lot of smaller cycles.

And it's easy to break if you can swap two. Say the warden adds one. If you swap 50 and 100, you have two cycles of 50.

Again assuming the uniform random distribution. Select from (1, 3, 6, 7, 9, 11) is just as random as selecting from 1-100.

I would argue that not specifying the boxes have a specific order is a much larger problem, but saying 'random' does not nessiarly mean what you might think. As to moving the cards, they are specifically excluded from communication.

Random distribution of numbers is part of the problem statement:

> The director randomly puts one prisoner's number in each closed drawer.