3 ms·
Easy, first prisoner randomizes the order of the boxes, opens and sorts the first 50 boxes, hoping to find his name. Chance 1 in 2 Next prisoner uses a binary
by fleitz 16y ago
Easy, first prisoner randomizes the order of the boxes, opens and sorts the first 50 boxes, hoping to find his name. Chance 1 in 2
Next prisoner uses a binary search to find his name in the first 50. Should have to open 6 boxes (log2(50)), if he finds it in the first 50 great. Either way he then sorts the next 44 boxes. Chance around 88%
3rd prisoner sorts the remaining 6 boxes, and finds his name in one of three piles using binary search. Chance, 100%
All remaining prisoners can use a binary search. log2(50) + log2(44) + log2(6)
I don't know how to integrate the 50% -> 88% chance, I'd estimate the answer to be around 44% based on my gut.
If the prisoners don't know the order they enter the room then they should each turn the first unturned box sideways to communicate the state of order. eg. if the first box is turned sideways you are prisoner #2.
I don't know if this is a brain teaser or just asking how to calculate the chances of 1/2 50 times in a row. (eg. the probability of correctly predicting 50 coin flips in a row)
- dedward 16y agoThe boxes are closed and each person enters the room in the exact state as the previous one, with no knowledge of what the other person found. I'm not seeing how a binary search will help you find your name in a randomized set of names - there is no order to work from to perform the search.