7 ms·
Wikipedia provides exactly the same explanation that your link does: > The prison director's assignment of prisoner numbers to drawers can mathematically be de
by thaumasiotes 9y ago
Wikipedia provides exactly the same explanation that your link does:
> The prison director's assignment of prisoner numbers to drawers can mathematically be described as a permutation of the numbers 1 to 100.
> Every permutation can be decomposed into disjoint cycles, that is, cycles which have no common elements.
> In the initial problem, the 100 prisoners are successful if the longest cycle of the permutation has a length of at most 50. Their survival probability is therefore equal to the probability that a random permutation of the numbers 1 to 100 contains no cycle of length greater than 50.
What did you think was missing from the Wikipedia article?
- portlander12345 9y agoThe prisoner starting with their own number box ensures that they are in the chain with their number ticket in it.
- thaumasiotes 9y ago> The cycle notation is not unique since a cycle of length l can be written in l different ways depending on the starting number of the cycle. During the opening the drawers in the above strategy, each prisoner follows a single cycle which always ends with his own number.
- MrBuddyCasino 9y agoAnd thats the part I still don't understand.
- thaumasiotes 9y agoSo, following your cycle looks like this: Open box 7, find number 2 Open box 2, find number 2700 Open box 2700, find number -16 Open box -16, find number 0.9 Open box 0.9, find number ℵ Open box ℵ, find number 赢 Open box 赢, find number two ... As you can see, it's not necessary to use numeric digits to identify the boxes; any identifier at all will do. But this is a cycle; if we had started by opening box 0.9, it would look like this: Open box 0.9, find number ℵ Open box ℵ, find number 赢 Open box 赢, find number two ... Open box 7, find number 2 Open box 2, find number 2700 Open box 2700, find number -16 Open box -16, find number 0.9 Exercise: given that this cycle starts with "open box 7", how does it end? (Or in other words, what is the second half of the line before "Open box 7"?) If this cycle instead started with "Open box ᚠ", how would it end in that case?
- alkonaut 9y agoThink of it this way: you are always in a chain. It can be between 1 and 100 boxes long. But it can’t be a dead end or not include the 1-note. Worse case it visits all boxes and gets back to 1. Try forming a scenario that doesn’t. E.g a “loop”: Prisoner #1 opens box 1. Finds the number 2. Opens box 2 finds the number 3. Opens box 3... Could he now find the “2” that would lead to him being stuck in the 2-3 loop? No. He already found the 2. It can’t appear again. In the third box he’ll find a number he hasn’t seen. The loop cannot form in any other way than to come to where he started - which it will do when he finds the note with “1” on it. So by starting with box 1, he is on a loop of length 1..100 including the pointer TO box 1 (which is what he is looking for).
- MrBuddyCasino 9y agoOk, so I‘m walking a linked list that will lead to my number. But I still don’t get why the odds are better than just opening the first 50 boxes and hope for the best? What changes because I‘m on the chain?
- treis 9y agoThe success criteria goes from the prisoners randomly picking correctly to the warden not randomly creating a loop larger than 50. If the warden creates no loop greater than 50 then the prisoners win. If he creates one of 51 or more then the prisoners lose because the 51st number wont be found.
- MrBuddyCasino 9y agoThat was the shortest description that worked for me. Framed this way, its obvious - thanks, also to all the others!
- Domenic_S 9y agoAssuming that linked list is shorter than 50, you're guaranteed to find your own number.
- tukasqu 9y ago
- nebulous1 9y agoIf you consider that each box only has one box that "points" to it, and that last box must necessarily be part of the box's cycle (by definition, there's no way to avoid it as if you hypothetically swapped the last box to point somewhere else then all you're doing is linking the cycles and you'll end up in the same place but later)
- jlarocco 9y agoFor me it helped to think of it as a collection of linked lists. At most, there can be 100 lists of length 1, where each number points to itself. On the other extreme, there are many ways to create a list of length 100. The strategy takes advantage of the fact that randomly permuting the numbers is less likely to create one or two long lists, and more likely to create a bunch of shorter lists. Since each prisoner knows which list he belongs to, he can use that information to reduce his search space from all of the boxes to just the boxes in his list.
- itp 9y agoThis point was obvious once pointed out, and is definitely the reason this link clicked for me and the Wikipedia explanation did nothing.
- thaumasiotes 9y agoAs I pointed out in a sibling comment, this is also stated in the Wikipedia article.
- deleted 9y ago[deleted]
- mhb 9y agoBetter graphics
- Retric 9y 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.
- thaumasiotes 9y agoRandom distribution of numbers is part of the problem statement: > The director randomly puts one prisoner's number in each closed drawer.
- danbruc 9y agoFrom the problem description on Wikipedia. The director _randomly_ puts one prisoner's number in each closed drawer.
- Retric 9y agoRandom 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.
- pronoiac 9y agoIf you shuffle a deck of cards, do you ever get a 2/5 of heart/diamonds?
- Retric 9y agoOne 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_Golden_Nugget_in_legal_war_with__1_5_million_winners.html http://www.philly.com/philly/news/new_jersey/20120904_A_C__s...)