## 11118 - Prisoners, Boxes and Pieces of Paper

**Moderator:** Board moderators

### 11118 - Prisoners, Boxes and Pieces of Paper

Can someone tell me if the following I/O are correct?

removed....

they were nonsense.

Thanks

removed....

they were nonsense.

Thanks

Last edited by sclo on Mon Oct 16, 2006 9:02 am, edited 1 time in total.

- little joey
- Guru
**Posts:**1080**Joined:**Thu Dec 19, 2002 7:37 pm

For those who are not getting the trick, the problem statement contains the following important sequence: "The prisoner opens n/2 boxes of his choice,

**one by one**." (emphasis mine)

Abednego, thanks for showing us this problem!

For those still struggling with the problem: work out the case for n=4 by hand. Let the second box the first prisoner opens be dependant on what was in the first box he opened, and try to find a way for the other prisoners to use this information.

- Abednego
- A great helper
**Posts:**281**Joined:**Tue Sep 10, 2002 5:14 am**Location:**Mountain View, CA, USA-
**Contact:**

There is a formula that starts out being very complicated, but then it simplifies to something trivial. My code is 3 lines long.

Originally, the problem comes from a talk in a math conference. The title of the talk was "Seven problems you think you've misheard." It also came with a proof of optimality.

Originally, the problem comes from a talk in a math conference. The title of the talk was "Seven problems you think you've misheard." It also came with a proof of optimality.

If only I had as much free time as I did in college...

- Abednego
- A great helper
**Posts:**281**Joined:**Tue Sep 10, 2002 5:14 am**Location:**Mountain View, CA, USA-
**Contact:**

The amazing Google reveals this page:

http://www.sciencenews.org/articles/200 ... thtrek.asp

It has references at the bottom.

http://www.sciencenews.org/articles/200 ... thtrek.asp

It has references at the bottom.

If only I had as much free time as I did in college...