#### Am Vor Monat

The 100 Prisoners Riddle feels completely impossible even once you know the answer. This video is sponsored by Brilliant. The first 200 people to sign up via brilliant.org/veritasium get 20% off a yearly subscription.

Special thanks to Destin of Smarter Every Day ( ve42.co/SED ) , Toby of Tibees ( ve42.co/Tibees ) , and Jabril of Jabrils ( ve42.co/Jabrils ) for taking the time to think about this mind bending riddle.

Huge thanks to Luke West for building plots and for his help with the math.

Huge thanks to Dr. Eugene Curtin and Dr. Max Warshauer for their great article on the problem and taking the time to help us understand it: ve42.co/CurtinWarshauer

Thanks to Dr. John Baez for his help with finding alternate ways to do the calculations.

Thanks to Simon Pampena for his input and analysis.

Other 100 Prisoners Riddle videos:

minutephysics: www.youtube.com/watch?v=C5-I0...

Vsauce2: www.youtube.com/watch?v=kOnEE...

Stand-up Maths: www.youtube.com/watch?v=a1DUU...

TED-Ed: www.youtube.com/watch?v=vIdSt...

▀▀▀

References:

Original paper: Gál, A., & Miltersen, P.B. (2003). The Cell Probe Complexity of Succinct Data Structures. BRICS, Department of Computer Science, University of Aarhus. All rights reserved. - ve42.co/GalMiltersen

Winkler, P. (2006). Seven Puzzles You Think You Must Not Have Heard Correctly. - ve42.co/Winkler2006

The 100 Prisoners Problem - ve42.co/100PWiki

Golomb, S. & Gaal, P. (1998). On the Number of Permutations on n Objects with Greatest Cycle Length k. Advances in Applied Mathematics, 20(1), 98-107. - ve42.co/Golomb1998

Lamb, E. (2012). Puzzling Prisoners Presented to Promote North America's Only Museum of Math. Observations, Scientific American. - ve42.co/Lamb2012

Permutations - ve42.co/PermutationsWiki

Probability that a random permutation of n elements has a cycle of length k greater than n/2, Math SE. - ve42.co/BaezProbSE

Counting Cycle Structures in Sn, Math SE. - ve42.co/CountCyclesSE

What is the distribution of cycle lengths in derangements? In particular, expected longest cycle, Math SE. - ve42.co/JorikiSE

The Manim Community Developers. (2021). Manim - Mathematical Animation Framework (Version v0.13.1). - www.manim.community/

▀▀▀

Special thanks to Patreon supporters: RayJ Johnson, Brian Busbee, Jerome Barakos M.D., Amadeo Bee, Julian Lee, Inconcision, TTST, Balkrishna Heroor, Chris LaClair, Avi Yashchin, John H. Austin, Jr., OnlineBookClub.org, Matthew Gonzalez, Eric Sexton, john kiehl, Diffbot, Gnare, Dave Kircher, Burt Humburg, Blake Byers, Dumky, Evgeny Skvortsov, Meekay, Bill Linder, Paul Peijzel, Josh Hibschman, Timothy O’Brien, Mac Malkawi, Michael Schneider, jim buckmaster, Juan Benet, Ruslan Khroma, Robert Blum, Richard Sundvall, Lee Redden, Vincent, Stephen Wilcox, Marinus Kuivenhoven, Michael Krugman, Cy 'kkm' K'Nelson, Sam Lutfi, Ron Neal

▀▀▀

Written by Derek Muller and Emily Zhang

Filmed by Derek Muller and Petr Lebedev

Animation by Ivy Tello and Jesús Rascón

Edited by Trenton Oliver

Additional video/photos supplied by Getty Images

Music from Epidemic Sound and Jonny Hyman

Produced by Derek Muller, Petr Lebedev, and Emily Zhang

## KOMMENTARE

## pyguy

Something seems wrong at 9:00 What is the probability of a loop of length 1? (Can't be 1/1) Length 2?

Vor Monat## Pierre Chardaire

To find the probability that a loop of length p for a fixed p with p > n/2 you proceed like this: Select p values out of n, n chose p = n!(p!(n-p)!) ways to do so, then create a cycle of length p, (p-1)! ways to do so, then arrange the n-p values remaining, (n-p)! ways. So in total: n!/(p!(n-p)!)(p-1)!(p-p)! (call this A) to create a configuration with a cycle of length p. Divide A by n! to find probability to get 1/p. This work because we did not overcount configurations in calculating A If p is less than n/2, formula A would count several times any configuration that has more than one cycle of length p, of which there would be more and more as p decreases. So to get the actual probability of a cycle of length p (where p Note also that 1/(n+1)+1/(n+2)+....+1/(2n) converges to ln(2) = 0.69314718056. So whatever the value of n there is a probability of at least 30.6% that the convicts will be freed.

Vor 2 Tage## tejesh dahat

@John Smith you will always find your own number if you start with your number box since there are no duplicate number boxes and no duplicate numbers

Vor 9 Tage## tejesh dahat

@Arturas Liutkus since there are no duplicate numbers 1 number can only point to 1 box so if you start with your number box you will always be on the right loop

Vor 9 Tage## HassanAbshir

9:00 is sus

Vor 12 Tage## Kelon Waters

I think you’re confusing probability with possibly

Vor 13 Tage## Bismuth

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.

Vor Monat## strawberrteas

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

Vor 12 Tage## Crispy Barns

My guy didn’t even say the boxes were labeled in the text screen.

Vor 14 Tage## Saquib Akhtar

Wow..! mind blown again.

Vor 19 Tage## Szymon L

@Chance yeah thats what I also thought about

Vor Monat## Szymon L

@Jynx 2.8% for total randomness, but for people its not like this. Derek could not even see that, but his mind for some reason picked them all odd. Also I think thats just because odd numbers seem more random to our brains.

Vor Monat## Charlie Horse

If you think the riddle is hard, imagine trying to convince 99 fellow prisoners to follow the plan to the letter.

Vor 14 Tage## Christian Krause

Then i have another riddle for you: You are sitting in a restaurant and listening to the neighbors table. You listen to three different woman talking. a) One says: I have two childs, Martin, the older child, just got his driver license. What is the probability for her other child also being a boy? b) Two says: I have two childs, Martin just got his drivers license. What is the probability for her other child also being a boy? c) Three says: I have two childs, Martin just got his drivers license. He was born on a wednesday. What is the probability for her other child also being a boy? SOLUTION: a) 1/2, b) 1/3 c) 13/27 Explanation: b) Not possible is the birth of G/G, possible is B/B, G/B (girl older) and B/G (boy older). Each of the three B/B , G/B and B/G are equal with a probability of 1/3, but only on B/B the other child is a boy, so it is 1/3. a) As Martin is the older child, the question is simple: What is the probability for a new born child being a boy. What is the probability for your own next child being a boy/girl. It is 1/2. The difference is, that Martin is "fixed" in the birthorder being said he is the older one. c) This one is really hard: The more you "fix" one of the child in the birthorder with detail information, the more the probability increases from 1/3 to 1/2 being a boy. In this situation we have to draw: B/B G/B B/G 1234567 1234567 1234567 1oooxooo 1oooxooo 1ooooooo 2oooxooo 2oooxooo 2ooooooo 3oooxooo 3oooxooo 3ooooooo 4xxxxxxx 4oooxooo 4xxxxxxx 5oooxooo 5oooxooo 5ooooooo 6oooxooo 6oooxooo 6ooooooo 7oooxooo 7oooxooo 7ooooooo The x marks all wednesdays and the "o" marks all other weekdays the second child could be born. The sum is 4x7 -1 = 27 possible birthdays. Only all events in the left diagram (2x7 - 1 = 13) marks the events where the other child is also a boy.

Vor 10 Stunden## Andrzej Bożek

xd

Vor 13 Stunden## StabbyJoe135

@senni bgon you've clearly never been in prison. Or met someone with ADHD.

Vor 2 Tage## David James

No letters, just numbers, ha ha.

Vor 3 Tage## senni bgon

each box points to the next

Vor 6 Tage## herlocksholmes1888

My Chemistry teacher was OBSESSED with this channel in his high school years (he's pretty young, yeah), and I just had to check it out for myself. I've always had a bad relationship with Math because most of my teachers were douchebags, but these videos are helping me see it through a new perspective. It's still frustrating and confusing at times, but it's oddly cool nowadays. It gets less tiresome to calculate stuff now. Thanks awfully, dude! 😄

Vor 5 Tage## grys

I paused at 3:44 to try this method out using Python code. I ran the code 100 times, of which 32 runs were successful (every prisoner was able to complete the task under the given conditions). In other words, it achieved a probability of 0.32. Very close!

Vor 15 Tage## David James

@Rimantas Ri That is a wide range which is why it is better to simulate like 1 million attempted group escapes, cuz if you get 33% consistantly, you likely have an off by one error in your code. A correct computer simulation should show about 31.18% on average for this main riddle as described here (100 prisoner).

Vor 14 Stunden## Rimantas Ri

@David James similar to everyone else's. 30 - 33% success rate guaranteed.

Vor 15 Stunden## David James

@Rimantas Ri How did your results come out?

Vor 15 Stunden## Rimantas Ri

Yup, did the same

Vor 16 Stunden## Kenben Lakhcamp

@Linaiz my brain

Vor Tag## Kinglink Reviews

I've seen this riddle so many times, but this is one of the most efficient way to explain "Why" rather than just an optimal solution. This is why I love this channel

Vor 15 Tage## yuitr loing

strategy is a way to synchronize the wins and fails

Vor 12 Tage## WetBadger

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.

Vor Monat## Jan Taljaard

Lol

Vor 3 Tage## Chain Jail

Not really.

Vor 4 Tage## Ihkeset eeietos

True. I keep thinking if I was a prisoner there's no way I can convince them all. Average humans are too stupid.

Vor 4 Tage## David Nelson

ROFL

Vor 5 Tage## Matt Stokes

Even if you could convince them, someone will mess up somewhere or forget what to do.

Vor 9 Tage## Do Things That Matter

This is why I have such a deep appreciation for those who are great at math. I have no idea how this was figured out and I don't need to because we have people like this! Thank God!

Vor 15 Tage## Ngô Trần Hoành Sơn

can someone explain to me at 8:35 I dont understand that much, the unique loops of 100, and total permutations relate to the possibility of getting 100 numbered loops

Vor 4 Tage## annag cocl

randomly, what is the expected time until one population makes it through? Is there a meta-scheme of renumbering which raises your probability of success even more?

Vor 13 Tage## Evan Guthrie

I think the tricky part of finding the answer to this is realizing that even with this strategy it is more than likely they will not win. It's hard to consider different strategies because any one you think of will not be a "good" strategy and will not stand out to you.

Vor 15 Tage## fallen neberu

a fair puzzle would be to allow prisoners to open as many as such that the probability converges to 50%. The answer is 60.65. So, prisoners should be allowed to open 60 boxes.

Vor 10 Tage## Nadarith

@Zara Bisho Explain how they're nonsense

Vor 13 Tage## Zara Bisho

all these strategies are complete nonsense, everything shows time

Vor 13 Tage## Yeeetttttttttt

That’s why I would just cheat 🤷♂️ And if that fails then RIP me

Vor 13 Tage## Simon Gault

For anyone confused thinking the loop could fizzle by going back on itself somewhere other than the starting number (I was)... remember that no box mid loop will reveal another box already opened, other than the starting number, because that box was previously revealed and so cannot be in a future box. 10 to 11 to 12, 12 cannot have 11 because 10 already did.

Vor 13 Tage## Simon Gault

@Leo Jacksom That would be a 1 box loop. Which is an option. If you mean what if you got to box n and it had n inside, it would not since the box leading you to box n had n inside it.

Vor 10 Tage## Leo Jacksom

But what if box n has slip n in it

Vor 10 Tage## Mortzow

Thank you! That was exactly my question

Vor 10 Tage## Le sommet

@FenixxTheGhost i am stupid 😅

Vor 13 Tage## FenixxTheGhost

@Le sommet I may assume that after 32-10 you wanted to type 10-88, in this case: You can't have two 88's. 88 cannot point to 88 since 88 is already defined in 10. If you meant to type 10 back 1 - then you have two independent loops, that consists of 5(1,5,7,32,10) and 1(88) iterations.

Vor 13 Tage## Ben Wright

As soon as I was presented with this puzzle, my first thought was to find a way to make the individual prisoners' chances of success correlate with each other (didn't actually find the trick by myself, though). Once you break independence between the guesses, you start making gains in overall success. It'd be interesting to see how the limit changes as you alter the proportion of the boxes each prisoner is allowed to open.

Vor 10 Tage## Entropie -

@Bradbury If we solve the equation 0.5 = 1 - log(1/x) for x we get x = 1/sqrt(e) which would be about x = 60.65%, so it checks out.

Vor 8 Tage## Bradbury

This was something I was curious about myself. I can't do the math, but I ran some simulations. After 40k iterations, I found that the longest loop was

Vor 8 Tage## Arizona Anime-Fan

yep, the solution is similar to the "lets make a deal" door solution. you're playing non-intuitive games with chance, to maximize your chance of winning.

Vor 10 Tage## Entropie -

If the proportion is some x between 0.5 and 1 the logic still works basically the same and you should get 1 - log(1/x) success probability in the limit. If the proportion is some x < 0.5 it seems to get more complicated. I don't know whether there is a nice expression for it in that case.

Vor 10 Tage## Aaron S

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.

Vor Monat## Mavi Sormani

True!!!

Vor 3 Tage## David Miller

Here's an interesting experiment - set the room so it contains exactly 2 loops of 50 cards, then see if you can convince the prisoners to use this method with a 100% success rate...

Vor 11 Tage## Chelsea Fan

@Ath Athanasius o wow thats cool!

Vor 13 Tage## Joe Sessions

And at least 50% of them would be FREAKING OUT opening their last chance of survival on box 50!

Vor 15 Tage## Glenn Clark

And if it's more than 50 he knows everyone is dead anyway.

Vor 16 Tage## Tyler Peacock

To me, the neatest thing about this is that by definition, getting on the loop with your own number will ensure that unless you are on a loop of 100 numbers, there are going to be boxes that you never have to open because they aren’t on your loop. It doesn’t tell you by how much your odds increase, but you necessarily make you own pool of options smaller unless all are on one loop.

Vor 6 Tage## TheJulez

What people don't seem to get is, that you choose the box with your number, so you can only come back to it by finding your number on a letter. If you start the loop on your number, it can only end on your number.

Vor 3 Tage## Marco Sarli

My dad actually asked me this question about a month ago when I was with a couple of friends that particularly like riddles. I somehow got the answer right after a lot of guessing and yet I still only kind of understand it. Funny how complicated simple things can get if you dive deep enough!

Vor 2 Tage## Niinja Slayer

I love this video, it eliminates the “chance” grouping it in a loop, you’re predetermined to fail or succeed.

Vor 4 Tage## Dr. DJ X

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.)

Vor Monat## Tyler Grant

@Mcroostr I have no idea what comment you’re replying to, but there’s no way I said that lol re-read whatever you thought I said

Vor 7 Tage## Mariana

@alveolate hermeneutist also works for game cartridges and boxes.

Vor 8 Tage## Mcroostr

@Tyler Grant so all humans can only use what their generation uses for music? I’m too old for Spotify?

Vor 9 Tage## Parth S

Lol😂😂

Vor 9 Tage## drsquirrel00

You assume its left in a case.

Vor 10 Tage## Steven Hansen

Okay I was really confused about the part that says your number is guaranteed to be in the loop but now I get it. If your number is say, 43, then the loop will be open until you open the box that takes you back to 43, the first you opened. There's no such thing as closing the loop, without opening the box that leads you to the first box you opened. Hope that makes sense.

Vor 7 Tage## Jiehong Stanley

"your number is guaranteed to be in the loop" by definition. A loop is formed only when the number slip pointing to the starting position/box is found.

Vor 3 Tage## Callie Myers Buchanan

Where people are getting confused is in language. You ARE guaranteed to be in your number's loop. You are NOT guaranteed to find your number in the loop within 50 searches,. That's where the probability factor comes in is in the limited times you are aloud to search. The more boxes you are aloud to search, the longer the completable loops can be. If your number is in a loop 67 boxes long and you can only search 66 boxes you won't find it in time but if you were aloud to search 67 boxes you'd find it! The only way to win is if NO loops are longer than the number of aloud searches. Which is apparently 31% of random permutations of number placements.

Vor 4 Tage## Jeremy Berven

An easier way to get the point across is that you can't short circuit the loop by closing it early because the same number can't be in 2 boxes... 1, 7, 55, 18, 7 is not allowed because then 7 would be in 2 boxes...

Vor 4 Tage## Kees den Heijer

Yes it does make sense, sometimes you have to open all of the available boxes to come back at your starting point, but the loop always closes. Also: A loop cannot end in the wilderness nor can it short circuit itself somewhere halfway.

Vor 6 Tage## iamkeiju

to come up with this solution you'd really have to think outside the box. on behalf of all the other prisoners' lives - be sure not to slip up edit: all jokes aside, this is a really fascinating problem. i actually found it extremely logical. it really made sense - admittedly it's very surprising how big that probability is at first.

Vor 6 Tage## Arsène Ferrière

An interesting thing to note, that makes things less counter intuitive is that on average as many people find their numbers with both strategies. It's easy to see with the naive strategy 50% find their number. With the loop strategy. The only ones that don't find their numbers are the ones in the biggest loop if it's bigger longer than 51. So in 1 case in 100, 100 dont find it, 1 case in 99, 99 don't find it. So on average 100*1/100+99*1/99+...+51*1/51 = 50 persons don't find it. So on average 50% don't find their number. This strategy is a way to synchronize the wins and fails

Vor 13 Tage## Mystogan

You would be a good teacher, your explanations are very straight forward and easy to learn.

Vor 10 Tage## Greg Squires

I think the chance of convincing 99 other prisoners that this strategy is their best chance of survival is much lower than 31%.

Vor Monat## Luis Ferreira

At least it cannot be worse.

Vor 5 Tage## L3ik 0

@SmellMyKKPP The chance of the other 99 would still be the same 31%, but since all have to succeed to win you have to multiply it with the 1/2 chance of the rogue prisoner. So with one going rogue, it's around 15.5%, with two it's 7.75% and so on.

Vor 8 Tage## ciaopizzabella

I find it discriminatory towards prisoners that they always get used for these kind of math problems. They have rights too.

Vor 11 Tage## Ilse Caraffi - ten Cate

@Urukosh ! unfortunately though, the alternative to escaping was being executed..

Vor 11 Tage## tibor29

@tsv I think he meant that 50% is the overall chance of the strategy being successful and the whole group being released from prison. The outcome of the strategy depends completely on the first person finding their number which is a 50/50 chance. Of course, if the first person finds their number then all the other inmates are 100% guaranteed to find their numbers, but the overall chance of success with this strategy is still just 50% because if the 1st person doesn't find their number (50% chance), the whole group is doomed.

Vor 14 Tage## Benjamin Adcock

So all it is is a 31% chance that all the loops are 50 or less as long as every one follows the same process. Seems pretty straight forward to me. You could use the exact same strategy if they only got to open 30 boxes(or whatever the number could be) , its just that you would hope that the loops are all 30 or less. It made cense once he explained the loop right at the beginning.

Vor 13 Tage## Bảo Khanh Huỳnh

🐕 is 31% chance.

Vor 13 Tage## Karthik Menta

The most important part of coming up with a solution (if you didn't know the riddle solution already) was always how do you constrain the actions of your fellow prisoners so they open the boxes systematically. This is important - by opening up the boxes systematically you can attempt to remove randomness. So a 'valid solution' is something that (1) directs someone where to start (2) directs them afterward -> but it does so for everybody (3) people have to start at different places bc they only can open 50 boxes. The loop strategy satisfies these three conditions. The second / most important thing to note is that: your number has not disappeared out of the room. It exists somewhere in there in one of the boxes.

Vor 19 Stunden## DIY techie

Loved this. Brain candy. And brilliantly explained.

Vor 3 Tage## Rimantas Ri

This is indeed one of your best videos from what I've watched so far, Veritasium!

Vor Tag## Nemanja Ignjatović

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.

Vor Monat## David James

That is one in 8 which is 12.5%.

Vor 4 Tage## walkwithme

@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.

Vor 12 Tage## Nemanja Ignjatović

@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.

Vor 13 Tage## cgabrielac

@WCW 31% ??

Vor 14 Tage## Aaron Kerrigan

I think you meant 1 in 8*10^32, not 1 in 8*1^32 because those odds wouldn't be so bad. Also, you know you just gotta convince each gang leader and the lackeys will follow. So maybe 1 in 5 chance. 😂

Vor 14 Tage## Thomas Rosenberger

I actually think that this is quite intuitive once you hear it. I didn't know it before, but as soon as I heard the following the loop part of it everything made sense.

Vor 12 Tage## Kieley Evatt

I think where people get confused is not understanding the slip of paper 72 and the box numbered 72 as being a single unit of the loop, so they get confused thinking "well what if I pick the wrong loop". Until that bit fully clicks, it makes no sense. For some of us that part is intuitive once it's told to us but for others it just doesn't. I think him giving the visual helped but still. Math concepts are one of those things where you don't get it until suddenly you do, even if it was explained to you exactly the same every time

Vor 11 Tage## STEPHENDANERD

I've played and watched pokémon evolution rando, (every level, random evolution, the evolution chains are set when the game starts) so the idea of any large group of variables creating loops even without the restriction of only 1 leading to 1, isn't really that big a stretch for me considering how often it happens in evo rando.

Vor 15 Tage## Canaiden

I love this explanation and now this makes total sense to me, but there is one thing that he said that doesn't click. He said a benevolent guard could "guarantee" they all survive by switching two slips, thus breaking any potential 51+ box loops. Although I agree it would increase their chances of survival, isn't there a small chance he could instead accidentally combine two loops to create a 51+ box loop? My question assumes the guard makes the switch at random without knowing the placement of the slips in the boxes, which may not have been Derek's intent.

Vor 15 Tage## kevin mcknight

The idea is that the guard is the person who put all of the slips in the boxes in the first place, so he knows where all of them are. Furthermore, it assumes that he originally placed the slips in boxes at random, as otherwise he could purposefully make whatever arrangement of loops he desires. In other words, if you are a benevelovent guard, you can initially assign all of the slips to boxes at random and then look at the slips in the boxes, change two of them, and guarentee success for the prisoners if they use the video mentioned strategy.

Vor 13 Tage## Joe Sessions

Yeah, walking into the room and "seeing" the loops, and knowing how to break the long chain, seems impossible. I think it's one of the points you'd have to suspend disbelieve on, just like all the freaked-out prisoners would actually follow the algorithm without goofing.

Vor 15 Tage## Dustin

I do think he’s implying that the guard is aware of a loop containing 51+ boxes and strategically swaps two of those slips so that it breaks the loop into two loops that have less than 51 boxes. Otherwise you’d be correct that swapping two random slips without knowing anything about the loops could make the situation worse.

Vor 15 Tage## Raphael Schmitz

To me it sounds like the video up until giving the solution "follow the loop that you are on" is about the original problem - but after that it's stuff that's expanding on that. The "benevolent guard" part strikes me more as just a nice visualization of an interesting fact about the structure of the data there. So it's an all-knowing guard, which isn't mentioned, but the whole thing is meant as "look at this neat feature of how the boxes/numbers are set up: 1 change can ensure success!" Interestingly enough, the "malevolent guard" scenario is just "the opposite", but turns out more complex. Either way, as I understand it, those are all "interesting facts", not the original problems.

Vor 15 Tage## Andrew Blank

I believe the guard only has to switch two boxes but has to check more than that.

Vor 15 Tage## Seaweed 99

Lmao, imagine a 50 length loop giving 50 people a heart attack.

Vor 15 Tage## Cromanti Cheer

@Bruce Ricard Imagine every prisoner getting to box 49 and having a heart attack from anxiety.

Vor 4 Tage## Bruce Ricard

You could have 2 loops of length 50.

Vor 14 Tage## Osmond Snurksnor

you've got to admire these mathematicians for thinking out of the box

Vor Monat## Rizki Pratama

POV: YKW

Vor 24 Tage## Osmond Snurksnor

@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.

Vor Monat## Osmond Snurksnor

@Gamina Wulfsdottir Slipping could save your life in some situations though.

Vor Monat## Gamina Wulfsdottir

The danger of thinking outside of the box is that you might slip.

Vor Monat## stets uninu

ba dum tss

Vor Monat## Dracarmen Winterspring

This is a really cool strategy to boost the probability up from random chance that much, and I didn't expect the probability to change so little as the number of prisoners in the puzzle increased. My followup question is, is there a way to prove that this is the optimal strategy, or is it possible there's a better one? (Of course, as people pointed out here, if this was a real situation there would also be the issue of convincing everyone to follow the strategy - IIUC even one person deciding to choose at random immediately halves everyone's chances, even though their individual probability doesn't change. So I think this strategy is also pretty good for that because what an individual has to do is pretty simple to explain, even if the reason it works isn't so simple.)

Vor 15 Tage## Moritz Fabian

@Flame of the Phoenix you are correct this would work without communication. But it is not possible to combine this with the strategy in the video. It enhances the odds of of picking the right box by 20. Which makes it good compared to random guessing but extremely bad compared to a ~30 percent chance using the loop strategy

Vor 3 Tage## Flame of the Phoenix

@David James They don't need to communicate.

Vor 10 Tage## David James

@Flame of the Phoenix Communication in ANY way is not allowed according to the rules.

Vor 10 Tage## Flame of the Phoenix

@Kieley Evatt If you spent long enough I'm sure you could find a way to implement this into a strategy.

Vor 10 Tage## Flame of the Phoenix

@David James They don't technically know that he found his slip, but if he didn't there's no point in trying anyway, and so assuming he did not, would be assuming you lost. In other words, yes you do know that he got his slip.

Vor 10 Tage## tango dman

This is magic of maths and probability. Great video and analysis of this problem.

Vor 5 Tage## Tran Phuoc Loc

Your explanation is definitely clearer and easier to understand. Thank you so much, now I can have a peaceful sleep.

Vor 9 Tage## Gabzsy

This channel is amazing. It reinvigorates my interest and curiosity about rational thinking and mathematics that my father instilled in me decades ago. I didn't really ended up practicing those muscles in my life but they are still there.

Vor 10 Tage## Róbert Kovács

It makes me miss high school/uni math and I regret I didnt go to math school

Vor 9 Tage## toijg avnnr

I actually think that this is quite intuitive once you hear it. I didn't know it before, but as soon as I heard the following the loop part of it everything made sense.

Vor 10 Tage## Christina Busse

I actually find this concept very intuitive. We've played what we call "The murder game" in church camps many times and it goes like this: You write the names of all participants on pieces of paper and hand them out randomly. For the next days your goal is to kill the person you got by handing something to them. If they take it, they're out and your next goal is to eliminate the person that they were onto. Eventually you're gonna kill the person who was after you and end up with your own name so you win. And it happened very rarely that there was only one winner meaning only one loop in the whole group. Cause how probable is it that all the names line up perfectly? So I was already familiar with the thought of those loops and instantly knew what you were up to once you told to open the box with your own number.

Vor 2 Tage## Christina Busse

@Fabri Very cool too! In Europe we have the game Werwolf that works similar, just that there is more Wulfs/Killers. And to fight them the other people get a bunch of cool powers like healing or being able to see the the identity of one person per night. Big hit.

Vor 2 Tage## Fabri

@Christina Busse I’ve also been to church camp and we had a similar game called “Mafia”. every participant is seated in a biiiiig round table. they all have to close their eyes, and then someone (usually a guide, not a player) will randomly pick 2 people: 1 cop and 1 killer. the killer can execute if he does a wink at his victims. BUT, if he accidentally winks at the cop, he’s caught and everyone else win. the tricky part is that, once the game start, everyone has the right to accuse someone of being the killer (without revealing your own identity, of course). then, there’s voting to determine, at certain points, whom is eliminated. if the killer is eliminated, everyone wins. if the killer take out everyone (by either voting or wink), he wins. so even though is not with probabilities or stuff, it’s still a really good game because everyone start blaming everyone and you really don’t know whom is who so it’s really fun

Vor 2 Tage## Christina Busse

@Fabri Depending on the group from 8 up to 40 people. You play it over the course of a few days while you're going along your usual programm. In the beginning everyone is super aware of not taking anything someone is handing them. Friends are daring eachother to take stuff from them cause only the person with your name can kill you and "what are the odds". As hours and days pass people start to forget about the game making it easier to strike, but don't try to obvious or they'll know it's you. It's so much fun!

Vor 2 Tage## Fabri

how many people played that game?

Vor 2 Tage## Bovarchy

I think I understand it in a way that makes it simple to explain: Going from slip to box label eliminates any chance of randomly picking a box with a slip the same as the box number. With those out of the way, your chances are higher. Going from slip to slip keeps making your chances better because you know you won't pick two boxes with their slips switched around, and so on and so forth.

Vor 13 Tage## adolfo rodolfo

No, it doesn't quite mean that - nearly, but not completely; because you could find your own slip in the first box you open, the one with your own number on the outside. But that's OK, not a problem at all. What you can't do, you're right, is find the same slip and box number together for any of the other prisoners' numbers - which is one of the consequences of the strategy. it makes sure that every box is opened by at least one prisoner and that does, as you say, improve their chance of survival compared with random picking - although that improvement is not additional to the increased survival chance provided by the strategy.

Vor 13 Tage## David James

One thing really interesting about this problem to me is that there are 100! = about 10^158 unique arrangements of the 100 slips in the 100 boxes. No single computer can check all of those in any reasonable amount of time, however we don't have to. The beauty of Monte Carlo simulation is for something with fairly high probability like this (over 30% in this case but even something small like 0.03% would work too), we only need to take a tiny random sample to get a good approximation of the correct (exact) mathematical answer. Even as few as 100,000 = 10^5 is enough to get an approximation of about 31% for this prisoner riddle as stated. My simulation program takes about 0.15 seconds runtime to simulate 100,000 outcomes/decisions and about 1.5 seconds to simulate 1 million outcomes/decisions. The problem with Monte Carlo simulation comes when the expected probability of what we are trying to simulate is super tiny. For example, if we simulated 100,000 outcomes and got 0 "winners", what conclusion can we draw? What if we re-ran the simulation and then got 1 "winner"? Our results would still be inconclusive. This is why math and computers are both useful to solve these types of counting problems because they help complement each others weaknesses / limitations. Not all people know how to solve counting problems mathematically.

Vor 3 Tage## potato4dawin

2:43 in, trying to solve on my own. so my first thought is that the first prisoner's odds of success are 50% no matter the strategy which means the 2nd prisoner's odds of success must be much greater if this is the case then I'd argue some strategy like arranging the slips in the boxes in sequential order and having the successive prisoners estimate the location of their slip based on that before using the rest of their box checks to rearrange most of the other half, or in the event that their slip is not in the first half, to search most of the other half to find it. This way if a random 50% are in the first half then prisoner 2 should be able to check the 1st and 2nd boxes and know based on that whether his number is in the first 50 or last 50, and then still has 48 or 49 checks left. or if prisoner 1 checks box 1 and finds a slip with a different number then he checks the box corresponding to that number and continues for 50 boxes then moves each slip to its proper box, starting over with some other box if he completes a loop Then prisoner 2 comes in, checks box 2, and if he finds his number proceeds to check successive boxes until he finds a box with the wrong slip and follows the procedure prisoner 1 did or if he doesn't find his slip then follows the procedure prisoner 1 did until he does.

Vor 2 Tage## potato4dawin

dang, I was wrong. I guess my solution counts as breaking the rules of not leaving the room the way it was when you entered but at least I was on the right track that the loops had to be part of the solution. I just didn't think about it until he mentioned the loop sizes that no rearrangement was necessary to get odds so close to 1/3rd and my assumption that the 2nd prisoner's odds of success are higher was wrong since it's not that they're higher but rather that they're very likely shared

Vor 2 Tage## tom gray

To be honest, I didn’t struggle with understanding the strategy, or how the loops work. I was confused about the 31%, but after you explained that this all made a lot of sense, and it’s really fun maths.

Vor Monat## Magus Perdé

It's really just about the fact everyone has the same 100 boxes.

Vor 14 Tage## Dennzer1

Cool, I was confused by all of it. Still am, but I was, to.

Vor 29 Tage## Avana Vana

@Nimrod - all geeky things oops, totally missed that fact…thanks. So you are saying that if the ratio of total boxes to box choices is above two, it is no longer able to be approximated by the area under the curve 1/x?

Vor Monat## Nimrod - all geeky things

@Avana Vana it fails for ln(3) because the integrating function is wrong. The formula of 1/x only applies for half or more, so you would expect any ratio from 1 to 2 works. For anything more than 2, piecewise integration has to be performed and the ratio should not pop out this easily.

Vor Monat## Avana Vana

@Nimrod - all geeky things right, that is obvious, but what I am saying is that doesn’t apply for ratios beyond 2, for example, if 50 prisoners choose 50 out of 150 boxes. 1-ln(3) does not yield a probability that makes sense in the real world. It does hold for the simple case of 50 prisoners and 50 boxes, since 1-ln(1) = 1, ie 100%.

Vor Monat## A Flailing Duck

Oh hey, it's pretty much thinning out a 100 card singleton deck. Experienced TCG players will be quite familiar with this. It's an exclusive pool that decreases via elimination as you draw cards (or in this case numbers), so your pool goes 1/100, 1/99, 1/98 so on and so forth. Or in our world "Where the hell is that one combo piece in my edh/100 card highlander deck".

Vor 15 Tage## annag cocl

strategy is a way to synchronize the wins and fails

Vor 12 Tage## Reece Drystek

It is a similar concept to the Monty Hall problem in that everyone views each person as unconnected choices. However, as you have now linked two boxes together by going to the next one with that number you have now shared information between chances and changed the probability. Just like in the Monthy Hall problem, revealing a door provides new information, it is just down to how you use it and in this case it is a cleaver way of using it in these loops.

Vor 9 Tage## cnmmd qiuoo

each box points to the next

Vor 7 Tage## Remus Teezy

Thanks so much legend !! Literally the only tutorial that actually WORKED!

Vor 14 Tage## Cow Chop Time

I'd love to see this in an actual experiment lol

Vor 15 Tage## N Z

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

Vor Monat## hülye ló

@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

Vor 26 Tage## Froglet

@ILYES spoken like someone who knows nothing about math

Vor Monat## Gianluca G.

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.

Vor Monat## ophello

@magica that’s a pessimistic view.

Vor Monat## ophello

A lot. Two separate words.

Vor Monat## May Be Something

This makes sense. It reminds me of two things. Family Christmas gift giving, and an encouragement thing my grade 4 teacher did a few times during the year. I would have never guessed the answer, but it does make sense to me.

Vor 14 Tage## yuitr loing

strategy 50% find their number. With the loop strategy. The only ones that don't find their numbers are the ones in the biggest loop if it's bigger longer than 51. So in 1 case in

Vor 12 Tage## Eric

If the first person goes and opens their box on the 50th try, you know there's a loop of 50, meaning the maximum size of the other loop would be 50. Therefore, you'd know after the first participant that they've already won.

Vor 14 Stunden## shoo

I think the prisoners can improve their chances a little by assuming, if they fail, that the loop was only one longer than their limit, and when asked where their number was, to give the next box they _would_ have opened. (depending on the specifics of the rules, of course)

Vor 12 Stunden## Reatile Koketso Molatlhegi

This is quite interesting I'm curious as to how it may apply in a daily-life scenario.. perhaps one 'Game of Chance' 😅

Vor 10 Tage## Wouter Pomp

Imagine coming up with this massively smart idea and still only having 31% chance not to get executed.

Vor Monat## Cruel World

@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%.

Vor 18 Tage## LordoftheFleas

@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%.

Vor 27 Tage## Ducky Momo

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

Vor 28 Tage## Ojo Oladimeji

@IHateUniqueUsernames Framing effect. lol

Vor Monat## Alister222222

@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.

Vor Monat## Swords to Plowshares

What is the probability that all 100 prisoners understand and follow the instructions? The calculation assumes 100%, but if we ran trials with random participants, it would not be nearly that high no matter what the incentive or how well it is explained to them because people are bad at following instructions. If I were in this group and we had unlimited time to strategize, I'd be drilling every person to make certain they knew the strategy and how to properly execute it.

Vor 14 Tage## Terry Lewis

I’ll remember this on my next sentence in prison. I have a feeling, though, that explaining it to the inmates will get me beat up (or worse).

Vor 4 Tage## florian badertscher

If you think it through, even on a chain with 51 boxes, all prisoners would still be able to find their box. Reason being, even if you have opened 50 boxes and didnt find your number, all prisoners should just point at box 51, hoping thats their number. That strategy only begins to fail with chains of 52 boxes or longer. ... except we have a rule that each prisoner has to see their number, rather than naming the box that contains their number. But it probably wont change much at the overall chances.

Vor 10 Tage## TheLlywelyn

Complete loops with their number can exist in the loop they didn't finish or in the other 50.

Vor 6 Tage## triop

That's actually a really good point. One of the rules says "if all 100 prisoners find their number during their turn in the room", so it's unclear whether they have to see their number within the 50 picked boxes or just point at the box they think their number is in.

Vor 9 Tage## Terra Incognita Band

Now imagine you being the one mathematical genius among all those 100 prisoners and you have to explain your strategy to Every single one of them and nobody believes you.

Vor 16 Tage## Neil Moss

I feel that "Metersen's colleague" should definitely get at _least_ a name check here! So, hat tip to Sven Skyum, reader emeritus at Department of Computer Science, University of Aarhus.

Vor Monat## Irrelevant Noob

@Jesus Saves! so when's the last time you LITERALLY went to scientists to prove to them how effective your prayers have been?

Vor Monat## Vigilant Cosmic Penguin

That's a pretty cool name. Sven Skyum.

Vor Monat## Jesus Saves!

Your worries (yes, anxiety), depression, suicidal thoughts, EVERYTHING will melt away and be NO MORE when you lean on God and put your trust in him! When I have physical pain, I literally pray and the Lord quells it, that I am healed!! Know that there is power in the name Jesus Christ! His name casts out demons and heals! People are bothered by his name. The world hates the truth and wants to continue living sinfully! God's children are set apart (holy) and righteous.

Vor Monat## Jesus Saves!

Hey! Did you know God is three in one!? The Father, The Son, and The Holy Spirit! Bless him! Jesus died for our sins, rose from the dead, and gives salvation to everyone who has faith in him! True faith in Jesus will have you bear good fruit and *drastically* change for the better! Have a blessed day, everyone!! ❤

Vor Monat## Neil Moss

I'd love to know the process by which Skyum arrived at this answer. Years of work in a field where this kind of "loop" structure has been studied already? Flash of inspiration after a night of pizza and cola? Or was it an immediate "well, duh..., isn't it obvious?" savant-level intuitive grasp? That's as fascinating as the original riddle.

Vor Monat## William B

Best ever! I feel like this is more "fascinating" than it should be regarding the fact that the probability of success converges with an increasing number of prisoners. I'm challenging myself to come up with an intuition-based analogy where this will seem more obvious.

Vor 10 Tage## toijg avnnr

You would be a good teacher, your explanations are very straight forward and easy to learn.

Vor 9 Tage## Risto Welling

What happens if prisoners decide to swap 2 boxes (in example 1=100 and 100=1) and then use this string strategy? That would mean 70% time they have a good change to cut the too long string and 30% of time they has small change to cause too long string. For me it seems like they would double their changes to survive.

Vor 15 Tage## adolfo rodolfo

Assuming you mean before prisoner one begins it all? because the rules don't allow moving the boxes once the exercise has started. Swapping two of the boxes would make no difference whatsoever; you could swap as many boxes as you like, redistribute the numbers inside, none of it would make any difference at all.

Vor 14 Tage## Phil Angeles

This actually makes me think of running Secret Santa gift giving :)

Vor 7 Tage## Loutre Acariatre

What i love about mathematitians is, they'v got the brain to turn numbers in every ways possible , finding astonishing strats, yet , they'v got the hardest time explaining why it works... In this cas , the trick is not explained by math , it's explained by how you think about this problem. If they choose the loop strat , prisoners do a bet, they bet there is no loop longer than half their number, in our case 50 for 100 prisoners. Thus if they win their bet , they will all find theyr number. but if it happen to exist even one loop longer, they'r all fucked. the question is no more, "are they able to find their own numbers" but: "is the random assorment of number in the box including an over 50 loop". if your mind continue to think about the first problem it can't seize how the loop strat shifted the problem. first statment, how can they all find the good box second statment , please make it that no 50+ loop has been created in the first place. it's a good exemple on how the riddles work, they focus your ming on one point of view wile the answer is clear if your shift how you lokk over the riddle :)

Vor 14 Tage## Bill Rexhausen

Writing a research paper and still telling the reader to figure it out for him or herself is peak professor energy.

Vor Monat## Irrelevant Noob

@Rinnegone Happens sometimes. I'm guessing either they were removed individually, or the accounts have been poofed. 🤷♂️

Vor Monat## Rinnegone

Why are the replies gone?

Vor Monat## Thor H.

I feel like the biggest problem would be trying to convince every other prisoner to follow the strategy.

Vor 10 Tage## shani yan

of next prisoner, he leaves the room after a long time. 5a. Next prisoner searches the same set of boxes as his successor. 5b. Next prisoner searches the other set of boxes.

Vor 10 Tage## Laura Eslava

I was intrigued when Derek talked to three different people about the problem, but then it was quite sad when I saw only one of them appearing for the rest of the video.

Vor Tag## myladypunk

Interesting problem, thanks for sharing!! I just don‘t get why the probability for one singular prisoner remains at 50% with the loop strategy. Isn‘t it entirely dependent on the random loops and should then also be around 30%? or what is the probability for their number being not in one of the larger loops IF a larger loop exists… plus the probability of there being no larger loops. my head hurts. can you tell me?

Vor 15 Tage## Mavi Sormani

The probability of you getting heads or tail is 50%, right?. Now the probability of getting heads 5 times in a row is much smaller. Similar here. 50% is the probability of a single individual. 30% is the probability as a whole group (using the loop strategy of course) of everyone getting finding numbers in a row.

Vor 3 Tage## Entropie -

It should be clear that one prisoner still has exactly a 50% chance whatever strategy is chosen because they are opening 50% of the boxes without having any way to tell where their number may be. To understand it in the context of the loop strategy you get the following picture: With 31% probability there is no loop of size > 50 and the prisoner is guaranteed to succeed to find their number With 29% probability there is a loop of size > 50 but the prisoners number is not part of the big loop so they still succeeded nonetheless With 50% probability there is a loop of size > 50 and the prisoner is part of it, failing to find their number.

Vor 15 Tage## T C

Try to find the probability of failure, i.e., there is a loop with N(N > 50) and you are in this loop.

Vor 15 Tage## inter galactic

i think i know the answer really : the prisoners will be able to all find their numbers if the ones that made the riddle want them to be free, seeing as this is the highest percentage for finding their number using this particular strategy then this is the strategy the ppl that made the riddle devised, and they planted the numbers accordingly, but if they dont want them to win then they'll prob randomly place the numbers

Vor 14 Tage## Kristjan Brezovnik

Destin's "Teach me." is possibly the greatest example of doing science right. Or, you know, something to that effect. :D Possibly both most humble and most epic answer ever.

Vor Monat## Avana Vana

@TheMrVengeance As I said, that has nothing to do with doing science, exclusively. I’m not saying it’s not an important for a scientist to have, in fact I believe it is an important quality for anyone to have, but not a necessary or sufficient precondition for “doing science right”.

Vor Monat## TheMrVengeance

@Avana Vana - "Teach me" implies humbleness, a willingness to learn, curiosity, not being scared to perhaps be wrong about something. Without those qualities in a person, the scientific method does f*ck all for them.

Vor Monat## Avana Vana

@TheMrVengeance obviously not, but it’s the foundation, and the point is that asking someone “Teach Me” is not exclusive to science, nor is it an example of “the greatest example of doing science right”, as OP claimed.

Vor Monat## Gianluca G.

Destin's "Teach me" gave me a Morpheus' "Show me" vibe.

Vor Monat## TheMrVengeance

@Avana Vana If you think the only thing you need to do good science is the scientific method, you've never done good science. Or more likely, never done science at all.

Vor Monat## Flame of the Phoenix

Alright I'm putting a wild guess as to the strategy right now before I watch the rest, if the first guy looks in the first half, and finds his number there's a slightly higher chance that the second guys number is in the second half, this is because that means only 49 cards in the first half could be the second guys number where as 50 cards could be his in the second half, and since you know that if his card wasn't in the first half you'd be executed anyway you can go ahead and assume they're in the first half. While I still think I made a good guess, after all you have to assume the previous prisoner got it correct whether he did or not, but I'll admit you made a better method. Having enslaved a computer to calculate the odds it seems like my method though not the most effective is around 20 times better than just guessing.

Vor 12 Tage## Jovana Djordjevic

What would happened if all prisoners make a deal to go to just one box starting by box 1 and change the content of the box with the right box number. Eventually by the end of the experiment all of them will know that their number inside the box is the same as on the box. Who would know that they changed anything? Beauty of quantum physics ;)

Vor Tag## AC Students

I find this easy to accept. I feel like most people that are confused miss the part where each prisoner is allowed to open 50 boxes.

Vor 14 Tage## mokokoandy

opens box 1, has #50 in it, opens box 50, has #1 in it... this theory is based on a guaranteed loop system and is flawed.

Vor 9 Tage## shani yan

set. Now the change is 50% iso 30.x%, just like timing in Spectre/Meltdown. P.S. I see now I’m not the first one with this idea…

Vor 10 Tage## Shane Carr

I'm convinced of the 31% for the stated solution, but how do we know that this is actually the best solution? Ideally, if there's a way to couple the probabilities even more, we could approach a 50% success rate.

Vor 9 Tage## Milosz Forman

Warshauer and Curtin ("The Locker Puzzle") have pointed out that it is indeed the best method. Suppose the rules are slightly altered, meaning that the boxes opened by any P. are left open. If another P. enters the room and sees his number in an already opened box, he has nothing to do and leaves immediately. If he does not see his number, he continues to open boxes until he finds his number. Now this would be a strictly random game, no strategy whatsoever could improve the chances. And it is equivalent to the standard game when loop strategy is used. Any strategy improving the chances of the standard game would also improve the chances of the altered game, which is not possible.

Vor 9 Tage## Tim Fischer

I feel like I'd rather die than trying to explain to my co-prisoners why this works.

Vor Monat## Epic

@Sechelt Fish Market 31% > 0.00000000000000000000000008%. I'd rather go with a 69% fail rate than a 99.9999999999999999999999992% fail rate.

Vor Monat## Ben Thorpe

@Sechelt Fish Market it gives the highest chance of success, that's what they mean by 'why this works'

Vor Monat## Tamber Squirrel

@Itskelvinn I love his videos lol. I'm sorry you don't find them entertaining, I guess we all have preferences.

Vor Monat## Itskelvinn

@Tamber Squirrel he has good content and he means well but I just can’t stand watching him

Vor Monat## Tamber Squirrel

@Itskelvinn rly?

Vor Monat## Youshisu

When you watch some science fun video, and there is question, "Where is the limit?". Opening 1000 boxes is already big task you mad man! :D

Vor 14 Tage## Tech Sam

I was really hoping you were going to have 100 people try this out in real life at some point in the video

Vor 4 Tage## jmart014

I’m still a bit confused about when you explain that every number is on a loop with it’s own number. If the boxes are randomly assigned, wouldn’t that create independence between two? Your example seems to link them and negates that. I’d be curious to run a simulation in Python to see how this actually plays out.

Vor 14 Tage## Aqua7625

@Abdullah Waris Because there aren't any duplicate slips. If prisoner 1 sees 2-3-4-5-6-..., to make a subloop would mean they'd need to see one of those numbers *again*. For example 2-3-4-5-6-3. But there are no duplicate "3" slips. When opening a new box, the only possibilities are either seeing a number they've never seen before, or seeing their number.

Vor 8 Tage## Abdullah Waris

@Yassine B. Why can't there be a subloop that connects to a number the prisoner had encountered after his own number

Vor 9 Tage## xandercorp

@Chris Jones It's less complicated than even that: the smallest possible cycle of boxes is 1, where it has it's own number in it. The next smaller cycle is two boxes, where box A contains slip B and box B contains slip A, completing the set. It scales in this way all the way to a cycle of a hundred boxes, and every single set has its own number in it (any group of boxes that does NOT have a slip number for every box number is not fully counted and is incomplete, it does not cycle).

Vor 10 Tage## Chris Jones

IMO he doesn't explain this part well. It's the combination of two facts. FACT ONE: every permutation can be decomposed essentially uniquely into disjoint cycles (why? the naive process of making them works). FACT TWO: the cycle with your box number also has the box GOING TO your box number (why? because THAT'S WHAT IT MEANS TO BE A CYCLE).

Vor 11 Tage## xandercorp

I mean, disproving your intuition should be easy in this case. Go ahead and specify a loop that contains the chosen number on the box, but not anywhere on the slips inside. You can't. The largest possible loop with your numbered box is all 100 boxes, which must contain your number slip. The smallest is 1 box, which contains your number slip. The loop can't terminate until you get back to that number, it's the only end condition (that's what a loop is). What number box are you going to put your numbered slip in? How are you going to terminate the loop, without leading back to your number?

Vor 13 Tage## h borja

As someone who had just finished my college lecture on permutations and combinations, I feel like an absolute legend being able to understand what Veritasium said in this video

Vor 5 Tage## Milosz Forman

@Ngô Trần Hoành Sơn Perhaps it's best to verify this formula for small numbers first. Starting with 2, 3, 4, 5. It will soon get clear.

Vor 4 Tage## Ngô Trần Hoành Sơn

can someone explain to me at 8:35 I dont understand that much, the unique loops of 100, and total permutations relate to the possibility of getting 100 numbered loops

Vor 4 Tage## David Wu

"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.

Vor Monat## Emanuele Giordano

@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%.

Vor 27 Tage## Enaronia

@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!

Vor 29 Tage## Lord Talos Gaming

@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.

Vor Monat## Gamina Wulfsdottir

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".

Vor Monat## Damian Sarna

What you described is actually known as a standard coupling argument from probability theory, widely used in many proofs. Regardless of the strategy, marginal distributions (which encode probability of success of each prisoner individually) remain intact, but we can manipulate the joint distribution (which encodes probability of their joint success) to maximize their chances. We can do that because the choice of a joint distribution is not unique - we just naturally assume they are independent because there is no clear "external" source of information that all prisoners together can use. Loop strategy does provide that external information, expressed in terms of length of the longest loop (by the way, this length is a new random variable and we implicitly switch probability spaces...). With that new strategy, their choices are simply not independent anymore, but correlated in a very favorable way. Wikipedia page on coupling in probability provides a few nice and simple examples of this technique.

Vor Monat## adfklfnasgo asfaisgapg

1:46 Imagine it would have been a 1. Then it would have been practically impossible

Vor 8 Tage## Kep Spark

Puzzle @2:42 Best strategy: Refuse to participate, don't go into the room, don't attempt in the 1st place. Think about it. If they don't, they will all live! Sure in that life, they might have to lower their expectations but at least the chances of dying is lower. I am not an expert but the probability of them dying seems much below 50%. So basically the doubt is whether to choose to go through the room & take a chance of >>50% dying &

Vor 3 Tage## ZaiZoe's Clashing

The mathematical graph points to the science of chance. It lines up perfectly

Vor 13 Tage## Ludax2000

What happens if we use the loop strategy but starting with random number(s) ? It feels like you possibly raise your chances of landing on a shorter loop to your number, is it compensated by the risk of "passing" your number or burning your chances on wrong loop(s) ?

Vor 15 Tage## adolfo rodolfo

If you use the loop strategy but starting with a random number then there are two big potential problems; (a) you make it less likely that you find your own number, because you are not guaranteed to be in a loop that includes it, (b) you might open a box that has its own number inside, meaning you will be forced to make another random choice (this might happen more than once); any additional random event always reduces the probabilty of you finding your own number compared to adhering to the strategy. The strategy is optimal, given the rules of the exercise; any deviaton from the strategy will only reduce the prisoners' chance of survival.

Vor 14 Tage## Entropie -

Your designated starting number has exactly the same chance as any other, randomly chosen number to land on a short loop so you would not see any effect in that regard. But you would reduce the coupling between the prisoners and thus the survival probability would drop as a result. The original paper actually proves that you can not do better than with the presented strategy, so most modifications to it will actually be detrimental or at best equivalent.

Vor 15 Tage## Aleph_ Zero

Miltersen: "Hey, i made this riddle. Anyone want to try it?" Everyone: "Dang, it is kinda difficult. What is the answer?" Miltersen: "Idk go figure it out"

Vor Monat## haha name go brrr

"This problem is left as an exercise to the reader" is just a fancier way of saying "idk lol"

Vor Monat## Itismethatguy

Haha yeah His name bro is funny, u could have user that

Vor Monat## dustin castlen

Math is great if you can understand it. Personally it's not my strong suit, so I would just tell the prisoners to ignore the numbers on the boxes, and check the 1st 50 boxes they get ahold of. Place the numbers in a 10x10 square with their true value so the rest can find them without guessing.

Vor 2 Tage## smok

Imagine being the first prisoner to enter the room and fail 💀

Vor 11 Tage## NyoGR

Making a strategy and not communicating with one another is kind of complicated since you can communicate the end result from the strategy that you build. Prisoners can all check Their box (and the rest 49 consecutive boxes, although unnecessary*) and position themselves at the exit on the corresponding position of the number that they found in Their box. For example if in box 1 was the number 99 he would position his body on the exit at a place corresponding to 99. They could also have done this before they get in. After that they all would know in which box their number is in and this will always have a 100% chance of letting them go. *it’s only interesting to check the rest of the 49 boxes so you can position yourself at the right location in the end fix a better formation so it can be read easier at the end. Another idea was for each number to check the next 49 boxes for example prisoner 91 would check 91-41.

Vor 4 Tage## Stijn De Vuyst

Beautiful video. The question that arises is of course: is the proposed loop strategy optimal? In other words, can you be sure there is no other strategy which results in an even higher probability of the prisoners surviving?

Vor 4 Tage## Entropie -

@vwwvwwwvwwwvwwvvwwvw There is a paper "The locker puzzle" with the proof. It is actually not that hard to show. You can first argue that the loop strategy is equivalent to an adjusted game where all prisoners are in the room together but can only open boxes until their number is found but use the already opened boxes to their advantage. Then you can argue that this adjusted game is purely random so there are no advantageous strategies possible. If the loop strategy would not be optimal (meaning there exists an even better strategy) then this would imply an advantageous strategy in the adjusted game which can not exist.

Vor Tag## vwwvwwwvwwwvwwvvwwvw

@Entropie - Where did you read that?

Vor Tag## Entropie -

Yes, it is indeed optimal.

Vor 4 Tage## James Buchanan

Imagine being the prisoner trying to sell this plan: "Now we still have a 70% chance of failure, and it's much to difficult to explain, but you all need to follow my instructions exactly for us to have any chance." Then every dissenter lowers your chance by half agian. At this point, I'm starting to think this time would be better spent coordinating a riot.

Vor Monat## AnduinX BYM

If possible, I would try to not even discuss the probability of failure. I would try to sell it to them by saying something like _"this strategy improves our chance of survival many times over"._ Chances are none of the prisoners would call you on the 71%, because none of them would be able to calculate the odds, and if one of them was intelligent enough to do so, that one should also be intelligent enough to know to keep their mouth shut. For those who press you on the details, you could discuss loop chains with them and throw out impressive-sounding statements like _"by linking our probabilities together in a loop, our probability of success is tethered to the probability of there being a loop of a certain size, as opposed to repeated coin flips."_ If pressed for the odds of success, it may be appropriate to straight up lie to them and give them a high number. Again, if any of them were capable of calculating the odds, they should also be intelligent enough to keep their mouths shut. I think we'd still be screwed because there's always the ones who either can't or won't follow simple instructions.

Vor 16 Tage## Dark Ale

Hopefully it would be easy to convince them: 1. Their individual chance is not any worse, it's still 50%. Except now they have a clear strategy to follow. 2. If they don't follow the strategy, they have no chance. (1/2)^100 is basically zero. 3. The strategy itself doesn't require any math to explain. Just "start with your number and follow the chain."

Vor 21 Tag## tatri2

Doesn't just one person that follows the plan increase the odds? since you + the one guy would have a 25% chance to find both of your numbers randomly, which is already lower than the 31%. Then every dissenter lowers it by 50% again but (0.31)*(0.50)^98 > (0.50)^100. Thus it's always worth trying to get at least some people to believe. edit: (0.50)*100 to (0.50)^100, oof typo

Vor Monat## James Buchanan

@Michael Moran I agree with the point, but you are mistaking Ben for the original commenter, me.

Vor Monat## Pariniti Verma

@Benjamin Ronlund Doesn't look like you've had a very nice group of friends for you to think this way.

Vor Monat## charl klein

Loved it. This would be a great example for students that rely on perfect theoretical situations and math to illustrate how it all goes wrong when you leave out the common sense. In theory, the math is beautiful and clever, but in the real world, they're doomed. Cooperation? Trust in a plan most don't understand when their life is on the line? Following the rules? Not high probability characteristics for prisoners... or even people in general. X number are doing to do their own thing and blow the plan, and that definitely goes up with more people. Wonder if there's a parallel world out there where they have no climate problems, war, or food insecurity because some sadistic mathematician has created a filtering squid game.

Vor 14 Tage## adolfo rodolfo

@Dark Ale Hooray!

Vor 14 Tage## Dark Ale

It's very easy to replace the prisoner situation with a more "believable" situation that has the same underlying rules. For example instead of prisoners you could just have contestants in a game, and instead of making it a punishment upon failure, you could make it a reward upon success (like everyone wins $1000 dollars) to encourage everyone to work together. Worrying overly much about the setting is kind of missing the point.

Vor 14 Tage## Ghostneedle1

I think I finally understood it during the final conclusion.

Vor 12 Tage## a2pha

1:27 OK Already I'm seeing a problem. If they pick a random box that has ALSO a random number that must match their own, isn't that percentage chance of them finding their number less than 50% at that point ?

Vor 2 Tage## vwwvwwwvwwwvwwvvwwvw

Prisoners don't pick random boxes, each prisoner starts by opening the box labeled with his or her number. Is that clear?

Vor Tag## NSW HSC Maths

What do you mean? Each prisoner opens 50 out of 100 boxes.

Vor 2 Tage## Iulian

Well, to be fair - I didn't knew about loops and stuff, but the only solution that I thought about - was to open your cell number and follow numbers, without knowing that this is the solution and how it works...

Vor 2 Tage## Night Kids

Made sense to me, but figured i had to model it with some python code, running the test with 10000 samples (complete runs of all 100 boxes) gave an average success rate of 30-31%. very interesting to actually see in action

Vor Monat## Bee

@Aaron Lee Matlock fr they're all posted at the same time too 💀

Vor Monat## Mattie Shoes

Haha, I just did the same with perl

Vor Monat## chem1kal

@Jewell Walker scam chain lmao

Vor Monat## Aaron Lee Matlock

@David Hudson scam moment

Vor Monat## Daniel Cunha

@__ Nice!!

Vor Monat## Test

I loved that problem, the moment you said to start at your own number i undertand it, but is there a proof that is the best possible solution?

Vor 15 Tage## David Morgan

I feel like a really interesting calculation would be with the hypothetical situation where if a prisoner guesses their number correctly, it removes it from the box and their number from the pool that the next prisoner would pick from.

Vor 13 Tage## David James

What do you mean if the prisoner guesses their number correctly? How many guesses is each prisoner allowed?

Vor 13 Tage## Isobel Marian

Is there a time limit on the room? For what I can gather, it you have time to complete the longest loop in there, you also have time to just strategically open every box until you find yours?? Am I going crazy?

Vor 5 Tage## Manny Manster

Great video! However, you failed to prove that this is the best strategy. How do we know there’s not a better strategy out there? Or is that in the paper you referenced and too beyond scope of this video?

Vor 3 Tage## Chris Wasia

This riddle definitely seems impossible but the brute force approach confirms. Ran a program that played the scenario 50,000 times and yep... 3,450,000 prisoners died. Survival rate was 31% of the time. Nice work and as always, thanks for teaching us something new Derek!

Vor Monat## Chris Wasia

@Adam Dugas Yeah its pretty basic. I have never felt so old. Just glad I can remember it because I have forgotten all of the other languages I once knew. Probably has to do with being a teenager and what sticks at that age.

Vor Monat## Adam Dugas

@Chris Wasia Thanks for replying! I haven't read much basic, so it'll take me a while to understand this. lol

Vor Monat## Viktor S.

@Adam Dugas public class IsDerekWrong{ public static void main(String[] args){ double sum=0.0; int index = 100; for( ; sum

Vor Monat## Sander Groeneweg

I just did it on Matlab. I got 31,16%. HIT = 0; for ab = 1:1000000 hit = 0; X = randperm (100); for i = 1:100 k = 0; n = 0; j = i; while k == 0 n = n+1; if n > 50 break end if X(j) == i hit = hit+1; k = 1; else j = X(j); end end end if hit == 100 HIT = HIT+1; end end MyPercentage = 100*HIT/1000000;

Vor Monat## HogmanTheIntruder

Question is, did the prisoners know they were in a simulation?

Vor Monat## ColasTeam

I don't find this to be unintuitive at all frankly, it makes a lot of sense, if every prisoner is starting from a different number, and following a set numbered path, then every prisoner is guaranteed to open entirely different boxes, which means there's 0 chance of redundant choices in relation to the other prisoners.

Vor Tag## Simon Joubert

In simple terms, the reason this may be the best strategy is that it absolutely eliminates the risk of encountering the kryptonite of another prisoner’s 1/1 loop windfall, hence every box opened is guaranteed to be a potential strike.

Vor 12 Tage## Simon Joubert

(The discovery of the first box’s number closing the loop, where the possibility of discovering the second (or third…) box’s numbers is entirely eliminated)

Vor 11 Tage## Simon Joubert

I didn’t expound correctly on what I observed, but what I had noticed to be significant is that it does that in step one, and then eliminates the arising potential of opening a second (or third…) box that has within it a number that matches any previously opened box - of which there is a higher probability and would equally comprise a lost opportunity that could have been avoided 100/100 if this strategy were followed by all. This pathway ensures positive elimination upon every opening; as each paper number found guarantees that it’s corresponding box would certainly be a potential container of the sought after paper number, upon the certainty of that box not having within it the possible 1/1 of another prisoner, or the number corresponding to the / all prior boxes checked.

Vor 11 Tage## adolfo rodolfo

It is the best strategy, yes. The reason for that is not as simple as eliminating the chance of picking another prisoner's 1/1 loop, although it is true that the strategy does that.

Vor 11 Tage## Glasses

Until I reached the point where it said you could only search 50 times, I was like “couldn’t you just open all the boxes?”

Vor 15 Tage## Shadowriver

Moral is that its is more efficent to do things in some order then random. In general, this avoids same mistakes then others do

Vor 5 Tage