The Riddle That Seems Impossible Even If You Know The Answer

14,011,166
0
Published 2022-06-30
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:    • Solution to The Impossible Bet | The ...  
Vsauce2:    • The 100 Prisoners Puzzle  
Stand-up Maths:    • The unbelievable solution to the 100 ...  
TED-Ed:    • Can you solve the prisoner boxes ridd...  

▀▀▀
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
Thumbnail by Ignat Berbeci
Produced by Derek Muller, Petr Lebedev, and Emily Zhang

All Comments (21)
  • @pyguy9915
    Something seems wrong at 9:00 What is the probability of a loop of length 1? (Can't be 1/1) Length 2?
  • @wetbadger2174
    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.
  • @magdasg9571
    Memorizing this just in case I'm ever trapped in a prison with a sadistic mathematical prison warden
  • @reifrei1170
    really sad that these prisoners were so good at math and cooperation, yet still ended up in jail 😢
  • A really incredible feature of the loop strategy is comparing how well it works even against random guessing with more chances to open boxes. For example, if each prisoner were allowed to open 99 of the 100 boxes, instead of 50, to find their own number, the total probability of success by randomly guessing is only 0.99^100, or 36.6%! (Whereas the loop strategy gives a comparable chance of success while only opening 50 boxes, and succeeds 99% of the time if you can open 99 boxes) If you were allowed to open 98 of 100 boxes, the chance of winning via random guessing drops to 13.3%, and to below 5% for 97 boxes!
  • @DrDJX
    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.)
  • I think the chance of convincing 99 other prisoners that this strategy is their best chance of survival is much lower than 31%.
  • @cultofmel
    I was really confused at first on how whatever number you start with is guaranteed to be in your loop, but once I started to type out a comment questioning it I totally realized how it works. In order to finish your loop you have to end up back where you start, and since none of the boxes can be empty, you're guaranteed to be in some sort of loop.
  • @tfdtfdtfd
    The main point here is that "failing hard" comes with no harsher penalty than "failing little"....hence, you can redistribute your loss function to take advantage of this. Great video, btw!
  • @fixed-point
    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.
  • Imagine being the first inmate and not finding your number. “Oof, we tried”
  • Describing why the prisoners open the box with their number is the hardest part of this video. Destin asked a valid question "How do I know my number box is on the loop which contains my slip?" Once you visualize how it works, that question seems super silly to ask despite the brilliance of said question. It's the natural question to ask despite us all understanding and agreeing to the concept of loops and how they behave in this thought experiment. The first box opened is the only slip number that's guaranteed to be in that loop. Simply put, because loops are loops. If every slip correlates to the new box, you will inherently open boxes until you open a box that points you back to the initial box. Thus, you will find your slip. Thus, you complete the loop. Derek even says "you are always starting the loop directly after the slip with your number" or something similar. If you run the test a couple of times on a loop, you will see the pattern and why it all works. Warning: science below Let's suppose we have a loop of 15 numbers. Using a random number generator (RNG), we get the following 15 numbers: 8 68 1 27 70 94 76 71 12 84 21 45 97 58 37 These 15 numbers are both a collective of boxes and slips. Let's call the box numbers as they are currently listed: 8 68 1 27 70 94 76 71 12 84 21 45 97 58 37 The slip numbers, are exactly the box numbers but with a shift of 1 place. 68 1 27 70 94 76 71 12 84 21 45 97 58 37 8 Thus, the "paired loop" that Derek demonstrated with notecards would look like: 8 68 1 27 70 94 76 71 12 84 21 45 97 58 37 (Box number) 68 1 27 70 94 76 71 12 84 21 45 97 58 37 8 (Correlating Slip) Notice the diagonal correlation. The first box opened is the only slip number that's guaranteed to be in that loop but it's always going to be the last slip that is revealed. In this instance, prisoner 8 starts by opening box 8 and finishes when opening box 37 to reveal slip 8. All 15 prisoners who are a part of this loop will open exactly 15 boxes and always find their slip on the 15th box. In theory, the connecting 14 numbers could be anything but we know for certain what the first box number and the last slip number will be (see below) 8 xx xx xx xx xx xx xx xx xx xx xx xx xx xx (Box number) xx xx xx xx xx xx xx xx xx xx xx xx xx xx 8 (Correlating Slip) Prisoner 68 would start on box 68 generating the following variation of the same loop: 68 1 27 70 94 76 71 12 84 21 45 97 58 37 8 (Box number) 1 27 70 94 76 71 12 84 21 45 97 58 37 8 68 (Correlating Slip) Again, the only guaranteed slip to be in this loop is the number 68 slip which we find in the 15th box. 68 xx xx xx xx xx xx xx xx xx xx xx xx xx xx (Box number) xx xx xx xx xx xx xx xx xx xx xx xx xx xx 68 (Correlating Slip) Really hope this helps to clarify the question that many of us asked to ourselves while watching.
  • I feel like there needs to be a 'wow out loud' like 'laugh out loud', because when you said "that's like scaling up a millimetre to the diameter of the observable universe", that's exactly what I did.
  • @bscorvin
    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
  • If you think the riddle is hard, imagine trying to convince 99 fellow prisoners to follow the plan to the letter.
  • @TheDrCN
    When you first gave the solution, I sketched out on a piece of paper a version of the problem with 4 prisoners, 4 boxes, 2 attempts, and I feel like I understood the entire thing almost instantly with no further explanation required. I think lowering the numbers down to something more manageable makes the problem much more comprehensible. I mean, you could even write out 4! configurations if you wanted and prove that it works for all of them, whereas 100! is so large as to be impossible to visualize. I think it would have been helpful to include this simpler example in the video.
  • @basimqasim7113
    i made a smaller version of this riddle by decreasing the number of participants to 4 and i made artificial intelligence to randomly pick numbers for me with the loop strategy they succeeded 5 times out of 10 with random picking they didn't succeed in 10 trials. it was really fascinating.
  • @Bismuth9
    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.
  • @inemanja
    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.