News for hackers. Stuff that matters.
Re:Puzzle HN: 100 prisoners, 100 boxes... by Someone on Wednesday November 10, 2010 @01:17PM (#1891285)
I think you messed up the formulation of the problem. As stated, a strategy would be - first prisoner opens 50 boxes. - second prisoner opens the other 50. - each prisoner finds the box with the paper with his   name on it.

Success rate: 100%. There probably are other constraints but I can only guess at them (do they visit the room one by one, and must they decide on a box to choose before leaving? Who can talk to whom? Must they close all boxes before leaving the room?)

Re:Puzzle HN: 100 prisoners, 100 boxes... by RiderOfGiraffes on Wednesday November 10, 2010 @02:17PM (#1891474)
I believe the statement as made is correct, although not necessarily as clear as it could be.

For example, your suggested "strategy" is wrong - the first prisoner as you've stated only has a 50% chance.

Further, after each prisoner the boxes are closed so that each prisoner finds the room is exactly the same state, with no communication between them.

Re:Puzzle HN: 100 prisoners, 100 boxes... by Someone on Wednesday November 10, 2010 @05:41PM (#1892054)
Apparently, my formulation isn't as clear as it could be, either :-)

My 'solution' has all of the prisoners point out 'their' box after the second one has opened the last 50 boxes.

As to the 'no communication between': if there is no communication, it seems each of them cannot do better than 51/100 (50 opened boxes, and if their name isn't there, a 2% gamble)

However that isn't true. Suppose the first 51 each open the first 50 boxes and decide to choose the 51st box if they do not find their name, Then, all others, working under the assumption that the first 51 found their name (if they didn't, the game is lost anyways), can just open the last 49 and be certain to find their name.

That would bring the probability to about 2^-50. I doubt that is the optimal strategy, though. There seems to be much more room between 1/100! and 0.01^100.

Re:Puzzle HN: 100 prisoners, 100 boxes... by RiderOfGiraffes on Wednesday November 10, 2010 @05:53PM (#1892095)
I still, really don't understand what you're suggesting. Let's go carefully.

The first person opens 50 boxes. Let's suppose they find their own name (otherwise we're dead anyway). They leave the room, everything is put back exactly as it was, they're not allowed to communicate with the others.

It seems to me you're suggesting the next person opens the second batch of 50. OK. But then they leave the room, everything is put back exactly as it was, and they're not allowed to communicate with the others.

What does the third person do? They're confronted by 100 closed boxes with no idea of anything, except that the first person's name is in the first 50 boxes, and the second person's name is in the second 50 boxes.

So, what now?

Re:Puzzle HN: 100 prisoners, 100 boxes... by Someone on Thursday November 11, 2010 @07:00AM (#1893606)
The word 'close' does not appear in the problem formulation at all. Apparently, we must deduce that all boxes get closed between visits from "they will not know anything about the previous prisoners' experiences ahead of time". I am OK with that, but I still do not think it is a clear way to describe the problem.

So, ignoring that IMO fairly implicit message, the 'answer' I proposed is: prisoner #1 opens 50 boxes, prisoner 2 opens the other 50, and then each prisoner trivially searches for his name.

Nitpicking the text further: what is that ahead of time doing there? What time? What can they learn afterwards?

Re:Puzzle HN: 100 prisoners, 100 boxes... by RiderOfGiraffes on Thursday November 11, 2010 @11:24AM (#1894231)
I can't decide if you're trolling, or genuinely don't understand. This is becoming like explaining a joke, and turning into and endless sequence of refinements.

I'll answer you once more. If you don't get it after that, I don't really care.

  > The word 'close' does not appear in the problem 
  > formulation at all
No, but "open" does. The implication is that the boxes each contain a piece of paper on which exactly one name is written, and that each box is closed.

  > the 'answer' I proposed is: prisoner #1 opens 50 boxes,
  > prisoner 2 opens the other 50, and then each prisoner
  > trivially searches for his name.
You are assuming that the boxes can be left open. That is ruled out when the puzzle says:

  > and they will not know anything about the previous
  > prisoners' experiences ahead of time.
If the boxes remain open then, specifically, the second prisoner will know the names that have been seen by the first prisoner. That's not allowed.

  > Nitpicking the text further: what is that ahead of
  > time doing there? What time?
The time that they enter the room.

  > What can they learn afterwards?
If, for example, their strategy is that everyone opens the first box (which is pretty pointless, but this is just an example) then easch one will learn something about what the others knew. In this way they know things that the prisoners before them knew.

There are puzzles where this is significant. I'm not going to tell you if this is one of them.

I feel that your objections to the wording are very like the programmer who insists on more and more refinements to a specification, and eventually just transliterates the spec into code. Anything that can't be trivially transliterated is queried, until finally the specification is isomorphic to the code.

My apologies if I'm doing you a disservice, but I find it very difficult to find a position from which your questions become reasonable, and I offer answers and explanations in an attempt to learn more. Currently I'm failing, and perhaps it's time to give up.

Re:Puzzle HN: 100 prisoners, 100 boxes... by Someone on Thursday November 11, 2010 @03:40PM (#1895152)
No, I am not trolling. My initial remark (very early in this thread) was just that the formulation wasn't clear to me. I thought that might trigger a rewording that would help later readers. After that, I just answered questions about why I found (past tense!) it not clear. I also think I made clear that I do understand the problem:

  *Apparently, we must deduce that all boxes get closed between visits from "they will not know anything about the previous prisoners' experiences ahead of time". I am OK with that,*
but I guess I should have been even clearer. It may seem nitpicking, but to solve this, I need two things:

    - an understanding of what the problem is.
    - a solution to the problem.
I find it natural that, getting stuck at step 2, to revisit step 1, looking for something I missed on reading it first (Quoting Polya: 'What is the unknown? What are the data? What is the condition?'). When I did that, I started to wonder what the description tried to say. Since the trivial answer that I gave in my initial reply, I did get that, but it didn't exactly jump out to me.

Thanks for the polite replies, but let's close this discussion. It is helping neither of us.

[Dmn: initially, I thought "of course the probability is way better than (1/2)^100'. There are only 100! permutations to choose between", but rereading the problem once more I begin to wonder whether 'in which he randomly distributes 100 pieces of paper'* actually implies that each box receives one piece of paper. Please don't reply, or I may feel obliged to apologize again.]

Re:Puzzle HN: 100 prisoners, 100 boxes... by dedward on Wednesday November 10, 2010 @06:20PM (#1892175)
How do they even know that? Does the game continue until the end - or does it end as soon as one person fails to find their name?
Re:Puzzle HN: 100 prisoners, 100 boxes... by RiderOfGiraffes on Wednesday November 10, 2010 @06:36PM (#1892207)
They don't know that, but you may as well assume they do, because otherwise anything they do is pointless and has no effect.
Re:Puzzle HN: 100 prisoners, 100 boxes... by dedward on Thursday November 11, 2010 @10:29AM (#1894072)
True - but you only know that at the end of the puzzle. The point of the exercise is to maximize their strategy of winning. There is no "winning" strategy - but there is one that is significantly better than what immediately comes to mind.
Re:Puzzle HN: 100 prisoners, 100 boxes... by RiderOfGiraffes on Thursday November 11, 2010 @11:11AM (#1894189)
But that's not the point. The point is that without loss of generality each person can assume that the people before have all found their own names. If not then it makes no difference what they do, they're all doomed.

Unless I've misunderstood you.

Re:Puzzle HN: 100 prisoners, 100 boxes... by jonafato on Wednesday November 10, 2010 @02:08PM (#1891454)
I think the problem statement means that each prisoner must find his name independently of one another. e.g. Prisoner 1 opens 50 boxes, finds his name, then the boxes are closed and Prisoner 2 must do the same without any help.
Re:Puzzle HN: 100 prisoners, 100 boxes... by photon_off on Wednesday November 10, 2010 @03:18PM (#1891661)
I see what you mean. Prisoner 1 could memorize all of the names and just tell the next one if he's in the front or back 50.

The catch is: once the prisoners decide on a strategy, they are not permitted to communicate anymore.