The 100 prisoner riddle - counterintuitive puzzle

That’s not how the video described it. Do you have a cite for that?

In terms of loops it HAS to be a loop when using this strategy.

  1. Once you pick a starting point, your path is completely deterministic. Each box leads to one and only one box.
  2. You can’t run out of numbers. There are no empty boxes.
  3. You can’t re-enter the path at a different place than you started, that requires 2 boxes to have the same number inside.

If we accept that the 100 boxes are grouped into a discrete number of separate loops, the only way to guarantee that your number is in the loop you select is to start with your numbered box.

It’s really elegant.

Which is easy to accept, as it’s impossible for them to be grouped so that this isn’t true.

Another way to say the same thing: The only number that’s certain to be in the loop you choose is the one on the box you first open.

Knowing, of course, that the number of separate loops could be anywhere from 1 to 100, inclusive.

ETA: I guess there couldn’t be 99 separate loops.

Nevermind

I think there could be. One example: Boxes 1 through 98 contain their own number. Box 99 contains 100; box 100 contains 99.

Hmmm, so does that mean that if you, and the rest of the prisoners, decide to open the box that corresponds to your number +5, then you could be on a loop that doesn’t include your number?

I think it does. It’s still a valid strategy if you know the warden set up the boxes to contain a greater than 51 sized loop, as that guarantees failure, but it would be less successful than the vanilla setup.

I am not sure it makes any difference what the warden did, since the prisoners, assuming they are allowed to pick a strategy in advance, can apply their own random permutation, essentially randomly renumbering the boxes.

The point is that if we know that the warden has manipulated the numbers so that there is a loop of 60, we know that we all fail (and are executed.) The strategy that gave us hope is now doomed.

So, we decide to change up our strategy and add 5 to the number of each box. I think it makes a difference that everyone follows the same strategy. If everyone picks their own random permutation, then it’s not much different from everyone just picking 50 boxes at random.

In the simplest case, I have a 7. I add 5 to it, and get 12. I go to box 12, and it has in it the number 12. I am on a loop that does not contain my number, and will have to change strategies.

Absolutely. I gave an example of such above. If you have 4 boxes instead:

1 - 3 - 2 - 4

If prisoner 1 starts with any other box than their own, they are in a loop that doesn’t contain their own.

The worst case would be if all boxes contained their own number:

1 - 2 - 3 - 4

In this case, if every prisoner picked their number +1 (or + anything other than 0), no loop will contain its own number.

The malicious warden setup is to reduce failure for artificially long loops, with the understanding that the strategy of adding +5 (or +whatever) is suboptimal otherwise - but in a situation where the ‘best’ you can do is still terrible.

I don’t mean everyone picks their own random permutation, rather that everyone agrees on a single random permutation. This is equivalent to randomly re-labelling all the boxes at the outset.

This will probably not be “adding 5”, more like: the box originally labelled “1” is now 37, box 2 becomes 58, box 3 becomes 65, box 4 becomes 5, box 5 becomes 15, etc.

I guess I misunderstood, sorry.

I don’t see how this gets any different result from “add 5” and seems far more complicated.

Now of course, in all these problems, the prisoners are all geniuses with perfect logic capabilities*, so complicated isn’t a non-starter, but I don’t see any reason to make it more complicated than it needs to be.

*there was a “logic” puzzle I saw, I think on Stand up maths, a few years ago, where there was a key hidden under a coin on a chessboard. All the spaces had coins, randomly flipped. One prisoner enters, sees where the key is, and then can flip one coin. The next prisoner now needs to work out where the key is based on that flip. When they did the puzzle, both the first and second “prisoner” spent a fair amount of time with pen and paper doing math to work it out.

In that case you’re not looking for the box with your number on it. You’re looking for the box with (your number - 5) on it.

And once again I have no way to conceptualize what the result of that would be.

Here is the History section of the Wiki article about the puzzle. Do you have reason to dispute it?

Link: 100 prisoners problem - Wikipedia

The advantage of opening your own number’s box and following the loop from there is that everyone is guaranteed to be on a path that leads to their goal, even if some of the paths might be too long.

This is not true of the +5 strategy. So my question is whether the +5 strategy offers any real advantage or is it just an elaborate equivalent of random guessing?

The video claims that it is true of the +5 strategy.

Sure it is If you’re number 23, you’re not picking 28 then picking whatever is in 28, you’re picking 28 then whatever is in 28 + 5; then whatever is in that + 5 etc. Logically, you have to have a loop there. Somewhere. And, it doesn’t have to be the same loop or even the same count. I played around, trust me, it works.

If the warden wants to be a real bastard, he would manipulate the numbers in two ways.

First, he would arrange the papers so there is a loop of at least fifty-one boxes. This would would foil the standard strategy.

Then he would place one of the remaining papers inside the box that has the same number. This guarantees that the +5 strategy or any other strategy that depends on displaced numbers will fail.

Nope, you’re wrong.

Let’s say you’re number 29 and he puts “29” in box “29”. you’re going to grab 34, which leads to something which leads to… which leads to 24, which leads to 29. Still works.