@Veritasium complete nonsense and not a solution. according to this strategy, we simply shift the "RANDOMNESS" of the choice to the boxes. after all, the numbers in the boxes are randomly distributed and therefore we open the next box randomly.... but we take responsibility for the choice. but we still get 50/50.
complete nonsense and not a solution. according to this strategy, we simply shift the "RANDOMNESS" of the choice to the boxes. after all, the numbers in the boxes are randomly distributed and therefore we open the next box randomly.... but we take responsibility for the choice. but we still get 50/50.
As somebody that's tried tracking down a CD left in the wrong CD case, I can attest that the loop strategy does indeed work 31% of the time. (The other 69% of the time it turns up weeks later on the kitchen table.)
do you mean.... like you open a Barbara Streisand box, and you find a Celine Dion CD, so you go to the Celine Dion box, and you find a Dolly Parton CD..... and so on?
As a former professional gambler, the key to understanding this in real-world terms is at 9:48. Every prisoner's individual chance of success is still 50%. The strategy works by making the prisoners' individual chances contingent on each other: linking them together. Imagine a related puzzle - the sadistic warden has been told that the median human heart rate is 75 beats per minute. He devises a game where he measures the 100 prisoners' heart rates. He has two large bins marked "UNDER 75 BPM" and "75 OR OVER", and he places each prisoner's ID tag in the bin corresponding to their measured heart rate. But there are two catches. Firstly, he has privately flipped a coin before the game to decide which will be the winning bin: the prisoners don't know which is which. And secondly, *all 100* prisoners have to win the game for them to be freed. So each prisoner's chance of winning is 50%. And with no collective strategy, the chance of everyone winning is 0.5 to the power 100. Tiny. But the collective strategy is simple: everyone does extremely vigorous exercise immediately before getting tested. Now *everyone's* heart rate is above the median. So although each person's individual chance of winning the game is still 50%, now the collective chance of winning is also 50% - because *everyone is now in the same bin.* Basically, that's how to grok the video's strategy for the boxes problem - in a sense it puts everyone "in the same bin" - and the bin is marked *"Are all the loops shorter than 51 ?".*
That's actually nonsense. When the prisoners follow the loop strategy, they don't "choose" between multiple options, they just follow the pattern. The only probability at play here is the probability of the room setup. Even when you want to calculate the individual chance that a prisoner finds his number or not, it's almost never 50%. We already know when we are in a winning room configuration (about 31% of the time) 100% of the prisoners will find their number. Those are two depended events. So the overall probability is still about 31%. Now have a look at one of the loosing room configurations. For simplicity just think of a room that has only two chains, one with 20 numbers, the other with 80. This configuration is part of the 69% chance of the beginning. Here again prisoners do not apply any "choosing" since they just follow the strategy. 20 prisoners will with 100% certainy find their number, as they are part of the 20 loop. 80 prisoners will 100% fail and will not find their number as they are on the loop of length 80 and in order to find their number they would need 80 steps which they don't have. So when you are in a loosing configuration, at least 50% or more will fail to get across their number. Note that not all prisoners do actually "use up" their 50 draws they have. In the 20/80 example those on the 20 loop will make exact 20 draws. So they would have 30 left over which they don't need. So it makes no sense to speak of individual chances as those are 100% pre-determined by the actual room layout and not based on any decision the prisoners make (besides the decision to use the looping strategy which gives them a 31% chance to survive). People made similar mistakes when it comes to the Monty Hall Problem that they assume Monty also has a chance or probabilty to choose. He has not. He knows what's behind the doors and always just follows a pre-determined plan. The contestant also has a fix strategy: switch or not switch. If you do not switch you have 33%, if you do switch you have 66%, end of story. The actions of Monty are based on the contenstants actions. So the only "choice" in the Monty Hall Problem is your first initial choice which fully determines the outcome based on the used strategy. Also it's completely pointless to argue "but when we change this or that about the problem THEN ....". Yes then it's no longer this problem / question. I've heard that countless of times on the MHP. "But when Monty does not know what door he opens ..." is a complete absured assumption. It's like introducing: "But what happens when a meteor strikes the studio and kills everyone".
I feel like the really cruel thing to do would be to allow the prisoners to look at 95-97 boxes, with the same thing. If they figure out the stragegy, it's like a >95% chance of success. If they guess randomly, it's
if they opened them randomly at 95 choices each, that would give them a 0.592% chance. similarly, you could do this with 4 boxes and 10 friends. let them open up 3 boxes each to try to find something in one of the boxes. If the goal is to win if every one finds what was in the box, then they would have about the same odds.
exactly! try to convince your inmates now! the indivudual 97% seem so much more intuitive than trying to grasp even only that you'll always be on your own loop.. :D for nerds who want to avoid using their calculator: (97/100)^100 = 4.75525% (rounded since there was a 0 after the last digit)
I like to think that the people constructing the test purposely made no loops of >50, so that the prisoners could go free if they are intelligent enough to be worth returning to society (if they figure out the loop method then they will be given 100% chance)
I like this warden. He has reasoned out that if he can turn all his prisoners into math wizards or at least willing to work together and trust one another, he can let them out.
You know what’s funny? I’m interested in this and feel smarter after watching this even though I know that I will never be in a prison that requires math to escape
Why do I have a major problem with the phrase: “When you start with a box labeled with your number, you are GUARANTEED to be on the loop that includes your slip?” If the boxes were labeled randomly, aren’t there ZERO guarantees?
The reason I love Destin so much is because of his mindset at 2:27 - Instead of being boggled and/or arguing, hes completely open to just learning the facts of what was just told to him with his simple 'Teach me' - many people could learn from Destins attitude in today's day and age; probably one of the main reasons hes in my top 3 of favorite youtube channels!
I understand they're friends and Veritasium is trying to throw Destin some viewers but I wonder if they ever flip the script. Where Destin is trying to solve one of his own puzzles and calls Veritasium so that he's the one saying "Ya I don't know the answer."
_"that someone would decide this is stupid and just pick boxes at random"_ That's frequently a problem in real life. Not so much in the fabricated setup of the video. Persons with a strong determination are usually the ones which make the decisions, and not always they are very smart. Like this example from recent (and many others from less recent) history: Smart mind says: "Don't go to war against xxx, IT WILL NOT WORK." Strong will says: "Of course it will, you're a coward and a traitor." 20 years later, it did not work. Strong will says: "Nobody could have known that, therefore it was the right decision at that time."
and what if you work with time, lets say some people are slower then others, they also say nothing about time!, lets say every number is a = minut, and the second person to move in only can go in if the other out. what if they make a plan, that the amount of minuts somebody is gone is equel to the box that contains there specifik number. and if they dont find it they need to wait exactly 102minuts. ( because its more then 100 boxes = 1 box a minute) by that way the poeple that are waiting only have to count everytime and remember only 50 numbers ( and they have really long time for that) if they know 50 numbers thats not there number or a little bit less) the chances of cracking this code will also improve by multi trillions? correct me if am wrong
The rules aren't clear enough. What if the ones who can't find their number don't leave the room. Like just the first. Time is the undefined equation here.
@Entropie - hmmm that is fantastic outside the box (😉) thinking! It’s a good idea if your life was on the line. I too would not only be trying to solve the riddle but also looking for ways to “cheat the house”. However, for this “ideal” riddle, we assume that the wardens have some way of negating that in order to practice the theory involved. But yes you are the kind of person I want on my team if I were ever in a situation like this- that was a great suggestion. 👍
@Karperteam The rules do generally say that communication is forbidden, not just verbal communication. Essentially this means any transfer of information between prisoners is forbidden no matter what medium is used to transfer the information, this includes subtle means like using time as well.
This helped me intuitively believe that this is plausible without doing a ton of math. If all the prisoners decided to pick the same 50 boxes, there would be a 0% chance of success. This simple example proves that you can change the probability of success with a strategy. It just so happens that the optimal strategy is incredibly elegant and yet challenging to work out.
The easiest way for me to understand this strategy is that when choosing boxes randomly, the prisoners as a group need to be lucky 100 times to win their freedom (each person basically come in with only 50/50 chances) While with the loop strategy, the prisoners as a group only need to be lucky ONCE. That is because if the boxes arrangement doesn't produce a loop longer than 50, then they're all GUARANTEED to win. Therefore they only need to be lucky when the boxes were shuffled, and the probability of the arrangement they need come out of the shuffle is about 31%.
@Mitch Mabee It's because only having 2 prioners is a completely different scenario than having 100. Doing the strategy will remove the 2 possible ways the 2 prioners can chose their 1 box that we know will always fail, i.e. both opening 1 or both opening 2. Out of the two remaining, alternatives, there is a 50% chance since either both pick the correct box (1->1, 2->2) or both pick the wrong one (1->2, 2->1).
Where are you getting this 50/50 business. Remember the chances randomly had 31 zeros to the right of the decimal. That's stretching the definition of the word lucky a bit far.
The interesting thing is that if you drop the number of prisoners to 2, the probability goes to 50% if you use this strategy, as opposed to 25% by choosing randomly. If both prisoners agree to pick either their own or the other's box, then both ensure that they don't accidentally pick the same box, meaning that if the correct number is in the box they chose, they both find it, while if the wrong number is in the box, neither of them finds it.
Tell them it is the chance that we all win .If you use 4 instead of 100. The probability of having 1 or 2 loops so that you win is (11223344, 11223443, 11243342, 14223341, 11233244, 13223144, 12213344, 12213443, 13243142, 14233241) out of 4!. That's 10/24 and much higher than 0.5^4
I could see a variation of this coming up in a sequel to Squid Game. People formed into four groups of 110 players each, each group having the choice of four different box rooms to choose from, and a single player option to stop after opening 49 boxes to report back to your group, but die for choosing that option. First few players know their job is like a soldier, to find out if a room likely has a loop of 50 or over, and if they make it to 49 they have to come back, report such, then die, along with anybody who had already made it through that room, but then the remaining members of that group knowing that they should then try try going through another door and room, say door number 2 to work through the boxes in that room instead, hoping it will be a room without any 50 or more loops. One group, minus a couple of early players who made through and also minus the third one who made it to 49 and choose to report and die, the rest of that entire group then makes it through door number 2 and box room number 2 using the loop strategy. Of course that's our group with most of our favorite Squid Game players. The 2nd group, mainly of just bullies and idiots, all just die by one by one trying to go through one door and randomly choosing boxes. The third group, well there was somebody smart enough to come up with the loop strategy only they had some feisty types in their group that just didn't believe in all that liberal scientific mathematical mumbo jumbo, so it wasn't until after they had fed 25 players into a room before a loop strategy believer finally sacrificed themselves to report back to change rooms. The fourth group, properly choosing to use the loop strategy plus the the sacrifice to report to change rooms strategy, still loses a few more than they should have, because somebody or maybe a couple of players early on got to their 49th box, but didn't want to report back to the group then die, so took their chances and opened a 50th box, died for it, but then leaving the larger group uninformed to change rooms until they had lost a few more players before somebody actually sacrificed themselves to report back that they had made it to 49 boxes and advising the rest to try another room. Anybody making it through an abandoned door and room are, or were, of course all doomed, because it's only when however many people in a group ALL make it though one of the four rooms to choose from, without anybody of them having to open 50 or more boxes in order to find their number. Yep, sounds like a Squid Game episode to me.
Super interesting and logical. What I love is that it shows us to work together rather than individually and that is where we have to link our sciences to philosophy and remember that sciences are merely observations put on paper.
Exactly, this is the problem with modern science. For example, instead of having 10 single biological or medical studies with 10 people each, why not have all 100 people participate in 10 studies simultaneously? The main benefit is not that this would greatly improve sample size, but rather that it would better account for uncontrollable variables in biology, which should be done differently than in physics or chemistry, but unfortunately misguided scientists use the same methods of variable control for biology and psychology as for physics and chemistry.
This seems very much like when you shuffle a deck up for a round of solitaire. There is a certain percentage of hands in which it is impossible to finish, due to the cards that end up in the piles.
4:44 That visual is what really helped me understand this. I'd heard of this riddle before, but I never knew WHY there was such a significant chance of not having any loops longer than 50. It's because a box can only be in one loop. If there's a loop of 5 boxes, the maximum size that any other loop can be is 95, since 5 have been excluded from the pool. (Loop, pooL, coincidence?) If there's another loop of 30 boxes, the new maximum is 65, and all it would take is a loop of 15 or a few smaller loops that add up to that, and boom! Guaranteed success!
Congratulations for making this video. I can't stop thinking about it. I read the paper by Anna and Peter, but they didn't make it any easier to comprehend the probability distribution, and how the closed systems increase the odds substantially. I'll have to dive deeper into this... Thank you (seriously) for having cause a "glitch" in my brain! 👊🏻😃👍🏻
I think one way to grasp why this works is to imagine there are several short loops in the set up. If prisoners pick an initial number randomly, but then follow the same strategy, many of them will waste their choices by following a loop which doesn't contain their number. Conversely, by starting with their own number (even though, as explained, it can be an arbitrarily assigned number), they are guaranteeing that they are following a loop which contains their number. Thereby avoiding short loops which don't. Really great puzzle!
There is an easier way to think about it. If you use the loop strategy, you make sure all 100 fit in the same family of loops, taking out of the equation the randomness of each prisoner selection and limiting the possible combinations between each prisoner selection of boxes.
I am terrible at math but this made intuitive sense to me as someone who has had to track down mixups in conference badges/materials where putting the wrong persons stuff into someone else’s envelope sets off a chain of mistakes and this is how we would trace it back
Interesting corollary: If prisoner #1 (or any other prisoner) finds that his own loop has a length of exactly 50, he immediately knows there's a 100% chance of success.
@Ersin Basaran Wait. If the people in general have a 31% chance of survival, but after the first prisoner goes there is a 32%+ chance of survival, then the chance that the first prisoner fucks it up is ~1%. So while the prisoner technically has 50% chance of finding his number, the chance that he ALONE fucks it up and no one else, is merely 1%.
Nice catch! So, you could phrase this riddle in an even more confusing way. The setting remains the same as in the video, then you state the following scenario: "The inmates come up with a strategy, the first prisoner indeed finds his number and additionally knows for sure that they all will be free. How is that possible?" Good luck figuring out this solution!
If you start with the box that has your number on it, the only way to conclude the loop is to find the box with your slip in it that points back to the box you started on. It makes sense. Its just a matter of how many boxes you have to go through to get there
Another way to look at how you know you'll always be on the loop that contains your number is to realize that there is no way to stop a sequence other than at the box you started. 13 -> 42 -> 17 ... Using prisoner 13 for example: box 17 (or any other box) can't have the slip that points to box 42, because box 13 had the slip that pointed to box 42. And so on for box 17 and any subsequent boxes. Meaning you'll never go back to a box you've already encountered the slip for. Also the sequence can't go on forever seeing how there are a finite number of boxes/slips. Therefore, all that remains is to eventually encounter the box with the slip to box 13. For me, this was a clearer way to think about it than the explanation at 11:10.
I want to point out that this is by extension a cool analogy to quantum mechanics and how quantum computers work, especially entanglement. If you go in and give each prisoner a 50% chance at random, you have no idea what the outcome of said prisoner will be. But if you have all of them follow this strategy, you effectively 'entangle them', where entanglement of qubits is merely just having the qubits enter a statistical dependence on each other, so after measurement, you know with absolute certainty that all prisoners either failed or succeeded
Also for those who are wondering where did we got the extra success chance imagine a scenario like this: If you haven't made a strategy before hand you have this "certain failure" scenarios. Think 4 people 4 boxes 2 chances. If they didn't talked beforehand there is a possibility that all people will choose box 1 and box 2 which is a certain failures since 2 boxes cant have the numbers of all 4 people. If you talk beforehand you set a certain path for everyone that eliminates this kind of possibilities. This is what raises the chances of success.
The reason that it is above 30% all the time is because you can always open half of the boxes. When there is more boxes, one box is a smaller percentage of the entire whole amount of boxes. So a smaller percentage of the whole is able to make the loop above half of the boxes, making them get executed.
Firstly it’s child , plural of child is children Secondly if Martin has a driving license , he should drive far far away from riddle land Thirdly why are they in a restaurant ? Fourthly who’s looking after the ‘childs’ ? And are social services aware ? And finally , I’ve always wondered how long a reply could be
@Casey Darrah Sure, but only once you believe those are the options. They're already desperate to survive, but you need 99 prisoners to run the analysis in their head, and for 100% of them to "get it".
I believe this because my teachers used this tactic to separate groups in college so we wouldn’t divide by friend groups. Problbailty-wise it was only about 1/3 of the time that we ended up separating perfectly 2/3s of the time she would have to reconfigure because someone would end up left out or a loop would be messed up.
Brilliant! This is highly reminiscent of the mathematics of Clock Solitaire (which I wrote about over 40 years ago in Mathematics Magazine, Jan. 1982 issue). Well, thank you so much for this, so much better than I envisioned way back then!
i remember learning about those permutations, factorials, and stuff on out probability and statistics class during 8th grade and it was not fun, but this was actually very interesting
An interesting twist to this problem would be that if you are able to find your number, you are allowed to keep open a box of your choice, so that the next person can see that box contents. What then is the strategy with the highest probability of being able to escape.
@Entropie - The possibility to give some information to the following prisoner essentially renders the "loop strategy" worthless, as there now is a trivial solution achieving 50% success rate. They all open either boxes 1 to 50, or 51 to 100. If the predecessor left open a box with an uneven number, this means that the following prisoner will find his number in boxes 1 to 50, and vice versa. One bit of information is sufficient. However, it can't get better than 50% due to the risk of the first man.
I would argue a good strategy would be to keep exploring different loops after finding your number and ultimately open a box from a loop that you did not manage to close. Additionally if the prisoners go into the room in order of their numbers your exploration should only focus on boxes > your number so whenever you loop to a box < your number you ignore that one in the exploration phase and seek out another loop to explore instead. Of course already opened boxes will be used in order to just save on box openings, whenever a slip points to an open box you can just skip over it in the loop. There is a special case where your number is already revealed upon entering the room, in this case you go into exploration immediately. My reasoning is that opening a box of a loop that you could close is pretty much pointless since the loop was already save so the added information for the next prisoner makes no difference. Furthermore since the prisoners before you already explored all the loops that contained a number < your number there is no point in opening boxes for those loops, if they were deadly a previous prisoners already failed anyways. Therefore the only loops that matter are those that are different from your own, consist only of numbers > your number and are deadly, opening a box on such a loop will decrease the effective length of the loop by 1. If the prisoners manage to use this to bring the loop under length 51 before a prisoner hits it, it will turn a loss into a win. Arguably the benefit is not going to be huge since it will for the most part rely on the big loop not being "too big" otherwise it would be fairly unlikely for enough prisoners to dodge it and get to reduce it under 51.
I found that the underlying concept here is easiest to understand in a simplified example, with for example two prisoners and two boxes, and each is only allowed to open one box. If they both open one box randomly, the chance of them both finding their number is 1/2 x 1/2 = 1/4, or 25%. The other 75% of the time they either both miss, or only one gets their box correct. However, if they both agree to open different boxes, they either both get their number or both miss, with probability 50%, (i.e. depending on whether the first prisoner chooses correctly). By conditioning the second prisoner's outcome on the first, you're essentially consolidating the original probability distribution into a higher variance one with fewer options, where either everyone gets it wrong, or everyone gets it right, with nothing in between. In the context of the original problem, since all 100 have to get their box correct, every other outcome is meaningless, so the loop strategy is the optimal one.
As someone that went to prison, I can tell you with 100% confidence, that they got more chances to win by randomly picking boxes (one in 8*1^32), than 100 of them to agree to ANY strategy.
It's true, I remember being the first one to go through the boxes, and after the 49th I thought I was dead but The 50th was my number. He saved our lives, and we will be eternally grateful., ,
@Aaron I only found this video because I'm trying to understand how Michael knew how to save us all that day. I'm so glad he wasn't shanked with a sharpened toothbrush that one time he took two servings on cous cous Friday, leaving none for one-eyed Emine.
@Aaron Kerrigan Yeah, I acknowledged the somewhere in the comments. But I'm necer editing my comments - an old prison habit. 😛 Trust me, even if the leader orders them to do something, many of them would do the opposite if the leader has no way to know that they disobeyed. And he wouldn't have a way to know.
Okay, so without watching this, this is my try and solving it. The tactic we will stick with is: Each person with stay in the room a minimum of 10 minutes. Within that ten minutes they will open 50 boxes. But the boxes they open will be either boxes 1-50 or 51 -100. Effectively cutting the room into two sides, side A (boxes 1-50) and side B (boxes 51-100) The first prisoner will walk in and, start opening boxes from side A, and PRAY they find their number. While opening those boxes they will also be keeping an eye out for the number of the person behind them. So one will look for two, two will look for three, and so on. If you see the number of the person behind you while on side A of the room, leave the room at the 10 minute mark. That tells the next person they need to check side A. IF you don’t see the next persons number on side A, stay in the room for 15 minutes. That tells them, check side B for their number. EVERYONE by default will go to side A unless this *condition* is meet. *Condition*: the person in front of you stayed in the room for 15 minutes. That should solve it as long as each prisoner keeps track of how long the person in front of them was in the room. Originally I thought of a way more complicated way to do this, a way that would let each prisoner know which box is theirs just by when the person in front of them leaves the room, but in the end I think this strategy would do the trick.
At 5:40 you could reformulate it in a more intuitive / positive way. If a prisoner number is on a loop of size 50 or smaller all prisoners with the numbers of that loop also made it. In this case the other 49 prisoners "basically" dont need to check it anymore. This is very interesting riddle! Thanks for making the video.
i wrote this in bash, i thought there was something wrong with the randomness of shuf because either everyone won, or the first or second prisoner always failed, until i heard your "fail hard or succeed completely" explanation. it works. shuf is fit for purpose.
This loop strategy is used as a solving method for 3x3 Rubik's cube blindfolded. The simplest method is called Old Pochmann and as long as you can memorize letters and don't mess up the execution, you can solve a Rubik's cube blindfolded
It's basically how many permutations on n letters has order > n/2. The cycle lengths aren't independent since each form a cyclic subgroup of Sn and is bounded by lagrange theorem
Awesome video. I feel like this should be added tho…for the sympathetic warden to guarantee success with one swap, he would have to know he was swapping 2 from the >51 loop. If it’s swapping two random numbers, then in doesn’t automatically work. But thanks for this. It’s incredible!
The word "random" is never used. He says "just two boxes" not "just two random boxes". Quite a few have interpreted it this way though which is interesting.
My big family did name-drawing at Christmas to pick who we'd each buy for, and my older physicist brother woukd map out all the closed loops. So this makes great sense to me!
I would not have thought about how the number assignment represented a function and that we can apply different cyclic theorems for finite functions, absolutely clever
@Pluto : With all do respect for your opinion, my opinion is that gender studies don't solve any problems but rather create new ones. But I won't be posting this on a video about gender studies because it would be rather disrespectful. If you don't enjoy maths, no problem, just don't watch video's on the subject matter.
Now here's the next question... what at the odds if each individual prisoner can communicate back the slips/box numbers as they find them to the rest of the prisoners? Assuming someone with a masters or better in mathematics is in prison for some reason.. like microwaving their ex girlfriend's cat to death.
Thanks for the video, so simple but yet so interesting. I also thought on reaching our number first since it is 50% to be there, but didn't think on loops!
This problem feels really similar to how computers reduce the order to process data with a structure called Ring Buffers, the idea is to have a structure that moves data quickly, redo logs buffers are fast for this reason. Having a structure sorted vs random is always O(1). So If we change the condition from 50% reading the boxes to 100%, and we change the goal to find THE fastest way to find his number, will be something interesting to check.
If by fastest you mean reducing the average time it takes for all prisoners to find their number strategy does not matter at all, the average always is 50.5 boxes per prisoner. The strategy in this only matters because the requirement is specifically that all prisoners have to fulfill a condition simultaneously any question that can be answered by only looking at individual prisoners will not depend on a given strategy.
To better understand what he said about the probabilities being connected, just think of if there are only 2 prisoners that can only open 1 of 2 boxes. While no matter what each individual prisoner only has a 50% chance, it they both pick the same box there will always be one who wins and one who loses, because that one box can only have one of their numbers. So collectively they will always lose. Now if instead they just each decide to pick their own box, each individually still has a 50% chance, but now they will either both win 50% of the time or both lose 50% of the time, because it removes the chance of them overlapping.
6:35 I like that Derek's "random" numbers were all odd numbers. We have a bias towards perceiving odd numbers as more random than even numbers. Even more so, of the 9 digits in these numbers, only a single one was even.
I think I've used this strategy before without realizing it. I don't remember why or how I came up with the idea, but I remember using loops to find a random number.
I have never seen this riddle, but I myself was thinking about number loops starting with the box matching the prisoner's number, before even reaching to that section of the video. I'm not a mathematician or anything, but I thought that because it sounded the most logical, and I've heard of looped numbers before
After learning the solution its pretty intuitive for me to understand it. Sure, the INDIVIDUAL probability of finding your paper is still 50 percent... But the net probability is NO LONGER based on multiplying all these different probabilities together, because they are no longer INDEPENDEDNT probabilities. Instead the probability of the GROUP succeeding is the probability that none of the loops are longer than 50. Which is pretty easy to see how thats a pretty decent odds. If the first loop turns out to be, say, 10 in length, then the next person not in that loop has 50 tries out of 90 to find their number. If their loop lasts 30, then the next loop has a 50/60 chance of being valid. And the moment the winning loops total more than 50 in length, you know everyone else wins as well.
I got the answer in less than an hour. Never seen or heard of this math problem until today. Intuitive once you grasp that you require a strategy that uses as much information as possible while minimizing randomness.
At first, I was thinking that the first two prisoners could try their luck at getting their number. The plan would be that Prisoner Number One and Prisoner Number Two (relying on them, if they don't find their number, the rest are screwed) would look from the entrance of the room, and would turn the boxes that contained an Odd number inside right side up (again, looking from the entrance of the room), and boxes that contained an Even number upside down. Prisoner One would pick through 50 boxes, turning the boxes accordingly. Once they find their number, they are to finish flipping the boxes, and then leave once they are done. (If this wasn't allowed, I would say it is up to Prisoner #2 to finish). If Prisoner #1 is able to find their number, as well as flip 50 boxes, and Prisoner #2 would have to flip the rest of them as well, then the rest of the prisoners would have a 100% chance of finding their number, if they can remember the box turning rule. Odd= RIght Side up, Even = Upside down. An easy way to remember this is by counting the number of letters in Right Side Up and Upside Down, as the first has an Odd amount of letters, and the latter has an even amount. Again, this all depends on Prisoner #1 and #2. If they are both able to successfully pick their number from their 50 boxes, and be able to switch them accordingly, it guarantees 100% success. Once Prisoner #3 comes in (depending if #1 and #2 screwed things up or not), they should be able to pick the boxes that are right side up and find their number within 50 tries. If they, #1 and #2 are not able to find their number, then they are all dead. This does depends if turning the boxes betrays the rule (which I am sure it does), but this is what I came up with. This was written at minute 2:45 in the video. Gonna see what the vid comes up with now. I have finished the video, and here is my thoughts. Using the Loop strategy would probably be the same outcome as my strategy. Basing on either my first 2 prisoners, or the % of weather the loops are under 51 numbers, either your test or my test should be able to possibly get their own number and escape, or lose trying.
This is actually, in my opinion, the least controversial thing he has posted in a while. Good work. This makes alot of sense to me, I would never have thought of it but it works
@ILYES The Monty Hall problem is just maths and is pretty controversial too. I remember everyone going crazy in the comments after that Numberphile video
Correct! The beauty of math is that there cannot be controversial things. Math and logic are the final judges, deciding which is right and which is wrong. If you read carefully the comments, no one is questioning the strategy, they simply complain they cannot understand it.
Idk if I've seen this, but I feel like if they start with their number, followed the number on the slip in the box and repeat, they'll have a better chance of running across their number. Full disclosure, I vaguely remember watching something similar to this a while ago, so I didn't figure it out if I'm right, I remembered it. There's a difference.
Would be interesting to see the percentage chance if we assumed the loop would be greater than 50, for instance picking any random number and following that until you either get a closed loop, or the right loop, how much different or lower it'd be than the 30.7% chance.
Suppose there is a 51-loop and everyone picks his first box at random, and then follows the loop. So the 49 prisoners who don't have their numbers on this long loop will fail with a probability of 51/100 each, bringing the total probability that they all find their number to a meagre 0.51^49 = 4.7E-15. And the other ones might fail as well. So we won't get even near to these 30.7% chance of the consequent loop strategy.
The truly sadistic warden would show the prisoners this video. Let them watch it (together) as many times as they want, discuss it as much as needed to ensure they understand what to do, and then label the boxes in binary numbers.
You are guaranteed to go to the box containing your number in it by starting with the box that has the number on it using that strategy because the loop will never end since it has to end with the box you started with but that just means you will have to find that number in the box right before which contains your number.
@Roskal Raskal they are gonna die either way. It's not possible. Their best strategy is to find a way to not even get in this deal. I have had 50% chances and still lose consecutive times. Just do head and tails, do it until you fail. You won't get far even with 50%.
@Ducky Momo Exactly. If every prisoner gets to open 99 boxes, then the purely random strategy succeeds with 37%, while the loop strategy succeeds with 99%.
@L.F. M. For each person who opens 50 random boxes vs uses the strategy, the chance of succeeding goes down by a half. If one person decides to open randomly, you'll all have a half of 30% chance of success, or 15%. If there are two, then half of that, so about 7%. If 10 I would think 31% * (1/256), or a fraction of one percent. Having a few people be idiots doesn't totally ruin your chances, but much more than 10 and you're better off trying to win the lottery.
It's weird how this method would be worse for a single person, then simply guessing, yet it works better as a group. It's honestly interesting how this works and makes me wonder what kind of stuff can be done with this.
@miloszforman6270 your absolutely right. Soon as I read it, I remembered the video saying that. I had that 30% stuck in my head and stopped thinking. Lol. Thanks for pointing that out
It's not worse for a single person - the chance to find one's number is still 50% as is clearly pointed out in the video. This is due to the fact that in most cases there are also short loops even if there is one long loop, so some prisoners will succeed to find their number (but lose the game anyway). The average size of the longest loop is 62.433 = 62.433%*100, where 62.433...% is called the "Golomb-Dickman constant" which someone has calculated to a few thousand decimal places. To be precise, the GD constant is only the limit value for very long permutations, so the exact value for the average size of the longest loop might differ slightly for permutations of length n=100 as in the current case. The numerical calculation yields 62.744 for n=100. I got an average size of 62.83 in a simulation of 10000 random 100-permutations. I did not so far find a formula which gives a useful approximation for the deviation from the limit as a function of the length of the permutations. Certainly there is one - if someone knows it he is invited to state it here.
Haven’t got time to read all the comment, so maybe this has already been mentioned, but interestingly this loop strategy was used by Turing during his efforts to decode the enigma machines. He made loops of letter presses to ascertain some properties of the wheels.
He didn't solve that by the 3 loops (or how many there were, pretty sure 3). Turing was solved because he made muddled up words coherent. IF it were only using this technique, then he would have found many possibilities of incoherent nonsense. He had more clues, as he actually had the paragraph of writing that he was trying to decipher. So when his looping patterns yielded no coherent words, he quickly moved on. The prisoners can't do that here.
This reminds me of a game we played in high school, that we called "Gotcha" (it had other names as well). For the younger folks here, this was before kids carried cell phones to school. It was usually about 15 to 20 of us playing. One person would run the game and not play. That person (the "DM") would create a loop and give each player a piece of paper with the name of the next person on it. The object was to find that person and say "Gotcha" at which point they were out of the game. They would give you the paper of the person they were hunting and you then sought out that person. You would win when the paper you were given had your name on it. Papers were handed out near the end of a school day, and the game would start the next day at school. I won once when the person with my name on her paper stayed home sick on the first day of a new game. Nobody got me but I was able work my way through everyone else until I got to her name. The following morning I got her stepping off the school bus. Fun times!
The reason I found this video was a similar problem: the key differences were that the ‘boxes’ were like bingo numbers and they would be replaced each day and that they stated there was a ‘certainty’ that all prisoners would go free.
Alternative explanation for why you're guaranteed to be on the same loop as your number: Keep in mind each slip only exists once. If you start at the box labeled with your number and follow the loop, the only way you could NOT eventually find your number is if you come across a slip pointing you to a box you've already opened, which of course leads you on the same path you've already been on, trapping you in an infinite sub-loop. But that is impossible, because that box you would be pointed back to was already pointed to by the slip you found just before that, and you can't find that same slip again. The only way you'll be pointed back to a box you already opened is that it's the box you started with, because you went to that one without having found the slip that points to it yet.
@Charlie Davies Huh, your number is only guaranteed to be on the loop you start with if you start with your number. Let's say you are number 1 and you start with box #2. Box #2 is on a loop of 30 that does not include slip #1. Now you have wasted 30 picks and if you restart with #1 you have to hope that loop is less than 21.
@Cifirjwbducuf Yes, you need to find your slip number. If you start with your box number, you have to be on the correct loop, otherwise it would not be a loop. You just have to hope there is not a loop longer than 50. If there is a loop of 51, 51 prisoners will not find their slips in 50 chances (if they follow the strategy.) If the longest loop is 50 or less they will all find their number.
@serhan cinar Well, he was supposed to open the box labeled with his own number, 54... That's part of the whole strategy. If he doesn't do that, then yeah, there's no guarantee for him to be on the correct loop.^^'
Let's say Prisoner54 opens box 36 contains slip 45, then opens container 45 which contains slip 36... Prisoner54 is out of the loop. How come he is guaranteed to be on the loop?
I was thinking about this and it really only works if the boxes/papers aren't jumbled at random. Because if it was random you'd have a chance that a box ends up with the correct slip in it which would break your loop strategy
Has this experiment been tried with real people and real choices?? I would love to take part with 99 other people both doing random choices and using the method explained. It wouldn’t be that hard to setup online and have people log into a “group of 100” and do either a random choice or a planned strategy. It would be really cool. 😃
That's an amazing video! Visualizations are very on spot, explaining complex concepts in a simple way. One thing that I missed is maybe a brief note of any this strategy is the best one? Why can't anyone come up with a better one?
This is covered in the paper by Warshauer/Curtin which is mentioned in the introductory text. This paper ("The Locker Puzzle") is avaible on the server of the University of Cambridge. Don't use the Springer/v. Holtzbrinck link, they charge money. There is a short outline of this proof in my answer to @BOB from a day ago.
Hang on, the part at 12:40 about swapping two random boxes to break a loop must be wrong. As maybe your random swap created a long loop from two smaller ones. Or you made a really long loop into a tiny loop and a slightly less long loop. To illustrate the second case: if box B1 contains number N2, B2 contains N3 ... Up to B100 contains N1, if you randomly swap B3 and B4 then you end up with B3=N5 and B4=N4. Meaning you went from a 100 loop to a 99 loop plus a 'single' loop. Or am I missing something?
@nothing to see here Consider length 1 loops. If you have books 1 with slip 1 then after adding to it the slip leads to another loop and the length is >1. If all loops were length 1 before adding a number
@josephsaltich correct the loop is still the loop if you add 5 all you do is change the starting point and effective made a new loop parallel to the old one in some way, however if the prisoners were to assign random unique numbers to the box and then follow the loop it will work but all prisoners would have to have talked about that before hand which is not really possible to remember but yeah the strategy of adding some constant value won’t work
a friend of mine claims it actually works. you're prisoner nr 1 and open your own box. now except for the letter showing nr 96*, you just add 5 to the written number and go to that box and so on. and this will actually bring you to a new loop system which is obviously likelier to be not loop length 100 anymore. (i think since parallel shifts work only in ordered paths, odds of adding 5 not going to change the loop structure are about 0.) *in that case i assume it is ok to jump the already visited boxes (/leave them uncounted) without leaving the new generated loop. but not sure. your english is very fine, it's my second language, too and i understand you perfectly. dont hesitate to ask about or critisise my language, too tho :)
@Al ias 808 you are right, this process would change the loops completely but disregards the fact that you have to reach your own number and not your number + 5. I still think the loop strategy would be better than just choosing randomly, but to calculate the chances of getting your own number one would have to measure the possibility that a random number is in your loop taking into account the length of loops, also that once you end a loop you can start a new one with your left attempts (or more than one, also one would probably end in the middle of a loop), and also add the possibility that if the loop is longer than 50, the number might be at any point of the loop. Sorry if something is misspelled or not understandable, English is my second language.
@Brian Larsen yeah it could be morally troubling....or ya know...instead of with prisoners fighting for freedom it could be 100 random volunteers with no consequences for failure.
I think I have a simple way to test this in real life. Make a 100 page document with 1 number 1-100 on each page. Shuffle the paper, turn it over and print again with a different color ink (just so you can not confuse box # with slip #. Lay them all black ink up and run through your test. You would only need 5 or 6 six-foot tables to lay the sheets on, 3 in a row with an aisle between. Once you printed both sides your loops would be set, it would not matter whether you shuffled them again or which order they were displayed, numerically would just speed up the process.
checkout this javascript code // prision problem from the array lets see whats the outcome function shuffled_array(length) { let box = []; for (let i = 1; i
Is there a way to improve the odds off success even more? Instead of having the prisoner that finds their number in the loop to stop, what if that prisoner were to continue to open random boxes until they reach their 50 limit. Then the next prisoner do the same and so forth. Would that not improved their odds a little more, even if it is minute. Any improvement in the odds is a better answer, right? Help me with the math.
I can't see how opening further boxes could change the odds at all. According to the rules, the boxes have to be closed before the next prisoner enters. On the other hand, if you allow them to leave the boxes open, this would raise the chances of all to survive to 50%, but that's quite trivial a calculation (only the first one has a 50% chance, all others have a 100% chance to find their number).
I gave this puzzle to my kids when they were little, so it must be fairly old by now. Interesting fact not mentioned in the video (and it should have been!) is that there is no better strategy in this setting! In other words, it's been proven that the loop strategy is optimal and there's no better one. For more on this and similar, go get a BS in Computer Science and student Discrete Math. :)
@Alcazar123 There's a difference between "this is the best strategy we currently know" and "it is proven that there is no better strategy than this one."
_"Interesting fact not mentioned in the video (and it should have been!) is that there is no better strategy in this setting!"_ Yes, it should have been mentioned. This fact is covered in the paper by Warshauer and Curtin which is referenced in the introductory text. Few people read this introduction, and the introduction itself does not mention the optimality. It's a question that was frequently asked and discussed in this comment section.
Everything makes sense. An individual’s searching (A) is a different event than whole group’s loop searching (B) by definition. If event B results from INDEPENDNETLY repeating event A, then multiplying 100 times P(A) to get P(B) is correct. But with the looping strategy, event (A)s are highly CORRELATED with each other. In fact, for all prisoners on the same loop, the correlation is 100% (they all succeed or fail), so they only count as one event A, not as an independent series of them! Other strategies may be devised and demonstrate different correlations. Whenever one prisoner's result is somehow bundled with that of another prisoner, the correlation is no longer 0, and P(B) will no longer be P(A)**100. For example, if all prisoners plan to open just the first 50 boxes, they are somehow bundled together, and P(B) is 0.
Thank you. It now makes perfect sense. I couldn't wrap my head around how this could logically work. But of course since everyone starts at different fixed number, it turns the system from randomized lottery into a systematic search through all different possibilities. It removes the random redundancies from each persons search and thus result in massive increase in efficiency.
To extrapolate this problem further, it’d be interesting to understand at what point prisoners would know they will not die. Like you said at the end, either you fail hard or succeed fully. From the P distribution curve, I’d day the minute 50th prisoner comes out successfully, the rest of them will be guaranteed to find their number, right? But that’s wrong as there could be a 99 number loop and a self contained loop, so one person could still fail. However with your probability distribution, there’s 0% chance that 99 prisoners will succeed and 1 will fail. (I know your graph is right, and it’s a way to visualise probability, just finding it intriguing :))
Yes, 50 prisoners exiting successfully to be sure, but the chances of 49 being successful when a 51-loop is present is miniscule. In the 51-loop case it's approximately a 50-50 chance that your individual number lies in the big loop or not, so the chance of 49 successes is about (1/2)^49. When just 7 prisoners have exited successfully there would only be a less than 1% chance that the room contained a big loop.
I have a theory for a 50% success for all prisoners, but it assumes one thing that is left out of the word problem. Each prisoner learns the number of the prisoner that will enter the room after them. Each prisoner is searching for BOTH numbers. The first prisoner looks at boxes 1-50. They have a 50% chance of finding their number. IF the the subsequent prisoner's number is in the 1-50 boxes, the prisoner exits the room and sits down (this assumes the prisoners see each other enter and leave the room). If the next prisoner's number is NOT in the group, they exit and remain standing. This would confirm with a 100% accuracy that each prisoner after the first would find their number. The only gamble is the first prisoner finding their number in the first 50 boxes.
But this involves transferring some information from the previous man to the one following him. That's a kind of communication which is not allowed by the rules. - But if you allow one bit of information, you get this simple 50% solution. So to compensate for this advantage, we may reduce the number of boxes which are to be opened, for example to only 40 boxes. It gets a bit complicated then. Any idea?
Great video ! But I’m missing the point at 9:41 : using the strategy, why would the individual probability for s.o. to find the right box be of 50% instead of 30% ? You may have opened half the boxes, but the underlying probability for them to have your number is not the same anymore because of the strategy you’re using, no ? Thanks if you can help !
The probability that someone finds his number is always 50%, independently of the strategy he uses. Could not be otherwise, as he is opening 50 boxes out of 100, and he has absolutely no information about their contents. So his chance to lose the game is 68.82%, while he still finds his number with 50% probability. That means that there is a chance of 68.82% - 50% = 18.82% to find his number even if there is some long loop. Indeed, such a long loop does in most cases not include _all_ boxes: The average size of a long loop - supposed there is one - is 50/0.6882 = 72.65 . So he has a 100% - 72.65% = 27.35% chance to find his number under the condition that there is a long loop ("conditional probability"). For the overall chance for this case we once again get 27.35%*68.82% = 18.82%.
Yeah when you started explaining I was like oh that's brilliant. I understood why it worked somewhat. I knew from the beginning that the strat had to make the probability no longer independent but I couldn't see the how
That's actually what we do with pointers in C/C++, OS, MMU... And if you factor in deadlines, the feeling of being a prisoner might become very realistic.
It would be really awesome to see the original reviews of that paper (from when is was submitted to publication). I bet those reviewers were also beaming with professor energy 😂😂
Decent way to think about this problem. This particular strategy makes it a question of “is the room setup in a certain way” Rather than “Are all 100 prisoners gonna correctly guess where their number is?” Because if you increase the number of prisoners by 10 times, but have them duplicates with the other original 100. The 2nd question’s probability would decrease, but the first would remain the same. Theoretically, it might be possible to have a bunch of other strategies that would turn this from Question 2, to Question 1. But loops are probably one of the higher probability strategies. All prisoners selecting the first 50 boxes is a strategy that makes it question 1, but it makes the answer a definitive 0% since it guarantees 50 prisoners find their number, and 50 prisoners don’t. Even though it’s still technically a 50/50 chance for each individual prisoner to find their number.
Something I just thought of. (BEFORE @12 minute mark). The only way for there to be a "dead end loop" is if the pictures/numbers/letters are not each unique. Now, loops will still form and the loops that are formed are intersecting loops. The prisoners with the same number as each other will be more likely to find their numbers. However, the prisoners with the non-repeating numbers will have a slightly harder time finding their own numbers as (with just one doubled number) the odds of going down the correct "pathed loop" will be 50/50. (If the warden was truly sadistic and cheating, he would put double numbers inside one of the boxes and not really at random either. Just barely enough of a big 3rd loop that prisoners wouldn't notice the repeat)
This would mean that 2 of the prisoners would also have the same number on their jumpsuit? Or there would be an extra box. Or there would be one prisoner who couldn’t find their number even if he checked all 100? So it would be 100% impossible and ruins the thought experiment.
I'm writing an adventure novel in which the characters have to solve some riddles to get to the thing they're searching for.. I'm definitely using this in it!!
"You can only fail hard, or succeed completely" This is the key insight, which actually generalizes to some other probability problems and puzzles beyond just this one! Basically, for every prisoner by themselves, regardless of whether you use the loop strategy or any other strategy, it's only 50%. If every prisoner's 50% is random and independent from everyone else's, then you're doomed. But if you can concentrate their successes and failures together, then you have a shot. You want to pick a strategy where if one prisoner fails, it means that as many other prisoners as possible also fail, and when one prisoner succeeds, as many other prisoners as possible will also succeed. By overlapping their failures together and their successes together, even though no individual prisoner's chance has improved from 50% for their own individual success, they magnify their chance of getting a very extreme outcome collectively, in *either* direction. The loop strategy does this very well. Consider the first prisoner - suppose they go into a room and find their slip after a cycle of length 38. Then they immediately know that 37 other prisoners are going to succeed. Or, suppose that they fail to find their box. Then they immediately know that they are in a cycle of length > 50, so they know for sure that at least 50 other prisoners are also going to fail. Every prisoner's 50% of success or failure are heavily overlapping with many other prisoner's 50% success or failure, so their chance to get an extreme outcome is vastly larger than if they were all independent. The overlap isn't perfect - some prisoners in a long cycle may fail to find their slip while those in a short cycle succeed. Those short-cycle successes on average wastes about 19% of each prisoner's 50% chance of individual success - so ultimately the final success chance that collectively overlaps between all the prisoners is about 31%. To illustrate the point, we can consider a different simpler game - suppose we still have 100 boxes, but this time inside each box is a coin that is randomly 50-50 to be heads or tails. Suppose each prisoner only gets to look at a single box, and they collectively win only if every single one of them finds a box with a heads. Each prisoner's own individual success chance is 50%. If they all independently open different boxes, then as before their overall success chance is 1/2^100. However, if they all coordinate to open the *same* box, then they can overlap their individual successes and failures - either they all see a heads and win, or all see a tails and lose. In this simple game the overlap is perfect - every prisoner's own chance is still only 50% to find a heads, but all prisoners share the *same* 50% and so their collective chance is also 50%, rather than 1/2^100.
@Lord Talos Gaming At first sight that looks like a good argument, but the loop strategy goes far beyond that. Not only you're not going to waste attempts on boxes which contain a slip with their own number, but you're not going to waste attempts on any box which is not contained on the loop containing your number. On the other hand, you're also guaranteed that you will find your number only as the last element of the loop, so if your loop is longer than 50 you're doomed and have 0% chance of getting your number, while you would still have a chance to find it if you were to pick the boxes randomly. Thus it is not true that, as you suggested, using the loop strategy "makes no difference to individual chances" if there are no boxes with their own number. Note that for a single person the chance of getting his number with the loop strategy is NOT the chance that there are no loops of length greater than 50, but it is the chance that HIS loop is not greater than 50. The latter is of course much larger than 31% (which is the chance of the former). In the way I formulated the question, you could also calculate explicitly the probability of finding your number with the loop strategy and you can find it is 50%, as others already pointed out by euristic arguments. But here we can make actual calculations. Let's say your number is 1 (without loss of generality), so you open box 1 and there's a 1/100 chance that the loop ends here, namely that box 1 contains number 1. In the other 99/100 cases, you will be redirected to another number n different from 1. From this number n you will have 1/99 chances to get the number 1 and thus have your loop be of length 2 (since you know the box n does not contain the number n, which is already contained in box 1), so the overall chance at the second step is 99/100*1/99=1/100. The third step is similar and you will have 1/98 chances to have you loop be of length 3, if you know its length is not 1 or 2, so the overall chance is 99/100*98/99*1/98=1/100. And so on, as one would expect, the length of the loop containing your number is a random variable uniformly distributed from 1 to 100 and the chance that it is 50 or less is just 50%.
@Carlos Ortega If the team is going to lose using the loop strategy, most of the players will lose and so you have at least a 51% chance of losing individually. Meaning: When you're losing, you probably know it. So if you individually win, you're probably not!
@Gamina Wulfsdottir by "fail hard", he means the majority of prisoners fail. There's no scenario where a majority of prisoners would pass with only a minority failing. Even if one prisoner fails, it automatically means the majority of prisoners will also fail. Conversely, if a majority of players pass, all prisoners will consequently pass. There's no scope for close shaves.
Except that any prisoner who doesn't find their own number after 50 tries will know that they are all dead. I don't see how "You can only fail hard, or succeed completely" is any kind of a key insight. It's simply another way of saying "pass/fail".
i find that easier to understand than the problem with 3 doors where two of them have a goat behind it and one has a car. But really well explained, loved the video!
The monty hall problem is wholly contingent on the “host” knowing which door contains which prizes. It only works if the host always reveals one of the donkeys instead of the car BASED ON prior knowledge. If is NOT advantageous to switch if the host reveals a donkey “by accident.” Nor is it disadvantageous. At that point your odds remain the same. The easiest way to consider the problem is to extrapolate. If a host knows that one out of 100 doors has a car (the rest being donkeys) and the host reveals 98 donkeys based on prior knowledge, it’s overwhelmingly obvious that you should switch.
@Howard the first way you propose doesn't sound logical, even though it is. The second sounds like it's different from the first. You're explaining it like everyone else explains it. The whole pool of this video to me is that he doesn't do just that, but he actually goes through and shows you why that works my drawing the whole thing out
@Joe Doe Here is another way to view the he MH problem -> focus on the fact that ONLY non-winning doors are eliminated. At first each door has a 33% chance of being the best. When a losing door is removed (and that is what happens) your original odds are the same at 33%. But the remaining door now has a 66% chance of being the best. If that doesn't seem intuitive start with 100 doors. Select one. Eliminate 98 other doors. All those 98 doors were of course non-winning doors. Now, with just two doors, would it be wise to switch ?
@Kezwik The easiest way to understand why the Monty Hall problem works is to write out all the possibilities (there's not all that many) and see how many of them disappear when a door without the prize is opened. It makes it very clear very quickly
Something seems wrong at 9:00
What is the probability of a loop of length 1? (Can't be 1/1)
Length 2?
Ez it’s 1/100
@powerwhellie I'd say "wait until your older."
@Veritasium Intriguing
@Veritasium complete nonsense and not a solution.
according to this strategy, we simply shift the "RANDOMNESS" of the choice to the boxes. after all, the numbers in the boxes are randomly distributed and therefore we open the next box randomly....
but we take responsibility for the choice.
but we still get 50/50.
complete nonsense and not a solution.
according to this strategy, we simply shift the "RANDOMNESS" of the choice to the boxes. after all, the numbers in the boxes are randomly distributed and therefore we open the next box randomly....
but we take responsibility for the choice.
but we still get 50/50.
As somebody that's tried tracking down a CD left in the wrong CD case, I can attest that the loop strategy does indeed work 31% of the time. (The other 69% of the time it turns up weeks later on the kitchen table.)
@Richard Pike The Wii can not read CDs.
So true
@Cloud CDs became obsolete for games before they became obsolete for music.
Why do you stop after looking for the CD 50 times??
do you mean.... like you open a Barbara Streisand box, and you find a Celine Dion CD, so you go to the Celine Dion box, and you find a Dolly Parton CD..... and so on?
As a former professional gambler, the key to understanding this in real-world terms is at 9:48. Every prisoner's individual chance of success is still 50%. The strategy works by making the prisoners' individual chances contingent on each other: linking them together.
Imagine a related puzzle - the sadistic warden has been told that the median human heart rate is 75 beats per minute.
He devises a game where he measures the 100 prisoners' heart rates. He has two large bins marked "UNDER 75 BPM" and "75 OR OVER", and he places each prisoner's ID tag in the bin corresponding to their measured heart rate. But there are two catches. Firstly, he has privately flipped a coin before the game to decide which will be the winning bin: the prisoners don't know which is which.
And secondly, *all 100* prisoners have to win the game for them to be freed.
So each prisoner's chance of winning is 50%. And with no collective strategy, the chance of everyone winning is 0.5 to the power 100. Tiny.
But the collective strategy is simple: everyone does extremely vigorous exercise immediately before getting tested.
Now *everyone's* heart rate is above the median. So although each person's individual chance of winning the game is still 50%, now the collective chance of winning is also 50% - because *everyone is now in the same bin.*
Basically, that's how to grok the video's strategy for the boxes problem - in a sense it puts everyone "in the same bin" - and the bin is marked *"Are all the loops shorter than 51 ?".*
@michael gove Absolutely wonderful perspective! Thanks!
That's actually nonsense. When the prisoners follow the loop strategy, they don't "choose" between multiple options, they just follow the pattern. The only probability at play here is the probability of the room setup. Even when you want to calculate the individual chance that a prisoner finds his number or not, it's almost never 50%. We already know when we are in a winning room configuration (about 31% of the time) 100% of the prisoners will find their number. Those are two depended events. So the overall probability is still about 31%.
Now have a look at one of the loosing room configurations. For simplicity just think of a room that has only two chains, one with 20 numbers, the other with 80. This configuration is part of the 69% chance of the beginning. Here again prisoners do not apply any "choosing" since they just follow the strategy. 20 prisoners will with 100% certainy find their number, as they are part of the 20 loop. 80 prisoners will 100% fail and will not find their number as they are on the loop of length 80 and in order to find their number they would need 80 steps which they don't have. So when you are in a loosing configuration, at least 50% or more will fail to get across their number.
Note that not all prisoners do actually "use up" their 50 draws they have. In the 20/80 example those on the 20 loop will make exact 20 draws. So they would have 30 left over which they don't need.
So it makes no sense to speak of individual chances as those are 100% pre-determined by the actual room layout and not based on any decision the prisoners make (besides the decision to use the looping strategy which gives them a 31% chance to survive).
People made similar mistakes when it comes to the Monty Hall Problem that they assume Monty also has a chance or probabilty to choose. He has not. He knows what's behind the doors and always just follows a pre-determined plan. The contestant also has a fix strategy: switch or not switch. If you do not switch you have 33%, if you do switch you have 66%, end of story. The actions of Monty are based on the contenstants actions. So the only "choice" in the Monty Hall Problem is your first initial choice which fully determines the outcome based on the used strategy.
Also it's completely pointless to argue "but when we change this or that about the problem THEN ....". Yes then it's no longer this problem / question. I've heard that countless of times on the MHP. "But when Monty does not know what door he opens ..." is a complete absured assumption. It's like introducing: "But what happens when a meteor strikes the studio and kills everyone".
@A Cynical Asian You've said absolutely NOTHING. That is so impressive. Feel good about yourself? How? F'ing so ridiculous, haha.
I feel like the really cruel thing to do would be to allow the prisoners to look at 95-97 boxes, with the same thing. If they figure out the stragegy, it's like a >95% chance of success. If they guess randomly, it's
if they opened them randomly at 95 choices each, that would give them a 0.592% chance.
similarly, you could do this with 4 boxes and 10 friends. let them open up 3 boxes each to try to find something in one of the boxes. If the goal is to win if every one finds what was in the box, then they would have about the same odds.
exactly! try to convince your inmates now! the indivudual 97% seem so much more intuitive than trying to grasp even only that you'll always be on your own loop.. :D
for nerds who want to avoid using their calculator: (97/100)^100 = 4.75525% (rounded since there was a 0 after the last digit)
thats awesome! A much better example to use with people
Imagine being the first inmate and not finding your number. “Oof, we tried”
for that case, just break the rule of communicating afterwards ASAP, everyone fails anyway
@Spectre The sadistic warden isn't smart enough to figure out the solution, and thus wouldn't know to do that.
I like to think that the people constructing the test purposely made no loops of >50, so that the prisoners could go free if they are intelligent enough to be worth returning to society (if they figure out the loop method then they will be given 100% chance)
@Ramu Roy yeah, I automatically assumed it from the original comment 😀
I like this warden. He has reasoned out that if he can turn all his prisoners into math wizards or at least willing to work together and trust one another, he can let them out.
Then you get something like Vento Aureo. Basically a group of criminal with a prodigy and are willing to work together
You know what’s funny? I’m interested in this and feel smarter after watching this even though I know that I will never be in a prison that requires math to escape
Unless you sign up for Squid Game, hoping to score yourself an easy $40 million.
We can change that Mr. Nelson
@MMeister i mean, it is helpful in the real world as well
yes because math is about having fun, not about applications in the real world as you probably were taught in school
When you factor in the odds of one nerd convincing 99 other convicts to go with this strategy, your chances quickly fall back to zero.
Why do I have a major problem with the phrase: “When you start with a box labeled with your number, you are GUARANTEED to be on the loop that includes your slip?”
If the boxes were labeled randomly, aren’t there ZERO guarantees?
And even if everyone follows the strategy, you can't have anyone mess up by accident.
especially when the nerd says "There's a 69% chance of failure"
😂😂😂😂😂😂😂😂😂😂
This is a life or death situation here buddy… not certain if my comment is relevant
The reason I love Destin so much is because of his mindset at 2:27 - Instead of being boggled and/or arguing, hes completely open to just learning the facts of what was just told to him with his simple 'Teach me' - many people could learn from Destins attitude in today's day and age; probably one of the main reasons hes in my top 3 of favorite youtube channels!
I understand they're friends and Veritasium is trying to throw Destin some viewers but I wonder if they ever flip the script. Where Destin is trying to solve one of his own puzzles and calls Veritasium so that he's the one saying "Ya I don't know the answer."
My actual concern if this ever somehow became a situation I got myself into is that someone would decide this is stupid and just pick boxes at random
_"that someone would decide this is stupid and just pick boxes at random"_
That's frequently a problem in real life. Not so much in the fabricated setup of the video. Persons with a strong determination are usually the ones which make the decisions, and not always they are very smart. Like this example from recent (and many others from less recent) history:
Smart mind says: "Don't go to war against xxx, IT WILL NOT WORK." Strong will says: "Of course it will, you're a coward and a traitor."
20 years later, it did not work. Strong will says: "Nobody could have known that, therefore it was the right decision at that time."
and what if you work with time, lets say some people are slower then others, they also say nothing about time!, lets say every number is a = minut, and the second person to move in only can go in if the other out. what if they make a plan, that the amount of minuts somebody is gone is equel to the box that contains there specifik number. and if they dont find it they need to wait exactly 102minuts. ( because its more then 100 boxes = 1 box a minute) by that way the poeple that are waiting only have to count everytime and remember only 50 numbers ( and they have really long time for that) if they know 50 numbers thats not there number or a little bit less) the chances of cracking this code will also improve by multi trillions? correct me if am wrong
My head is too small for this
The rules aren't clear enough. What if the ones who can't find their number don't leave the room. Like just the first. Time is the undefined equation here.
@Entropie - hmmm that is fantastic outside the box (😉) thinking! It’s a good idea if your life was on the line. I too would not only be trying to solve the riddle but also looking for ways to “cheat the house”. However, for this “ideal” riddle, we assume that the wardens have some way of negating that in order to practice the theory involved. But yes you are the kind of person I want on my team if I were ever in a situation like this- that was a great suggestion. 👍
Communication is inherently impossible in the scenario, so they couldn’t do that.
@Karperteam The rules do generally say that communication is forbidden, not just verbal communication.
Essentially this means any transfer of information between prisoners is forbidden no matter what medium is used to transfer the information, this includes subtle means like using time as well.
This helped me intuitively believe that this is plausible without doing a ton of math.
If all the prisoners decided to pick the same 50 boxes, there would be a 0% chance of success.
This simple example proves that you can change the probability of success with a strategy. It just so happens that the optimal strategy is incredibly elegant and yet challenging to work out.
The easiest way for me to understand this strategy is that when choosing boxes randomly, the prisoners as a group need to be lucky 100 times to win their freedom (each person basically come in with only 50/50 chances)
While with the loop strategy, the prisoners as a group only need to be lucky ONCE. That is because if the boxes arrangement doesn't produce a loop longer than 50, then they're all GUARANTEED to win. Therefore they only need to be lucky when the boxes were shuffled, and the probability of the arrangement they need come out of the shuffle is about 31%.
@Mitch Mabee It's because only having 2 prioners is a completely different scenario than having 100. Doing the strategy will remove the 2 possible ways the 2 prioners can chose their 1 box that we know will always fail, i.e. both opening 1 or both opening 2. Out of the two remaining, alternatives, there is a 50% chance since either both pick the correct box (1->1, 2->2) or both pick the wrong one (1->2, 2->1).
Where are you getting this 50/50 business. Remember the chances randomly had 31 zeros to the right of the decimal. That's stretching the definition of the word lucky a bit far.
@ocadioan Good observation, tbh I felt this to be more counterintuitive than with 100 prisoners before I read the second sentence :)
The interesting thing is that if you drop the number of prisoners to 2, the probability goes to 50% if you use this strategy, as opposed to 25% by choosing randomly. If both prisoners agree to pick either their own or the other's box, then both ensure that they don't accidentally pick the same box, meaning that if the correct number is in the box they chose, they both find it, while if the wrong number is in the box, neither of them finds it.
I think the chance of convincing 99 other prisoners that this strategy is their best chance of survival is much lower than 31%.
Tell them it is the chance that we all win .If you use 4 instead of 100. The probability of having 1 or 2 loops so that you win is (11223344, 11223443, 11243342, 14223341, 11233244, 13223144, 12213344, 12213443, 13243142, 14233241) out of 4!. That's 10/24 and much higher than 0.5^4
That chance of survival in this strategy is for one prisoner!🤣
..."got it?" Now don't mess it up...
I was think the exact same 😂
Yup. The douchiness is strong in a corrections system sample set.
I could see a variation of this coming up in a sequel to Squid Game. People formed into four groups of 110 players each, each group having the choice of four different box rooms to choose from, and a single player option to stop after opening 49 boxes to report back to your group, but die for choosing that option. First few players know their job is like a soldier, to find out if a room likely has a loop of 50 or over, and if they make it to 49 they have to come back, report such, then die, along with anybody who had already made it through that room, but then the remaining members of that group knowing that they should then try try going through another door and room, say door number 2 to work through the boxes in that room instead, hoping it will be a room without any 50 or more loops. One group, minus a couple of early players who made through and also minus the third one who made it to 49 and choose to report and die, the rest of that entire group then makes it through door number 2 and box room number 2 using the loop strategy. Of course that's our group with most of our favorite Squid Game players. The 2nd group, mainly of just bullies and idiots, all just die by one by one trying to go through one door and randomly choosing boxes. The third group, well there was somebody smart enough to come up with the loop strategy only they had some feisty types in their group that just didn't believe in all that liberal scientific mathematical mumbo jumbo, so it wasn't until after they had fed 25 players into a room before a loop strategy believer finally sacrificed themselves to report back to change rooms. The fourth group, properly choosing to use the loop strategy plus the the sacrifice to report to change rooms strategy, still loses a few more than they should have, because somebody or maybe a couple of players early on got to their 49th box, but didn't want to report back to the group then die, so took their chances and opened a 50th box, died for it, but then leaving the larger group uninformed to change rooms until they had lost a few more players before somebody actually sacrificed themselves to report back that they had made it to 49 boxes and advising the rest to try another room. Anybody making it through an abandoned door and room are, or were, of course all doomed, because it's only when however many people in a group ALL make it though one of the four rooms to choose from, without anybody of them having to open 50 or more boxes in order to find their number. Yep, sounds like a Squid Game episode to me.
Super interesting and logical.
What I love is that it shows us to work together rather than individually and that is where we have to link our sciences to philosophy and remember that sciences are merely observations put on paper.
I seriously admire the mind that thought up this strategy.
Exactly, this is the problem with modern science. For example, instead of having 10 single biological or medical studies with 10 people each, why not have all 100 people participate in 10 studies simultaneously? The main benefit is not that this would greatly improve sample size, but rather that it would better account for uncontrollable variables in biology, which should be done differently than in physics or chemistry, but unfortunately misguided scientists use the same methods of variable control for biology and psychology as for physics and chemistry.
This seems very much like when you shuffle a deck up for a round of solitaire. There is a certain percentage of hands in which it is impossible to finish, due to the cards that end up in the piles.
ikr
4:44 That visual is what really helped me understand this. I'd heard of this riddle before, but I never knew WHY there was such a significant chance of not having any loops longer than 50.
It's because a box can only be in one loop. If there's a loop of 5 boxes, the maximum size that any other loop can be is 95, since 5 have been excluded from the pool. (Loop, pooL, coincidence?) If there's another loop of 30 boxes, the new maximum is 65, and all it would take is a loop of 15 or a few smaller loops that add up to that, and boom! Guaranteed success!
Maybe I'm not smart enough to be baffled by the math, but I actually find this really easy to grasp.
Memorizing this just in case I'm ever trapped in a prison with a sadistic mathematical prison warden
Don’t worry, Batman beats villains like this warden every Tuesday
There is no need to memorize anything here
Memorizing in case I interview at Google
You mean sadtistics? ;)
Hek yeah
Congratulations for making this video. I can't stop thinking about it. I read the paper by Anna and Peter, but they didn't make it any easier to comprehend the probability distribution, and how the closed systems increase the odds substantially. I'll have to dive deeper into this... Thank you (seriously) for having cause a "glitch" in my brain! 👊🏻😃👍🏻
I think one way to grasp why this works is to imagine there are several short loops in the set up. If prisoners pick an initial number randomly, but then follow the same strategy, many of them will waste their choices by following a loop which doesn't contain their number. Conversely, by starting with their own number (even though, as explained, it can be an arbitrarily assigned number), they are guaranteeing that they are following a loop which contains their number. Thereby avoiding short loops which don't. Really great puzzle!
There is an easier way to think about it. If you use the loop strategy, you make sure all 100 fit in the same family of loops, taking out of the equation the randomness of each prisoner selection and limiting the possible combinations between each prisoner selection of boxes.
I am terrible at math but this made intuitive sense to me as someone who has had to track down mixups in conference badges/materials where putting the wrong persons stuff into someone else’s envelope sets off a chain of mistakes and this is how we would trace it back
These math and science videos are surprisingly fun to watch. Just completely different than in class.
Interesting corollary: If prisoner #1 (or any other prisoner) finds that his own loop has a length of exactly 50, he immediately knows there's a 100% chance of success.
@Urs Utzinger It can't. You always find your number in the last box of the loop, hence you know the length of the loop.
@Ersin Basaran Wait. If the people in general have a 31% chance of survival, but after the first prisoner goes there is a 32%+ chance of survival, then the chance that the first prisoner fucks it up is ~1%. So while the prisoner technically has 50% chance of finding his number, the chance that he ALONE fucks it up and no one else, is merely 1%.
Nice catch! So, you could phrase this riddle in an even more confusing way. The setting remains the same as in the video, then you state the following scenario: "The inmates come up with a strategy, the first prisoner indeed finds his number and additionally knows for sure that they all will be free. How is that possible?" Good luck figuring out this solution!
@HomerOJSimpson there can be more than 2 loops. The 31 percent chance is the chance that NONE of the loops are longer than 50
@Richard Jacques Why are you telling me what I already know?
If you start with the box that has your number on it, the only way to conclude the loop is to find the box with your slip in it that points back to the box you started on. It makes sense. Its just a matter of how many boxes you have to go through to get there
Another way to look at how you know you'll always be on the loop that contains your number is to realize that there is no way to stop a sequence other than at the box you started.
13 -> 42 -> 17 ...
Using prisoner 13 for example: box 17 (or any other box) can't have the slip that points to box 42, because box 13 had the slip that pointed to box 42. And so on for box 17 and any subsequent boxes. Meaning you'll never go back to a box you've already encountered the slip for. Also the sequence can't go on forever seeing how there are a finite number of boxes/slips. Therefore, all that remains is to eventually encounter the box with the slip to box 13.
For me, this was a clearer way to think about it than the explanation at 11:10.
I want to point out that this is by extension a cool analogy to quantum mechanics and how quantum computers work, especially entanglement. If you go in and give each prisoner a 50% chance at random, you have no idea what the outcome of said prisoner will be. But if you have all of them follow this strategy, you effectively 'entangle them', where entanglement of qubits is merely just having the qubits enter a statistical dependence on each other, so after measurement, you know with absolute certainty that all prisoners either failed or succeeded
OwO 😊😏😩😫 UwU 😚😍🥰😜 Eww 🤮🤢💩😷 I 😃 love
Also for those who are wondering where did we got the extra success chance imagine a scenario like this: If you haven't made a strategy before hand you have this "certain failure" scenarios. Think 4 people 4 boxes 2 chances. If they didn't talked beforehand there is a possibility that all people will choose box 1 and box 2 which is a certain failures since 2 boxes cant have the numbers of all 4 people. If you talk beforehand you set a certain path for everyone that eliminates this kind of possibilities. This is what raises the chances of success.
The reason that it is above 30% all the time is because you can always open half of the boxes. When there is more boxes, one box is a smaller percentage of the entire whole amount of boxes. So a smaller percentage of the whole is able to make the loop above half of the boxes, making them get executed.
If you think the riddle is hard, imagine trying to convince 99 fellow prisoners to follow the plan to the letter.
Firstly it’s child , plural of child is children
Secondly if Martin has a driving license , he should drive far far away from riddle land
Thirdly why are they in a restaurant ?
Fourthly who’s looking after the ‘childs’ ? And are social services aware ?
And finally , I’ve always wondered how long a reply could be
Or even just to understand the plan let alone follow it
They could be convinced if they're military prisoners of war and a high ranking officer tells them to follow the strategy.
@Casey Darrah Sure, but only once you believe those are the options. They're already desperate to survive, but you need 99 prisoners to run the analysis in their head, and for 100% of them to "get it".
"Follow this strategy or you and all of us get the gas chamber" seems pretty persuasive.
I believe this because my teachers used this tactic to separate groups in college so we wouldn’t divide by friend groups. Problbailty-wise it was only about 1/3 of the time that we ended up separating perfectly 2/3s of the time she would have to reconfigure because someone would end up left out or a loop would be messed up.
Brilliant! This is highly reminiscent of the mathematics of Clock Solitaire (which I wrote about over 40 years ago in Mathematics Magazine, Jan. 1982 issue). Well, thank you so much for this, so much better than I envisioned way back then!
i remember learning about those permutations, factorials, and stuff on out probability and statistics class during 8th grade and it was not fun, but this was actually very interesting
An interesting twist to this problem would be that if you are able to find your number, you are allowed to keep open a box of your choice, so that the next person can see that box contents. What then is the strategy with the highest probability of being able to escape.
@Milosz Forman yeah it's just like numbering any 50 boxes by the first prisoner. Now he has 50% chance and all others have a 100% chance
@Entropie -
The possibility to give some information to the following prisoner essentially renders the "loop strategy" worthless, as there now is a trivial solution achieving 50% success rate. They all open either boxes 1 to 50, or 51 to 100. If the predecessor left open a box with an uneven number, this means that the following prisoner will find his number in boxes 1 to 50, and vice versa. One bit of information is sufficient. However, it can't get better than 50% due to the risk of the first man.
I would argue a good strategy would be to keep exploring different loops after finding your number and ultimately open a box from a loop that you did not manage to close.
Additionally if the prisoners go into the room in order of their numbers your exploration should only focus on boxes > your number so whenever you loop to a box < your number you ignore that one in the exploration phase and seek out another loop to explore instead.
Of course already opened boxes will be used in order to just save on box openings, whenever a slip points to an open box you can just skip over it in the loop.
There is a special case where your number is already revealed upon entering the room, in this case you go into exploration immediately.
My reasoning is that opening a box of a loop that you could close is pretty much pointless since the loop was already save so the added information for the next prisoner makes no difference. Furthermore since the prisoners before you already explored all the loops that contained a number < your number there is no point in opening boxes for those loops, if they were deadly a previous prisoners already failed anyways.
Therefore the only loops that matter are those that are different from your own, consist only of numbers > your number and are deadly, opening a box on such a loop will decrease the effective length of the loop by 1. If the prisoners manage to use this to bring the loop under length 51 before a prisoner hits it, it will turn a loss into a win.
Arguably the benefit is not going to be huge since it will for the most part rely on the big loop not being "too big" otherwise it would be fairly unlikely for enough prisoners to dodge it and get to reduce it under 51.
I found that the underlying concept here is easiest to understand in a simplified example, with for example two prisoners and two boxes, and each is only allowed to open one box. If they both open one box randomly, the chance of them both finding their number is 1/2 x 1/2 = 1/4, or 25%. The other 75% of the time they either both miss, or only one gets their box correct. However, if they both agree to open different boxes, they either both get their number or both miss, with probability 50%, (i.e. depending on whether the first prisoner chooses correctly). By conditioning the second prisoner's outcome on the first, you're essentially consolidating the original probability distribution into a higher variance one with fewer options, where either everyone gets it wrong, or everyone gets it right, with nothing in between. In the context of the original problem, since all 100 have to get their box correct, every other outcome is meaningless, so the loop strategy is the optimal one.
As someone that went to prison, I can tell you with 100% confidence, that they got more chances to win by randomly picking boxes (one in 8*1^32), than 100 of them to agree to ANY strategy.
It's true, I remember being the first one to go through the boxes, and after the 49th I thought I was dead but The 50th was my number. He saved our lives, and we will be eternally grateful., ,
That is one in 8 which is 12.5%.
@Aaron I only found this video because I'm trying to understand how Michael knew how to save us all that day. I'm so glad he wasn't shanked with a sharpened toothbrush that one time he took two servings on cous cous Friday, leaving none for one-eyed Emine.
@Aaron Kerrigan
Yeah, I acknowledged the somewhere in the comments. But I'm necer editing my comments - an old prison habit. 😛
Trust me, even if the leader orders them to do something, many of them would do the opposite if the leader has no way to know that they disobeyed. And he wouldn't have a way to know.
Okay, so without watching this, this is my try and solving it.
The tactic we will stick with is: Each person with stay in the room a minimum of 10 minutes. Within that ten minutes they will open 50 boxes. But the boxes they open will be either boxes 1-50 or 51 -100. Effectively cutting the room into two sides, side A (boxes 1-50) and side B (boxes 51-100)
The first prisoner will walk in and, start opening boxes from side A, and PRAY they find their number. While opening those boxes they will also be keeping an eye out for the number of the person behind them. So one will look for two, two will look for three, and so on.
If you see the number of the person behind you while on side A of the room, leave the room at the 10 minute mark. That tells the next person they need to check side A.
IF you don’t see the next persons number on side A, stay in the room for 15 minutes. That tells them, check side B for their number.
EVERYONE by default will go to side A unless this *condition* is meet.
*Condition*: the person in front of you stayed in the room for 15 minutes.
That should solve it as long as each prisoner keeps track of how long the person in front of them was in the room.
Originally I thought of a way more complicated way to do this, a way that would let each prisoner know which box is theirs just by when the person in front of them leaves the room, but in the end I think this strategy would do the trick.
thanks for your content:-) your videos always are so interesting and entertaining, really making me think, thank you :D
At 5:40 you could reformulate it in a more intuitive / positive way. If a prisoner number is on a loop of size 50 or smaller all prisoners with the numbers of that loop also made it. In this case the other 49 prisoners "basically" dont need to check it anymore. This is very interesting riddle! Thanks for making the video.
i wrote this in bash, i thought there was something wrong with the randomness of shuf because either everyone won, or the first or second prisoner always failed, until i heard your "fail hard or succeed completely" explanation. it works. shuf is fit for purpose.
This loop strategy is used as a solving method for 3x3 Rubik's cube blindfolded. The simplest method is called Old Pochmann and as long as you can memorize letters and don't mess up the execution, you can solve a Rubik's cube blindfolded
Thanks for teaching me.
Exactly what I would expect from someone called SmarterEveryDay. Good boy.
That sentence was so powerful.
Now we know magic doesn't exist :P
(Including miracles eheheheh)
It's basically how many permutations on n letters has order > n/2. The cycle lengths aren't independent since each form a cyclic subgroup of Sn and is bounded by lagrange theorem
Awesome video. I feel like this should be added tho…for the sympathetic warden to guarantee success with one swap, he would have to know he was swapping 2 from the >51 loop. If it’s swapping two random numbers, then in doesn’t automatically work.
But thanks for this. It’s incredible!
The word "random" is never used. He says "just two boxes" not "just two random boxes". Quite a few have interpreted it this way though which is interesting.
My big family did name-drawing at Christmas to pick who we'd each buy for, and my older physicist brother woukd map out all the closed loops. So this makes great sense to me!
I don’t know if the way I’m thinking about this is fundamentally wrong or just bizarre but in my understanding, this is definitely making sense to me.
I feel like I just finished watching a movie with an actual plot.
What is the movie name?
This comment deserves more likes
Yeah!
I would not have thought about how the number assignment represented a function and that we can apply different cyclic theorems for finite functions, absolutely clever
you've got to admire these mathematicians for thinking out of the box
POV: YKW
@Pluto : With all do respect for your opinion, my opinion is that gender studies don't solve any problems but rather create new ones. But I won't be posting this on a video about gender studies because it would be rather disrespectful. If you don't enjoy maths, no problem, just don't watch video's on the subject matter.
@Gamina Wulfsdottir Slipping could save your life in some situations though.
The danger of thinking outside of the box is that you might slip.
ba dum tss
This is so amazing. I just cannot believe it. I know it is true but it is unbelievable! Thank you so much for sharing this with us.
Now here's the next question... what at the odds if each individual prisoner can communicate back the slips/box numbers as they find them to the rest of the prisoners? Assuming someone with a masters or better in mathematics is in prison for some reason.. like microwaving their ex girlfriend's cat to death.
Thanks for the video, so simple but yet so interesting.
I also thought on reaching our number first since it is 50% to be there, but didn't think on loops!
This problem feels really similar to how computers reduce the order to process data with a structure called Ring Buffers, the idea is to have a structure that moves data quickly, redo logs buffers are fast for this reason. Having a structure sorted vs random is always O(1).
So If we change the condition from 50% reading the boxes to 100%, and we change the goal to find THE fastest way to find his number, will be something interesting to check.
If by fastest you mean reducing the average time it takes for all prisoners to find their number strategy does not matter at all, the average always is 50.5 boxes per prisoner.
The strategy in this only matters because the requirement is specifically that all prisoners have to fulfill a condition simultaneously any question that can be answered by only looking at individual prisoners will not depend on a given strategy.
To better understand what he said about the probabilities being connected, just think of if there are only 2 prisoners that can only open 1 of 2 boxes. While no matter what each individual prisoner only has a 50% chance, it they both pick the same box there will always be one who wins and one who loses, because that one box can only have one of their numbers. So collectively they will always lose.
Now if instead they just each decide to pick their own box, each individually still has a 50% chance, but now they will either both win 50% of the time or both lose 50% of the time, because it removes the chance of them overlapping.
6:35 I like that Derek's "random" numbers were all odd numbers. We have a bias towards perceiving odd numbers as more random than even numbers. Even more so, of the 9 digits in these numbers, only a single one was even.
@John Hunter Damn it. You're right.
I argue that the fact that 2 is both an even number and a prime makes it the most odd natural number.
@Hazy.GG except 2
@John Hunter Yes but the best numbers, the Prime numbers, come from the Odd set.
Really this is an example of people using the word "random" when they actually mean "arbitrary".
this is a random thing but i notice usually when asked for a random number, if they do use an even number people usually say something in its sixties
I think I've used this strategy before without realizing it. I don't remember why or how I came up with the idea, but I remember using loops to find a random number.
I have never seen this riddle, but I myself was thinking about number loops starting with the box matching the prisoner's number, before even reaching to that section of the video.
I'm not a mathematician or anything, but I thought that because it sounded the most logical, and I've heard of looped numbers before
After learning the solution its pretty intuitive for me to understand it.
Sure, the INDIVIDUAL probability of finding your paper is still 50 percent...
But the net probability is NO LONGER based on multiplying all these different probabilities together, because they are no longer INDEPENDEDNT probabilities.
Instead the probability of the GROUP succeeding is the probability that none of the loops are longer than 50. Which is pretty easy to see how thats a pretty decent odds.
If the first loop turns out to be, say, 10 in length, then the next person not in that loop has 50 tries out of 90 to find their number. If their loop lasts 30, then the next loop has a 50/60 chance of being valid. And the moment the winning loops total more than 50 in length, you know everyone else wins as well.
I got the answer in less than an hour. Never seen or heard of this math problem until today. Intuitive once you grasp that you require a strategy that uses as much information as possible while minimizing randomness.
At first, I was thinking that the first two prisoners could try their luck at getting their number. The plan would be that Prisoner Number One and Prisoner Number Two (relying on them, if they don't find their number, the rest are screwed) would look from the entrance of the room, and would turn the boxes that contained an Odd number inside right side up (again, looking from the entrance of the room), and boxes that contained an Even number upside down.
Prisoner One would pick through 50 boxes, turning the boxes accordingly. Once they find their number, they are to finish flipping the boxes, and then leave once they are done. (If this wasn't allowed, I would say it is up to Prisoner #2 to finish). If Prisoner #1 is able to find their number, as well as flip 50 boxes, and Prisoner #2 would have to flip the rest of them as well, then the rest of the prisoners would have a 100% chance of finding their number, if they can remember the box turning rule. Odd= RIght Side up, Even = Upside down. An easy way to remember this is by counting the number of letters in Right Side Up and Upside Down, as the first has an Odd amount of letters, and the latter has an even amount.
Again, this all depends on Prisoner #1 and #2. If they are both able to successfully pick their number from their 50 boxes, and be able to switch them accordingly, it guarantees 100% success. Once Prisoner #3 comes in (depending if #1 and #2 screwed things up or not), they should be able to pick the boxes that are right side up and find their number within 50 tries. If they, #1 and #2 are not able to find their number, then they are all dead.
This does depends if turning the boxes betrays the rule (which I am sure it does), but this is what I came up with.
This was written at minute 2:45 in the video. Gonna see what the vid comes up with now.
I have finished the video, and here is my thoughts.
Using the Loop strategy would probably be the same outcome as my strategy. Basing on either my first 2 prisoners, or the % of weather the loops are under 51 numbers, either your test or my test should be able to possibly get their own number and escape, or lose trying.
This is actually, in my opinion, the least controversial thing he has posted in a while. Good work. This makes alot of sense to me, I would never have thought of it but it works
@ILYES The Monty Hall problem is just maths and is pretty controversial too. I remember everyone going crazy in the comments after that Numberphile video
@ILYES spoken like someone who knows nothing about math
Correct! The beauty of math is that there cannot be controversial things. Math and logic are the final judges, deciding which is right and which is wrong. If you read carefully the comments, no one is questioning the strategy, they simply complain they cannot understand it.
@magica that’s a pessimistic view.
A lot. Two separate words.
Idk if I've seen this, but I feel like if they start with their number, followed the number on the slip in the box and repeat, they'll have a better chance of running across their number.
Full disclosure, I vaguely remember watching something similar to this a while ago, so I didn't figure it out if I'm right, I remembered it. There's a difference.
Would be interesting to see the percentage chance if we assumed the loop would be greater than 50, for instance picking any random number and following that until you either get a closed loop, or the right loop, how much different or lower it'd be than the 30.7% chance.
Suppose there is a 51-loop and everyone picks his first box at random, and then follows the loop. So the 49 prisoners who don't have their numbers on this long loop will fail with a probability of 51/100 each, bringing the total probability that they all find their number to a meagre 0.51^49 = 4.7E-15. And the other ones might fail as well. So we won't get even near to these 30.7% chance of the consequent loop strategy.
The truly sadistic warden would show the prisoners this video. Let them watch it (together) as many times as they want, discuss it as much as needed to ensure they understand what to do, and then label the boxes in binary numbers.
You are guaranteed to go to the box containing your number in it by starting with the box that has the number on it using that strategy because the loop will never end since it has to end with the box you started with but that just means you will have to find that number in the box right before which contains your number.
I remember this riddle from a Ted Ed riddle I’ve seen before, and I think I got it right actually! It’s a really cool problem
Imagine coming up with this massively smart idea and still only having 31% chance not to get executed.
@Roskal Raskal they are gonna die either way. It's not possible. Their best strategy is to find a way to not even get in this deal. I have had 50% chances and still lose consecutive times. Just do head and tails, do it until you fail. You won't get far even with 50%.
@Ducky Momo Exactly. If every prisoner gets to open 99 boxes, then the purely random strategy succeeds with 37%, while the loop strategy succeeds with 99%.
the limit of 50 is arbitrary. if you increase that it goes closer to 1 and if you decrease that, it goes closer to 0
@IHateUniqueUsernames Framing effect. lol
@L.F. M. For each person who opens 50 random boxes vs uses the strategy, the chance of succeeding goes down by a half. If one person decides to open randomly, you'll all have a half of 30% chance of success, or 15%. If there are two, then half of that, so about 7%. If 10 I would think 31% * (1/256), or a fraction of one percent. Having a few people be idiots doesn't totally ruin your chances, but much more than 10 and you're better off trying to win the lottery.
It's weird how this method would be worse for a single person, then simply guessing, yet it works better as a group. It's honestly interesting how this works and makes me wonder what kind of stuff can be done with this.
@miloszforman6270 your absolutely right. Soon as I read it, I remembered the video saying that. I had that 30% stuck in my head and stopped thinking. Lol. Thanks for pointing that out
It's not worse for a single person - the chance to find one's number is still 50% as is clearly pointed out in the video. This is due to the fact that in most cases there are also short loops even if there is one long loop, so some prisoners will succeed to find their number (but lose the game anyway). The average size of the longest loop is 62.433 = 62.433%*100, where 62.433...% is called the "Golomb-Dickman constant" which someone has calculated to a few thousand decimal places.
To be precise, the GD constant is only the limit value for very long permutations, so the exact value for the average size of the longest loop might differ slightly for permutations of length n=100 as in the current case. The numerical calculation yields 62.744 for n=100. I got an average size of 62.83 in a simulation of 10000 random 100-permutations. I did not so far find a formula which gives a useful approximation for the deviation from the limit as a function of the length of the permutations. Certainly there is one - if someone knows it he is invited to state it here.
Haven’t got time to read all the comment, so maybe this has already been mentioned, but interestingly this loop strategy was used by Turing during his efforts to decode the enigma machines. He made loops of letter presses to ascertain some properties of the wheels.
He didn't solve that by the 3 loops (or how many there were, pretty sure 3).
Turing was solved because he made muddled up words coherent.
IF it were only using this technique, then he would have found many possibilities of incoherent nonsense.
He had more clues, as he actually had the paragraph of writing that he was trying to decipher.
So when his looping patterns yielded no coherent words, he quickly moved on.
The prisoners can't do that here.
This reminds me of a game we played in high school, that we called "Gotcha" (it had other names as well). For the younger folks here, this was before kids carried cell phones to school.
It was usually about 15 to 20 of us playing. One person would run the game and not play. That person (the "DM") would create a loop and give each player a piece of paper with the name of the next person on it. The object was to find that person and say "Gotcha" at which point they were out of the game. They would give you the paper of the person they were hunting and you then sought out that person. You would win when the paper you were given had your name on it.
Papers were handed out near the end of a school day, and the game would start the next day at school. I won once when the person with my name on her paper stayed home sick on the first day of a new game. Nobody got me but I was able work my way through everyone else until I got to her name. The following morning I got her stepping off the school bus.
Fun times!
The reason I found this video was a similar problem: the key differences were that the ‘boxes’ were like bingo numbers and they would be replaced each day and that they stated there was a ‘certainty’ that all prisoners would go free.
Imagine being prisoner 1 and your loop is exactly 50 boxes long. You know for a fact you win
Alternative explanation for why you're guaranteed to be on the same loop as your number: Keep in mind each slip only exists once. If you start at the box labeled with your number and follow the loop, the only way you could NOT eventually find your number is if you come across a slip pointing you to a box you've already opened, which of course leads you on the same path you've already been on, trapping you in an infinite sub-loop. But that is impossible, because that box you would be pointed back to was already pointed to by the slip you found just before that, and you can't find that same slip again. The only way you'll be pointed back to a box you already opened is that it's the box you started with, because you went to that one without having found the slip that points to it yet.
@Charlie Davies Huh, your number is only guaranteed to be on the loop you start with if you start with your number. Let's say you are number 1 and you start with box #2. Box #2 is on a loop of 30 that does not include slip #1. Now you have wasted 30 picks and if you restart with #1 you have to hope that loop is less than 21.
@Cifirjwbducuf Yes, you need to find your slip number. If you start with your box number, you have to be on the correct loop, otherwise it would not be a loop. You just have to hope there is not a loop longer than 50. If there is a loop of 51, 51 prisoners will not find their slips in 50 chances (if they follow the strategy.) If the longest loop is 50 or less they will all find their number.
@serhan cinar How Prisoner54 ended up opening box 36 if there's only one box containing slip 36 (box 45)? It's impossible
@serhan cinar Well, he was supposed to open the box labeled with his own number, 54... That's part of the whole strategy. If he doesn't do that, then yeah, there's no guarantee for him to be on the correct loop.^^'
Let's say Prisoner54 opens box 36 contains slip 45, then opens container 45 which contains slip 36... Prisoner54 is out of the loop. How come he is guaranteed to be on the loop?
I was thinking about this and it really only works if the boxes/papers aren't jumbled at random. Because if it was random you'd have a chance that a box ends up with the correct slip in it which would break your loop strategy
You've described a 1-loop which is perfectly OK as you'd find your slip on the first try. See @4:15
Has this experiment been tried with real people and real choices?? I would love to take part with 99 other people both doing random choices and using the method explained. It wouldn’t be that hard to setup online and have people log into a “group of 100” and do either a random choice or a planned strategy. It would be really cool. 😃
In the referenced video by Matt Parker he does a real live experiment with a reduced amount of boxes.
That's an amazing video! Visualizations are very on spot, explaining complex concepts in a simple way.
One thing that I missed is maybe a brief note of any this strategy is the best one? Why can't anyone come up with a better one?
This is covered in the paper by Warshauer/Curtin which is mentioned in the introductory text. This paper ("The Locker Puzzle") is avaible on the server of the University of Cambridge. Don't use the Springer/v. Holtzbrinck link, they charge money. There is a short outline of this proof in my answer to @BOB from a day ago.
Props to whoever animated all these.
I hope they aren't struggling financially like I am. :)
Hang on, the part at 12:40 about swapping two random boxes to break a loop must be wrong. As maybe your random swap created a long loop from two smaller ones. Or you made a really long loop into a tiny loop and a slightly less long loop.
To illustrate the second case: if box B1 contains number N2, B2 contains N3 ... Up to B100 contains N1, if you randomly swap B3 and B4 then you end up with B3=N5 and B4=N4. Meaning you went from a 100 loop to a 99 loop plus a 'single' loop.
Or am I missing something?
@nothing to see here Consider length 1 loops. If you have books 1 with slip 1 then after adding to it the slip leads to another loop and the length is >1. If all loops were length 1 before adding a number
@josephsaltich correct the loop is still the loop if you add 5 all you do is change the starting point and effective made a new loop parallel to the old one in some way, however if the prisoners were to assign random unique numbers to the box and then follow the loop it will work but all prisoners would have to have talked about that before hand which is not really possible to remember but yeah the strategy of adding some constant value won’t work
a friend of mine claims it actually works. you're prisoner nr 1 and open your own box. now except for the letter showing nr 96*, you just add 5 to the written number and go to that box and so on. and this will actually bring you to a new loop system which is obviously likelier to be not loop length 100 anymore. (i think since parallel shifts work only in ordered paths, odds of adding 5 not going to change the loop structure are about 0.)
*in that case i assume it is ok to jump the already visited boxes (/leave them uncounted) without leaving the new generated loop. but not sure.
your english is very fine, it's my second language, too and i understand you perfectly. dont hesitate to ask about or critisise my language, too tho :)
@Al ias 808 you are right, this process would change the loops completely but disregards the fact that you have to reach your own number and not your number + 5. I still think the loop strategy would be better than just choosing randomly, but to calculate the chances of getting your own number one would have to measure the possibility that a random number is in your loop taking into account the length of loops, also that once you end a loop you can start a new one with your left attempts (or more than one, also one would probably end in the middle of a loop), and also add the possibility that if the loop is longer than 50, the number might be at any point of the loop. Sorry if something is misspelled or not understandable, English is my second language.
Has this been tested in real life? Would be cool to see an actual representation of this.
@Brian Larsen yeah it could be morally troubling....or ya know...instead of with prisoners fighting for freedom it could be 100 random volunteers with no consequences for failure.
I think I have a simple way to test this in real life. Make a 100 page document with 1 number 1-100 on each page. Shuffle the paper, turn it over and print again with a different color ink (just so you can not confuse box # with slip #. Lay them all black ink up and run through your test. You would only need 5 or 6 six-foot tables to lay the sheets on, 3 in a row with an aisle between. Once you printed both sides your loops would be set, it would not matter whether you shuffled them again or which order they were displayed, numerically would just speed up the process.
New Mr. Beast video incoming
checkout this javascript code
// prision problem from the array lets see whats the outcome
function shuffled_array(length) {
let box = [];
for (let i = 1; i
Sounds like a job for Vsauce
Is there a way to improve the odds off success even more? Instead of having the prisoner that finds their number in the loop to stop, what if that prisoner were to continue to open random boxes until they reach their 50 limit. Then the next prisoner do the same and so forth. Would that not improved their odds a little more, even if it is minute. Any improvement in the odds is a better answer, right? Help me with the math.
I can't see how opening further boxes could change the odds at all. According to the rules, the boxes have to be closed before the next prisoner enters. On the other hand, if you allow them to leave the boxes open, this would raise the chances of all to survive to 50%, but that's quite trivial a calculation (only the first one has a 50% chance, all others have a 100% chance to find their number).
This would be a good strategy for a escape room, with a clue that points to choosing the Box number that correlates the slip number.
I gave this puzzle to my kids when they were little, so it must be fairly old by now. Interesting fact not mentioned in the video (and it should have been!) is that there is no better strategy in this setting! In other words, it's been proven that the loop strategy is optimal and there's no better one. For more on this and similar, go get a BS in Computer Science and student Discrete Math. :)
How little? Clearly you didn't have them in public schools? Congratulations on raising them as thinkers!
@Alcazar123 There's a difference between "this is the best strategy we currently know" and "it is proven that there is no better strategy than this one."
It’s obviously implied that there is no better strategy. If there was, the video would be about that strategy and not this one.
_"Interesting fact not mentioned in the video (and it should have been!) is that there is no better strategy in this setting!"_
Yes, it should have been mentioned. This fact is covered in the paper by Warshauer and Curtin which is referenced in the introductory text. Few people read this introduction, and the introduction itself does not mention the optimality. It's a question that was frequently asked and discussed in this comment section.
Everything makes sense. An individual’s searching (A) is a different event than whole group’s loop searching (B) by definition. If event B results from INDEPENDNETLY repeating event A, then multiplying 100 times P(A) to get P(B) is correct. But with the looping strategy, event (A)s are highly CORRELATED with each other. In fact, for all prisoners on the same loop, the correlation is 100% (they all succeed or fail), so they only count as one event A, not as an independent series of them!
Other strategies may be devised and demonstrate different correlations. Whenever one prisoner's result is somehow bundled with that of another prisoner, the correlation is no longer 0, and P(B) will no longer be P(A)**100. For example, if all prisoners plan to open just the first 50 boxes, they are somehow bundled together, and P(B) is 0.
Thanks for the reply @J Hutt
Thank you. It now makes perfect sense.
I couldn't wrap my head around how this could logically work.
But of course since everyone starts at different fixed number, it turns the system from randomized lottery into a systematic search through all different possibilities. It removes the random redundancies from each persons search and thus result in massive increase in efficiency.
I am 22 and in college. I hate math and always had trouble with it, but this video made me excited about math. And that’s saying a LOT
That's amazing. Why would you hate math?
It would be awesome to someone like Mr. Beast actually do the experiment with people to show it being done.
Yeah 😂
We already know the outcome tho
@silverr_69 Don't underestimate the knowledge of Mr Beast.
Mr Beast wont understand it lol
To extrapolate this problem further, it’d be interesting to understand at what point prisoners would know they will not die. Like you said at the end, either you fail hard or succeed fully. From the P distribution curve, I’d day the minute 50th prisoner comes out successfully, the rest of them will be guaranteed to find their number, right? But that’s wrong as there could be a 99 number loop and a self contained loop, so one person could still fail. However with your probability distribution, there’s 0% chance that 99 prisoners will succeed and 1 will fail. (I know your graph is right, and it’s a way to visualise probability, just finding it intriguing :))
Yes, 50 prisoners exiting successfully to be sure, but the chances of 49 being successful when a 51-loop is present is miniscule. In the 51-loop case it's approximately a 50-50 chance that your individual number lies in the big loop or not, so the chance of 49 successes is about (1/2)^49. When just 7 prisoners have exited successfully there would only be a less than 1% chance that the room contained a big loop.
I have a theory for a 50% success for all prisoners, but it assumes one thing that is left out of the word problem. Each prisoner learns the number of the prisoner that will enter the room after them. Each prisoner is searching for BOTH numbers. The first prisoner looks at boxes 1-50. They have a 50% chance of finding their number. IF the the subsequent prisoner's number is in the 1-50 boxes, the prisoner exits the room and sits down (this assumes the prisoners see each other enter and leave the room). If the next prisoner's number is NOT in the group, they exit and remain standing. This would confirm with a 100% accuracy that each prisoner after the first would find their number. The only gamble is the first prisoner finding their number in the first 50 boxes.
But this involves transferring some information from the previous man to the one following him. That's a kind of communication which is not allowed by the rules. - But if you allow one bit of information, you get this simple 50% solution. So to compensate for this advantage, we may reduce the number of boxes which are to be opened, for example to only 40 boxes. It gets a bit complicated then. Any idea?
Great video ! But I’m missing the point at 9:41 : using the strategy, why would the individual probability for s.o. to find the right box be of 50% instead of 30% ? You may have opened half the boxes, but the underlying probability for them to have your number is not the same anymore because of the strategy you’re using, no ? Thanks if you can help !
The probability that someone finds his number is always 50%, independently of the strategy he uses. Could not be otherwise, as he is opening 50 boxes out of 100, and he has absolutely no information about their contents.
So his chance to lose the game is 68.82%, while he still finds his number with 50% probability. That means that there is a chance of 68.82% - 50% = 18.82% to find his number even if there is some long loop.
Indeed, such a long loop does in most cases not include _all_ boxes: The average size of a long loop - supposed there is one - is 50/0.6882 = 72.65 . So he has a 100% - 72.65% = 27.35% chance to find his number under the condition that there is a long loop ("conditional probability"). For the overall chance for this case we once again get 27.35%*68.82% = 18.82%.
Yeah when you started explaining I was like oh that's brilliant. I understood why it worked somewhat. I knew from the beginning that the strat had to make the probability no longer independent but I couldn't see the how
That's actually what we do with pointers in C/C++, OS, MMU... And if you factor in deadlines, the feeling of being a prisoner might become very realistic.
Interesting. Can you use this to predict "lead times" with some % of accuracy?
Writing a research paper and still telling the reader to figure it out for him or herself is peak professor energy.
It would be really awesome to see the original reviews of that paper (from when is was submitted to publication). I bet those reviewers were also beaming with professor energy 😂😂
@Rinnegone Happens sometimes. I'm guessing either they were removed individually, or the accounts have been poofed. 🤷♂️
Why are the replies gone?
Thanks so much, me and my fellow prisoners were all able to escape because of this video!
Decent way to think about this problem.
This particular strategy makes it a question of “is the room setup in a certain way”
Rather than
“Are all 100 prisoners gonna correctly guess where their number is?”
Because if you increase the number of prisoners by 10 times, but have them duplicates with the other original 100. The 2nd question’s probability would decrease, but the first would remain the same.
Theoretically, it might be possible to have a bunch of other strategies that would turn this from Question 2, to Question 1. But loops are probably one of the higher probability strategies.
All prisoners selecting the first 50 boxes is a strategy that makes it question 1, but it makes the answer a definitive 0% since it guarantees 50 prisoners find their number, and 50 prisoners don’t. Even though it’s still technically a 50/50 chance for each individual prisoner to find their number.
I want an escape room with this as the puzzle. That would be cool
Something I just thought of. (BEFORE @12 minute mark). The only way for there to be a "dead end loop" is if the pictures/numbers/letters are not each unique. Now, loops will still form and the loops that are formed are intersecting loops. The prisoners with the same number as each other will be more likely to find their numbers. However, the prisoners with the non-repeating numbers will have a slightly harder time finding their own numbers as (with just one doubled number) the odds of going down the correct "pathed loop" will be 50/50.
(If the warden was truly sadistic and cheating, he would put double numbers inside one of the boxes and not really at random either. Just barely enough of a big 3rd loop that prisoners wouldn't notice the repeat)
This would mean that 2 of the prisoners would also have the same number on their jumpsuit?
Or there would be an extra box.
Or there would be one prisoner who couldn’t find their number even if he checked all 100?
So it would be 100% impossible and ruins the thought experiment.
I'm writing an adventure novel in which the characters have to solve some riddles to get to the thing they're searching for.. I'm definitely using this in it!!
"You can only fail hard, or succeed completely"
This is the key insight, which actually generalizes to some other probability problems and puzzles beyond just this one! Basically, for every prisoner by themselves, regardless of whether you use the loop strategy or any other strategy, it's only 50%.
If every prisoner's 50% is random and independent from everyone else's, then you're doomed. But if you can concentrate their successes and failures together, then you have a shot. You want to pick a strategy where if one prisoner fails, it means that as many other prisoners as possible also fail, and when one prisoner succeeds, as many other prisoners as possible will also succeed. By overlapping their failures together and their successes together, even though no individual prisoner's chance has improved from 50% for their own individual success, they magnify their chance of getting a very extreme outcome collectively, in *either* direction.
The loop strategy does this very well. Consider the first prisoner - suppose they go into a room and find their slip after a cycle of length 38. Then they immediately know that 37 other prisoners are going to succeed. Or, suppose that they fail to find their box. Then they immediately know that they are in a cycle of length > 50, so they know for sure that at least 50 other prisoners are also going to fail. Every prisoner's 50% of success or failure are heavily overlapping with many other prisoner's 50% success or failure, so their chance to get an extreme outcome is vastly larger than if they were all independent. The overlap isn't perfect - some prisoners in a long cycle may fail to find their slip while those in a short cycle succeed. Those short-cycle successes on average wastes about 19% of each prisoner's 50% chance of individual success - so ultimately the final success chance that collectively overlaps between all the prisoners is about 31%.
To illustrate the point, we can consider a different simpler game - suppose we still have 100 boxes, but this time inside each box is a coin that is randomly 50-50 to be heads or tails. Suppose each prisoner only gets to look at a single box, and they collectively win only if every single one of them finds a box with a heads. Each prisoner's own individual success chance is 50%. If they all independently open different boxes, then as before their overall success chance is 1/2^100. However, if they all coordinate to open the *same* box, then they can overlap their individual successes and failures - either they all see a heads and win, or all see a tails and lose. In this simple game the overlap is perfect - every prisoner's own chance is still only 50% to find a heads, but all prisoners share the *same* 50% and so their collective chance is also 50%, rather than 1/2^100.
Period. for use in practical life choices at work lol
@Lord Talos Gaming At first sight that looks like a good argument, but the loop strategy goes far beyond that. Not only you're not going to waste attempts on boxes which contain a slip with their own number, but you're not going to waste attempts on any box which is not contained on the loop containing your number. On the other hand, you're also guaranteed that you will find your number only as the last element of the loop, so if your loop is longer than 50 you're doomed and have 0% chance of getting your number, while you would still have a chance to find it if you were to pick the boxes randomly. Thus it is not true that, as you suggested, using the loop strategy "makes no difference to individual chances" if there are no boxes with their own number.
Note that for a single person the chance of getting his number with the loop strategy is NOT the chance that there are no loops of length greater than 50, but it is the chance that HIS loop is not greater than 50. The latter is of course much larger than 31% (which is the chance of the former).
In the way I formulated the question, you could also calculate explicitly the probability of finding your number with the loop strategy and you can find it is 50%, as others already pointed out by euristic arguments. But here we can make actual calculations.
Let's say your number is 1 (without loss of generality), so you open box 1 and there's a 1/100 chance that the loop ends here, namely that box 1 contains number 1. In the other 99/100 cases, you will be redirected to another number n different from 1. From this number n you will have 1/99 chances to get the number 1 and thus have your loop be of length 2 (since you know the box n does not contain the number n, which is already contained in box 1), so the overall chance at the second step is 99/100*1/99=1/100. The third step is similar and you will have 1/98 chances to have you loop be of length 3, if you know its length is not 1 or 2, so the overall chance is 99/100*98/99*1/98=1/100. And so on, as one would expect, the length of the loop containing your number is a random variable uniformly distributed from 1 to 100 and the chance that it is 50 or less is just 50%.
@Carlos Ortega If the team is going to lose using the loop strategy, most of the players will lose and so you have at least a 51% chance of losing individually. Meaning: When you're losing, you probably know it. So if you individually win, you're probably not!
@Gamina Wulfsdottir by "fail hard", he means the majority of prisoners fail. There's no scenario where a majority of prisoners would pass with only a minority failing. Even if one prisoner fails, it automatically means the majority of prisoners will also fail.
Conversely, if a majority of players pass, all prisoners will consequently pass. There's no scope for close shaves.
Except that any prisoner who doesn't find their own number after 50 tries will know that they are all dead. I don't see how "You can only fail hard, or succeed completely" is any kind of a key insight. It's simply another way of saying "pass/fail".
i find that easier to understand than the problem with 3 doors where two of them have a goat behind it and one has a car.
But really well explained, loved the video!
The monty hall problem is wholly contingent on the “host” knowing which door contains which prizes. It only works if the host always reveals one of the donkeys instead of the car BASED ON prior knowledge.
If is NOT advantageous to switch if the host reveals a donkey “by accident.” Nor is it disadvantageous. At that point your odds remain the same.
The easiest way to consider the problem is to extrapolate. If a host knows that one out of 100 doors has a car (the rest being donkeys) and the host reveals 98 donkeys based on prior knowledge, it’s overwhelmingly obvious that you should switch.
@Howard the first way you propose doesn't sound logical, even though it is. The second sounds like it's different from the first. You're explaining it like everyone else explains it. The whole pool of this video to me is that he doesn't do just that, but he actually goes through and shows you why that works my drawing the whole thing out
@Joe Doe Here is another way to view the he MH problem -> focus on the fact that ONLY non-winning doors are eliminated.
At first each door has a 33% chance of being the best. When a losing door is removed (and that is what happens) your original odds are the same at 33%. But the remaining door now has a 66% chance of being the best.
If that doesn't seem intuitive start with 100 doors. Select one. Eliminate 98 other doors. All those 98 doors were of course non-winning doors.
Now, with just two doors, would it be wise to switch ?
@Kezwik The easiest way to understand why the Monty Hall problem works is to write out all the possibilities (there's not all that many) and see how many of them disappear when a door without the prize is opened. It makes it very clear very quickly
@Steve Ives no worries :)
We did such a process while studying probability and the I Ching. Didn’t know there was a riddle about it. Pretty cool. 👌