The unbelievable solution to the 100 prisoner puzzle.

แชร์
ฝัง

ความคิดเห็น • 1.2K

  • @MinutePhysics
    @MinutePhysics 5 ปีที่แล้ว +612

    Nicely done! In case you want to see another version of this puzzle/explanation :)
    th-cam.com/video/eivGlBKlK6M/w-d-xo.html and th-cam.com/video/C5-I0bAuEUE/w-d-xo.html

    • @johnchessant3012
      @johnchessant3012 5 ปีที่แล้ว +4

      Yay! Crossover!

    • @hawktitan7896
      @hawktitan7896 5 ปีที่แล้ว +26

      Watching sciency TH-cam pays off. I knew the answer from watching this previously.

    • @black_platypus
      @black_platypus 5 ปีที่แล้ว +6

      Aaaah, that's where I knew that from!

    • @umanglunia2194
      @umanglunia2194 5 ปีที่แล้ว +6

      TED-ed had a similar riddle.

    • @juliusreiner5733
      @juliusreiner5733 5 ปีที่แล้ว +4

      I thought I was having deja vu

  • @TheRoyalInstitution
    @TheRoyalInstitution 5 ปีที่แล้ว +1460

    It was a pleasure to host you! Although, next time, maybe a spa retreat for our staff, instead of a prison, yes?

    • @chrispham6599
      @chrispham6599 4 ปีที่แล้ว +12

      But it's team building stuff! ( ͡° ͜ʖ ͡°)

    • @w3w3w3
      @w3w3w3 3 ปีที่แล้ว +7

      Super interesting! I only wish they teached math like this at school lol.

    • @glenmcgillivray4707
      @glenmcgillivray4707 3 ปีที่แล้ว +3

      Win a prize! A day of vacation at a staff retreat.
      Just pull your number from some drawers!
      In exchange, anyone who fails? Team building exercises. Same venue. The Whole Day.
      One variation on this, was everyone has two draws, they can communicate/interact, although the original had no speaking after a period of discussion.
      Prisoners ask to take one at a time, and draw their own number on the ground in front of them.
      Everyone gets out on the second round, by identifying exactly these loops after checking their own number and forming a second 'mixed' line by standing behind the number they found, allowing each person to locate their number.

    • @10001000101
      @10001000101 2 ปีที่แล้ว +2

      Asking for spa? Straight to gaol.

    • @XiXi-t5t
      @XiXi-t5t ปีที่แล้ว +1

      Not mentioning the time he was in a cave for chessboard puzzle

  • @Space_Reptile
    @Space_Reptile 5 ปีที่แล้ว +2042

    "prisons are great places for puzzles"
    Future Aperture Science project lead right there

    • @fsmoura
      @fsmoura 5 ปีที่แล้ว +97

      We do what we must, because we can.

    • @pedromira08
      @pedromira08 5 ปีที่แล้ว +48

      @@fsmoura For the good of all of us, exept the ones who are dead.

    • @RFC3514
      @RFC3514 5 ปีที่แล้ว +19

      And if at first you don't succeed, you fail.

    • @glados1750
      @glados1750 5 ปีที่แล้ว +37

      There will be cake!

    • @pedromira08
      @pedromira08 5 ปีที่แล้ว +23

      @@glados1750The cake is a lie!

  • @x0r1k
    @x0r1k 3 ปีที่แล้ว +117

    1:22 I like how the on-screen text start to appear, but interrupted

  • @aok76_
    @aok76_ 2 ปีที่แล้ว +75

    Just came here again after the reverse-Dereked incident. Thank you for all the content Matt! Very entertaining, educational and hilarious!

    • @fortunefavorsthebold3459
      @fortunefavorsthebold3459 ปีที่แล้ว

      Me too lol. Between the two vids, my likelihood of understanding this problem also went up from 1/1000 to about 1/3 as well, and now I can sleep finally thanks to you Matt for your as-always awesome explanations! I'm successfully un-reverse-Dereked!

  • @garetr
    @garetr 5 ปีที่แล้ว +94

    I wrote a Python program to play around with this, but rather than randomly sample permutations I just generated all of them. I set the prisoners to 100 without thinking about how big 100! is, and it immediately took all of my 8GB of RAM. I changed the list of permutations into a generator (so it didn't try to keep it all in memory), and only then realized that the outer-most of my three loops was trying to perform more iterations than there are Plank times before the heat death of the universe...

    • @timq6224
      @timq6224 2 ปีที่แล้ว +9

      in other news, 52! doesn't even fit in the universe, so your attempt was doomed.

  • @SoulOfNemiss
    @SoulOfNemiss 2 ปีที่แล้ว +44

    Would have been hilarious to have Derek using the Parker adjective on this one !

  • @andreacolongo8094
    @andreacolongo8094 5 ปีที่แล้ว +70

    Hi Matt, I hope you'll consider this little hint for the next riddle video. At the "pause now if you want to think for yourself" point, it is incredibly handful a graphic with a summary of the riddle rules. Really helpful.
    Thank you for spreading math stuff. Bye!

    • @stevethea5250
      @stevethea5250 2 ปีที่แล้ว +4

      2 years later..
      Veritasium did just that

  • @leoimrie
    @leoimrie 5 ปีที่แล้ว +94

    The limit is 1 - ln2. Solution here: en.wikipedia.org/wiki/100_prisoners_problem#Probability_of_success.
    Also, a fun version is where a prisoner is allowed to go in first to examine the contents of the drawers and make one swap. Then the survival rate is 100% as this prisoner can break any cycle greater than length 5 into 2 smaller cycles.

    • @johnchessant3012
      @johnchessant3012 2 ปีที่แล้ว +18

      This comment got featured in his new video, nicely done

    • @Ken.-
      @Ken.- 2 ปีที่แล้ว +1

      You mean length 50, right?

    • @zanti4132
      @zanti4132 2 ปีที่แล้ว +4

      When Matt found that the rate of success (as an aside, note that I am spelling "success" correctly here, with two c's) with a large number of prisoners always appeared to be around 31%, I'm genuinely shocked he didn't immediately think that ln 2 must be involved. I mean, doesn't ln 2 = .69... come up all the time in these types of problems?

    • @itismethatguy
      @itismethatguy 2 ปีที่แล้ว

      @@zanti4132 lol

    • @chessman88
      @chessman88 2 ปีที่แล้ว

      This is a nice version explaining that: th-cam.com/video/iSNsgj1OCLA/w-d-xo.html

  • @feliciabarker9210
    @feliciabarker9210 5 ปีที่แล้ว +41

    I originally heard about this a couple of days before my birthday this year, and spent my entire birthday party re-explaining it to each new guest that arrived.

  • @guiorgy
    @guiorgy 2 ปีที่แล้ว +11

    12:50 Came from Dereks' (Veritasium) video to find another Parker Square statement

  • @alexsoussani1936
    @alexsoussani1936 5 ปีที่แล้ว +637

    No one forgot the +C when integrating? Impressive!

    • @sevret313
      @sevret313 5 ปีที่แล้ว +71

      That's the reason Matt Parker is there with them.

    • @LegolasnGimli
      @LegolasnGimli 5 ปีที่แล้ว +52

      @@sevret313 a Parker Integral

    • @mikhailvolkov8370
      @mikhailvolkov8370 5 ปีที่แล้ว +3

      My first thought too 😂

    • @louismyers8845
      @louismyers8845 5 ปีที่แล้ว +38

      i actually did (prisoner number 7) but they read out the wrong crime!

    • @georgplaz
      @georgplaz 5 ปีที่แล้ว +19

      who cares about constants? they are soo boring. nothing ever changes

  • @lehpares
    @lehpares 5 ปีที่แล้ว +183

    Three Blue, One Brown is a national treasure. Agree!

    • @Macieks300
      @Macieks300 5 ปีที่แล้ว +35

      he said international

  • @CrittingOut
    @CrittingOut 3 ปีที่แล้ว +63

    The reasoning at the end for them being there is too funny

  • @brenthooton3412
    @brenthooton3412 5 ปีที่แล้ว +90

    12:50 If you have more and more prisoners, you would have more and more drawers, and it would take them more and more time to go through those drawers, so the upper limit is that the prisoners start to die out of old age before being able to test the hypothesis.

    • @jetison333
      @jetison333 5 ปีที่แล้ว +11

      It's true, but luckily in maths jail pesky things like old age and common sense aren't around :)

    • @kallewirsch2263
      @kallewirsch2263 5 ปีที่แล้ว +2

      Hmm. Some sort of "Hilbert prison"?

    • @Debbiebabe69
      @Debbiebabe69 4 ปีที่แล้ว +3

      Havnt you ever watched shawshank redemption?
      Roughly - 'It will take a long long time to tunnel through this reinforced armourcrete wall with a toothbrush, but thankfully time is something I have a lot of on my side'....

  • @MitchellD249
    @MitchellD249 3 ปีที่แล้ว +43

    "Later, later. Honestly, can you believe this guy, always going on about his book? On an unrelated note, Humble Pi is available now in a bookstore near you!"

  • @MrSigmaSharp
    @MrSigmaSharp 5 ปีที่แล้ว +34

    The crimes at the end was hilarious. You are the best Matt

  • @Math5D
    @Math5D 5 ปีที่แล้ว +89

    12:52 It's not an open bit. It is known, and the limit is exactly 1-ln(2)

    • @zanti4132
      @zanti4132 5 ปีที่แล้ว +10

      Interesting. 1 - ln 2 = .30685... Surely Parker is blowing smoking when he claims there is no known solution.

    • @titip1995
      @titip1995 5 ปีที่แล้ว +1

      Intrigued.. What is the proof of that?

    • @vincentpelletier57
      @vincentpelletier57 5 ปีที่แล้ว +9

      In the description, Matt corrected that "We do know there is a limit I believe, but we don't know what it is." So, yeah, knowing how to prove that would be great.

    • @zanti4132
      @zanti4132 5 ปีที่แล้ว +7

      I'm betting it has something to do with the convergence of the series 1 - 1/2 + 1/3 - 1/4 + 1/5 - 1/6 + .... to ln(2).

    • @Math5D
      @Math5D 5 ปีที่แล้ว +23

      Actually, the proof can be found on Wikipedia, so I won't copy it here in total. But you can very easily show, that with N prisoners, the probability of having at least a cycle of length D>N/2 (and this implies, there is only exactly one of those, which makes it so easy) is just 1/D. So the winning probability is 1 - sum(1/D for D from N/2 to N) = 1 - H(2n) + H(n), which has the claimed limit.

  • @johnchessant3012
    @johnchessant3012 5 ปีที่แล้ว +24

    Great video! I first saw this puzzle from minutephysics but your explanation was very clear.
    Is it really an open problem of what the limit is? I worked out that the probability for 10 prisoners is 1 - (1/6+1/7+1/8+1/9+1/10), which is indeed 35.44%. From that I'd guess the probability for 2n prisoners is 1 - (1/(n+1)+...+1/(2n)), which tends to 1 - log(2).
    Also, the reasons your math prisoners were put in prison are hilarious! Regarding the pi vs. tau guy, I'd say an opinion without pi is an onion. I myself spent a few years in math prison, for saying that a 4-d dog got into my locked trunk and ate my homework.

  • @KartheekTammana123
    @KartheekTammana123 5 ปีที่แล้ว +56

    For anyone who's wondering, that 35.43% chance isn't that hard to derive.
    The total number of permutations for a loop of size 6 is (10C6)*(5!)*(4!), or (number of ways to choose 6 elements for the loop)*(number of ways to order the 6 elements in a loop)*(number of ways to order the remaining 4). This works out to 10!/6, and since there are 10! total permutations, the probability of a loop of size 6 is 1/6. Similar logic works for loops of length 7, 8, 9, and 10.
    So 1/6 is the probability of a loop of size 6, 1/7 for a loop of size 7, and so on. As long as none of these exist (and only one can exist at a time), the prisoners are free. So the final probability works out to be
    1-(1/6+1/7+1/8+1/9+1/10)=35.4365%
    This should generalize if you have 2n prisoners and n guesses each, which will give a probability of:
    1 - (1/n+1 + 1/n+2 + 1/n+3 ..... + 1/2n)

    • @AngryArmadillo
      @AngryArmadillo 5 ปีที่แล้ว +22

      Kartheek Tammana I agree with your derivation. Your final expression can be written in terms of the harmonic series as 1 - (H_2n - H_n). As n goes to infinity, the limit goes to 1 - ln(2).

    • @PiercingSight
      @PiercingSight 5 ปีที่แล้ว +8

      Well, there we go! Open problem closed!

    • @HYOKSU1
      @HYOKSU1 5 ปีที่แล้ว +9

      So why Matt says @ 12:50 no one knows what happens if we increase the number? You should let him know as he is asking at the end of the video. Thanks for the derivation!👌🏻👍

    • @patrickwienhoft7987
      @patrickwienhoft7987 5 ปีที่แล้ว +19

      @@HYOKSU1 Idk why Matt said this, it's very well known to approach 1 - ln(2) as the derivation isn't too hard. It even says it on the wikipedia page: en.wikipedia.org/wiki/100_prisoners_problem#Asymptotics

    • @brachypelmasmith
      @brachypelmasmith 5 ปีที่แล้ว

      thanks

  • @BASEBALLFURIES.
    @BASEBALLFURIES. 3 ปีที่แล้ว +112

    prisoner 11- the guy who wrote dreams paper and forgot the closing bracket

  • @Flare3924
    @Flare3924 5 ปีที่แล้ว +25

    The fact that number 6 is wearing a "How do you want to do this?" shirt just brings a smile to my face.

    • @diarya5573
      @diarya5573 3 ปีที่แล้ว +1

      Howdydoodiedoodis

    • @alexandermcclure6185
      @alexandermcclure6185 6 หลายเดือนก่อน

      @@diarya5573 It gave me the option to translate, and changed nothing? bruh

  • @Anvilshock
    @Anvilshock 5 ปีที่แล้ว +164

    13:50 "draws infinity as two circles next to each other" … says the guy who writes the letter x as two _half_ circles next to each other …

    • @RFC3514
      @RFC3514 5 ปีที่แล้ว +11

      I'll get the rope.

    • @Anvilshock
      @Anvilshock 5 ปีที่แล้ว +12

      @@rosiefay7283 "is the usual way"[citation needed]

    • @PhilBagels
      @PhilBagels 5 ปีที่แล้ว +8

      @@rosiefay7283 Yeah, it's the usual way - if you're some kind of sick freak!

    • @bordershader
      @bordershader 5 ปีที่แล้ว +10

      How are you supposed to distinguish it from × if you write x?

    • @Anvilshock
      @Anvilshock 5 ปีที่แล้ว +7

      @@bordershader You know, one of the very first things taught when you enter school is handwriting. If by the time you start needing the sign for (cross) multiplication you can _still_ not write characters legibly enough to distinguish × from x, you've got other problems entirely. It's not the responsibility or even the job of Maths' typography to fix your chicken scratches.

  • @Music_Engineering
    @Music_Engineering 3 ปีที่แล้ว +16

    The philosophy of this problem is left as an exercise for the viewer

  • @upsidedownwhale
    @upsidedownwhale 5 ปีที่แล้ว +4

    I've heard of this strategy but never understood the logic behind it, and now I do. Another great video, thanks Matt!

  • @zuphix1802
    @zuphix1802 3 ปีที่แล้ว +3

    My strategy was: Each person looks at their own number on round 1, and go to the left if the number was odd, go to the right if their number was even. For round 2, each person would have a list of 5 drawers which contain either odd or even, depending on which one they're searching for, which leaves 5 boxes to check and they have 4 rounds left. They've already had a 1/10 chance to get it right and now they have 4x 1/5 chances. For round 2, each person will start searching for their own number, or they can skip if they already found it. They go to the left if the number they picked from round 1 was 1-5 or go to the right if the number was 6-10. Now people have had a 1/10 chance at finding it randomly, a 1/5 chance at finding it in half of the group. They can cross-reference their list of 5 numbers from before with the numbers above or below 5. Best worst-case scenario they have an odd number 1-5 or an even number 6-10 and have 3 more numbers to check with 3 attempts remaining.
    Then I un-paused the video and realized I misunderstood the rules.

  • @jessecook9776
    @jessecook9776 5 ปีที่แล้ว +217

    "Successful" is misspelled - a classic Parker square moment.

    • @janikarkkainen3904
      @janikarkkainen3904 5 ปีที่แล้ว +13

      Came for this comment, was not disappoint.

    • @JollyTurbo1
      @JollyTurbo1 5 ปีที่แล้ว +8

      Isn't "drawers" also misspelled in the thumbnail as "draws"

    • @jackradzelovage6961
      @jackradzelovage6961 5 ปีที่แล้ว +2

      math and english arent on the same plane lol

    • @imagineaworld
      @imagineaworld 4 ปีที่แล้ว

      Himme witha time stamp my boi

  • @plassbakkallen
    @plassbakkallen 2 ปีที่แล้ว +7

    12:50 - The Parker Fun Fact

  • @3Ppaatt
    @3Ppaatt 5 ปีที่แล้ว +133

    My idea for landing in Maths jail "let epsilon be less than zero".

    • @ZedaZ80
      @ZedaZ80 5 ปีที่แล้ว +24

      I feel like "let epsilon equal 0" is far more scandalous.

    • @brendanh8193
      @brendanh8193 4 ปีที่แล้ว +3

      Or the optimistic/pessimistic probability pair: (p>1, p

    • @christianosminroden7878
      @christianosminroden7878 3 ปีที่แล้ว

      Let ε be greater than 1.

    • @vsiegel
      @vsiegel 3 ปีที่แล้ว

      @@ZedaZ80 No, not more scandalous, but it hurts more, I can feel ist!

  • @DerNesor
    @DerNesor 4 ปีที่แล้ว +12

    I was really getting ready to work out why you get a full cycle in 10% of cases . Then I wrote down one line and had 9! options and was sad I was done...

  • @trizgo_
    @trizgo_ 5 ปีที่แล้ว +58

    "Takes place in the Maths Prison!"
    Ah, so my Calc 2 classroom

  • @Liamneedham29
    @Liamneedham29 5 ปีที่แล้ว +70

    Hey that guy has a How Do You Wanna Do This? Shirt. Hes a Critter!!

    • @hatgloves8948
      @hatgloves8948 5 ปีที่แล้ว +24

      Guilty as charged! Given the problem I thought it would be appropriate.
      I'm also a huge Prisoner fan which is why I made sure to get number 6. Had to swap my original number out. Everyone else there was too young to appreciate the significance so they didn't mind! Fun fact: I share a birthday with both The Prisoner and Patrick McGoohan, 19th March

    • @JorgetePanete
      @JorgetePanete 5 ปีที่แล้ว +1

      He's*

    • @nymalous3428
      @nymalous3428 5 ปีที่แล้ว

      Hat Gloves Great, now I've got to look up the Prisoner.

    • @girv98
      @girv98 5 ปีที่แล้ว +4

      Bidet!

    • @katiemiller8313
      @katiemiller8313 5 ปีที่แล้ว +1

      Yup... I was about to post "Found the Critter," but I figured someone else would've also noticed. :D

  • @Jaabo37
    @Jaabo37 5 ปีที่แล้ว +106

    Fascinating maths. Also the crimes were too

    • @gordonrichardson2972
      @gordonrichardson2972 5 ปีที่แล้ว +2

      Yes, #10 wrongly rounding down is regarded as a crime by some...

    • @Danilego
      @Danilego 5 ปีที่แล้ว +7

      Biggest crime was disliking a 3blue1brown video!

    • @KuraIthys
      @KuraIthys 5 ปีที่แล้ว

      Dividing by zero.
      Totally worth it. XD

    • @gordonrichardson2972
      @gordonrichardson2972 5 ปีที่แล้ว +3

      @@KuraIthys Judging by their expressions, I would say the culprits were unaware of the 'crimes' that they were responsible for.

    • @iprice77
      @iprice77 5 ปีที่แล้ว +4

      Haha, number 4 looks shocked at the accusation :D

  • @martinmackey7191
    @martinmackey7191 5 ปีที่แล้ว +22

    Variant: after the warden arranges the cards, the janitor gets to inspect all of them. Then janitor has strategize with the prisoners beforehand. After examining, the janitor may switch two cards, but doesn't have to. He then exits the prison without telling the prisoners what he did, then they begin. Question: what should the janitor do?
    Answer, spoiler alert: if the janitor finds a cycle greater than 5, he switches two cards at opposite ends of the cycle, creating two smaller loops, neither larger than 5, ensuring victory for the prisoners.

  • @PinochleSundae
    @PinochleSundae 2 ปีที่แล้ว +1

    I'm proud to say I finally solved one of these puzzles without any hints--I worked out that when n = 4, guessing randomly gives the team a 1/16 chance of winning, but the "follow the trail" strategy ups the chances to 10/24, which extends in principle to any n.

  • @VeniVidiVelcro
    @VeniVidiVelcro 5 ปีที่แล้ว +398

    Let's hope the limit spells out the digits of pi...

    • @ostrich_dog
      @ostrich_dog 5 ปีที่แล้ว +4

      That'd be interesting

    • @ragnkja
      @ragnkja 5 ปีที่แล้ว +27

      VeniVidiVelcro
      It’s more likely to be 1/e

    • @SpencerTwiddy
      @SpencerTwiddy 5 ปีที่แล้ว +30

      Nillie that was my initial thought, but since it was seeming to get lower from 31% and 1/e is 37% I doubt that's right

    • @SpencerTwiddy
      @SpencerTwiddy 5 ปีที่แล้ว +8

      VeniVidiVelcro pi/10 also seems unlikely but would be so cool

    • @conoroneill8067
      @conoroneill8067 5 ปีที่แล้ว +91

      The limit is 1-ln(2), as explained in this link: datagenetics.com/blog/december42014/index.html
      standupmaths must have just made an error or received an incorrect bit of information, which happens.

  • @lmgjerstad
    @lmgjerstad 4 ปีที่แล้ว +2

    For the probability question posed around minute 13, it actually seems relatively simple.
    A losing combination is any combination containing a cycle larger than n/2. We also know that, for each cycle length in that range, there can be no other cycle of size > n/2. This property is useful to avoid double counting.
    For a given cycle of length k such that k > n/2, there are n!/(n-k)! possible permutations. However, we need to restrict that, since, in making it a cycle, all permutations that differ only by the starting point are equivalent. (1,2,3,4 === 2,3,4,1) There are k possible starting points within the cycle, so the number of possible cycle permutations of size k is n!/k(n-k)!
    For the remainder of the cards that are not part of the cycle, there are n-k cards, and n-k slots, so there are (n-k)! permutations of those cards for a total of n!/k(n-k)! * (n-k)! or simply n!/k.
    Given that there are n! possible permutations in the original problem, we can now see that the probability of a cycle of length k existing is (n!/k) / n! or simply 1/k, as long as k > n/2.
    Since any k larger than n/2 loses, then the probability of losing is SUM(1/k, n/2+1, n)

  • @RJSRdg
    @RJSRdg 3 ปีที่แล้ว +10

    Also - although the prisoners can't communicate with each other, if they can see the other prisoners opening the drawers using the pattern described (i.e. your own number, then the number that is in that drawer etc), they can work out which cards are in which drawers, which simplified the odds.

    • @michaelgould6198
      @michaelgould6198 2 ปีที่แล้ว

      This will actually work. If you see that the ten goes to 1 (you can peek or just memorise where they took their number from, and where they picked the next number) then you can find each specific loop, and then know which cards are where.

  • @bug8502
    @bug8502 10 หลายเดือนก่อน

    Thanks for using the visual, it made the reasoning clear to me.

  • @UnReaLgeek
    @UnReaLgeek 4 ปีที่แล้ว +11

    “How did you get into math prison?”
    “I attempted to trisect an angle using only a non-Euclidean compass and straightedge”

  • @Gold161803
    @Gold161803 5 ปีที่แล้ว +1

    For l=51,52,53,... the probability that the longest loop is of length l is 1/l. The sum of 1/k to 1/2k approximates the integral of the reciprocal function from k to 2k, so as the number of prisoners gets large, the probability of failure tends to ln(2).

  • @hermannmuller7146
    @hermannmuller7146 5 ปีที่แล้ว +33

    This reminds me on how i tried to find the gamecube cd of the game i wanted to play.

    • @lyrimetacurl0
      @lyrimetacurl0 5 ปีที่แล้ว

      lol

    • @omikronweapon
      @omikronweapon 5 ปีที่แล้ว +3

      just don't stack those suckers. I once opened ALL my boxes several times before I noticed the game I wanted was UNDER another disc.

    • @shane8037
      @shane8037 3 ปีที่แล้ว

      Relatable.

  • @MJWhitfield
    @MJWhitfield 4 ปีที่แล้ว +1

    For the limit as the number of draws tends to infinity, doesn't it just tend to 1-ln(2). Because you only fail if there is a cycle that is bigger than half the number of draws, and there can only be one such cycle so you just sum the probability for each possible cycle size. It is relatively straightforward to calculate the probability of getting a cycle of length m as 1/m (assuming that m is greater then half the number of draws); so this gives us a fairly simple formula for the probability of not succeeding. For example the probability of not succeeding for 10 draws is 1/6+1/7+1/8+1/9+1/10 ≈ 0.645635.
    For the case of picking opening n draws out of a total of 2n draws, we can rewrite the probability of getting a cycle length of n+m (where 1

  • @Dartnix
    @Dartnix 4 ปีที่แล้ว +4

    "ALL SUCESSFUL" you didn't think I wouldn't notice, Matt

  • @MrMomoro123
    @MrMomoro123 5 ปีที่แล้ว +2

    For the bonus puzzle:
    Pick a number from 1 to 10 to start with, it makes no difference which one.
    The next number could be that same number (1/10) or a different number (9/10). Say it's a different number. The next number could be the first number and close the loop (1/9) or one of the remaining 8 numbers (8/9), etc. So we have (9/10) * (8/9) * (7/8) * ... * (1/2) = 9! / 10! = 1/10

  • @jackriordan1535
    @jackriordan1535 5 ปีที่แล้ว +29

    He's Micheal Sheen......why is he literally just Micheal Sheen?

    • @thomasshort182
      @thomasshort182 5 ปีที่แล้ว +1

      Jack Riordan thank you
      I was trying to find out who he liked like. It was annoying me soo much

  • @juancappa3838
    @juancappa3838 3 ปีที่แล้ว +1

    In the reference below there is an exposition of the problem for general n with a complete solution (it is proved that the strategy shown in this video is optimal and the probability of success tends to 1-ln2 as n goes to infinity). There's also a bit of history of the problem and some generalizations.
    E Curtin and M Warshauer: The locker puzzle, in The Mathematical Intelligencer vol 28, number 1 (2006).

  • @kallewirsch2263
    @kallewirsch2263 5 ปีที่แล้ว +5

    I was surprised that no one committed the crime of having an odd number of sign faults.

  • @GeekyNeil
    @GeekyNeil 5 ปีที่แล้ว

    I found a nice way of working out the probability of the chain strategy failing and some simple bounds for it.
    We want to know the probability that there is a chain of length L when there are N card and N/2

  • @girv98
    @girv98 5 ปีที่แล้ว +7

    14:04 Number 6 is a critter confirmed

  • @jerryplayz101
    @jerryplayz101 4 ปีที่แล้ว

    8:55 Regarding the cycle, if you can remember the cycle of cards ( or which draw every person before you pulled, and in what order) you could separate the cycle in smaller "semicircles" removing the numbers that others had been released on, and thus help everyone succeeding you to cut down on the number of possibilities.

  • @FlorianLinscheid
    @FlorianLinscheid 2 ปีที่แล้ว +7

    Got Derek'd again, Matt

  • @TheBetterVersion
    @TheBetterVersion 5 ปีที่แล้ว +2

    First, in 2n prisoners, let's observe that the probability of having a chain of length k (k > n) is 1/k
    P(not finishing too early) * P(returning exactly) = [(2n-1)/(2n) * (2n-2)/(2n-1) * ... * (k-1)/(k)] * [1/(k-1)]
    so that solves problem #1
    The chance of winning is 1 - [1/(n+1) + 1/(n+2) + ... + 1/(2n)] which can be calculated because
    H(n) = sum from 1 to n of 1/n
    A(2n) alternating H(2n) = H(2n) - 2 * H(n) / 2 = H(2n) - H(n)
    So we get the success rate = 1 - [H(2n) - H(n)] = 1 - A(2n) which approaches 1 - ln(2)

    • @Absynthexx1
      @Absynthexx1 3 ปีที่แล้ว

      Does the success rate change if they follow a different set of rules but stick to those rules? Like, what if they agreed that all the "prisoners" would only select the 5 left side drawers every time? Another way of posing the questions is, 'was the increase in their success rate a result of the method employed, or is it inherent to the parameters of the 'game'?

  • @hart-of-gold
    @hart-of-gold 5 ปีที่แล้ว +6

    So, What are you in for?
    "I used to write italic x as a wiggly line crossed by a straight line. For all those years, I was a monster writing chi not x."

  • @randomcreek
    @randomcreek 5 ปีที่แล้ว +2

    Love the ending bit!

  • @pyglik2296
    @pyglik2296 5 ปีที่แล้ว +8

    For a moment I thought his shirt is also a math's puzzle.

  • @chessandmathguy
    @chessandmathguy 2 หลายเดือนก่อน

    Great content, Matt! Thanks for posting!

  • @arlo100_at_jahoo
    @arlo100_at_jahoo 2 ปีที่แล้ว +3

    Since I'm horrible at math, I can only contribute this practical suggestion: If you use opaque boxes with protrusions instead of cutouts to open them, you could place the cards in the boxes face up and it would be quicker and easier to run the experiment (no need to take anything out to flip it)

  •  5 ปีที่แล้ว +1

    I loved that finish. As more of a purist by heart but trained to program, I could relate. 😉

  • @zipekci
    @zipekci 5 ปีที่แล้ว +9

    It is really impressive how you can tell this in a so complicated way.

    • @havewissmart9602
      @havewissmart9602 5 ปีที่แล้ว +3

      ???

    •  5 ปีที่แล้ว +1

      i thought this, explaining the puzzle when theyre going back and forth from each other had me baffled.

  • @dv_xl
    @dv_xl 5 ปีที่แล้ว +2

    number 6 has a "how do you want to do this" shirt ❤️ critters in the wild are great

  • @enotdetcelfer
    @enotdetcelfer 5 ปีที่แล้ว +6

    And that folks, is how you get the dot in Jeremy Bearimy

  • @KipIngram
    @KipIngram ปีที่แล้ว

    This is a great puzzle, though of course what is interesting about it is their strategy. Looking forward to learning it...

  • @5hirtandtieler
    @5hirtandtieler 5 ปีที่แล้ว +20

    Great video! But might wanna tone down the level of the transitions (esp the one before 1:30) 😅

  • @shoo7130
    @shoo7130 2 ปีที่แล้ว

    Came here to make a reference to Sattolo's shuffle algorithm. Accidentally solved the puzzle @11:28 without having an opportunity to think about it.
    Sattolo's algorithm guarantees a full cycle every time, and it's only the subtlest modification on proper Fisher-Yates so people can easily do it by accident. This video demonstrates how a careless bug in a shuffle algorithm COSTS LIVES!

  • @David_Kinsler
    @David_Kinsler 2 ปีที่แล้ว +8

    Veritasium anyone?

  • @tzampini
    @tzampini 2 ปีที่แล้ว

    This is absolutely mind-blowing

  • @TheFarCobra
    @TheFarCobra 5 ปีที่แล้ว +3

    Genuinely thought that was Michael Sheen for a second there.

  • @ralp3649
    @ralp3649 5 ปีที่แล้ว +1

    The probabilities shown in the video can be gotten with the equation:
    probabilityOfSuccess( k ) = 1 - SUM( 1 / n ; n = k / 2 ; n = k )
    Although this is a guess as to what the correct equation is, if someone can show the probability of a ring of size n occurring is 1/n (for atleast n>k/2), that would mean this solution is correct as this asks how many of the combinations of answers has a loop of size n.

    • @samuelesommariva6073
      @samuelesommariva6073 5 ปีที่แล้ว

      It is correct and can be proven.
      I use the same example with ten prisoners, but it can easily be extended. Let's find the probability of failure: we have to count all the rings longer than 5.
      Let's compute the probability of the longest ring =7 (for example)
      How many arrangements can you make if max length ring =7?
      Choose 7 cards out of 10 to make the ring =10!/(7!*3!) (ten choose 7)
      Count in how many way you can place those 7 cards in a loop (remember: they cannot form a ring of length

  • @Janokins
    @Janokins 5 ปีที่แล้ว +5

    Who doesn't like a good old linked list?

  • @drow27
    @drow27 2 ปีที่แล้ว +2

    @12:51
    I do think there's a limit...

  • @00blaat00
    @00blaat00 5 ปีที่แล้ว +13

    "Didn't pick a side in the Pi vs Tau debate ... Picked the wrong side in the Pi vs Tau debate."

    • @kutsen39
      @kutsen39 3 ปีที่แล้ว

      To be honest it kinda annoys me a little to find out that tau is 2pi, when it should be pi on 2, since the character tau is half of the character pi

  • @muthuvrpn
    @muthuvrpn 5 ปีที่แล้ว +1

    It tends to 1 - ln(2) = 0.307 as the number of prisoners tend to infinity, Isn't it? It's also known for the case of 'n' prisoners, the strategy gives a surviving probability of 1 - (H_(n) - H_(n/2)) where H_n is the Harmonic number..

  • @ostrich_dog
    @ostrich_dog 5 ปีที่แล้ว +45

    I shouldn't have watched VSauce2's video on this

    • @bronsolo6941
      @bronsolo6941 5 ปีที่แล้ว +5

      I thought the same thing. I was like, "oh I know this!"

    • @TunesByAI2024
      @TunesByAI2024 5 ปีที่แล้ว +2

      Same. I didn't even know there was other solutions for this. 😅

  • @Uristqwerty
    @Uristqwerty 5 ปีที่แล้ว

    I don't know if anyone remarked on it (too many comments to bother checking ), but if you don't have to pick one of the drawers you looked at, then you can assume any incomplete loop is 6 long, and blindly choose the next drawer in the loop, which would give a slightly better chance of success. Each individual has a 50% chance of knowing the right drawer, but still a 1/5 at guessing from among the remainder. So really, I think you're being generous and giving them a bonus card view, as if you *want* them to succeed!

  • @beliasphyre3497
    @beliasphyre3497 5 ปีที่แล้ว +49

    I'd probably be in maths jail for being a six offender.

    • @aBetterMove
      @aBetterMove 5 ปีที่แล้ว +8

      Why was 6 afraid of 7? 6 has General Anxiety Disorder. He attends CBT workshops and counselling twice a week and is doing great. 7 doesn't really eat numbers; that's just a vicious rumour that 4 spread. 7 is however a maniacal arsonist. 🔥

  • @cosmicjenny4508
    @cosmicjenny4508 5 ปีที่แล้ว +1

    Is it me, or does Alex look a bit like our own Steve Mould? Hmm.
    Great little puzzle! I first heard it from Kevin from Vsauce2, but haven’t heard the breakdown before.
    Loving the shirt, Matt!

  • @jamesonsanders8838
    @jamesonsanders8838 2 ปีที่แล้ว +7

    Anyone here after Veritassium?

  • @mauriziovalesani
    @mauriziovalesani 4 ปีที่แล้ว

    Great T-shirt #6! May the Traveler be with you.

  • @gerritroseboom8621
    @gerritroseboom8621 5 ปีที่แล้ว +6

    I am upset that "forgot to add +C while integrating" isn't in the list of crimes...

  • @fabianglathe6131
    @fabianglathe6131 ปีที่แล้ว

    So I wasn’t able to solve the puzzle, but what stood out to me, was that the strategy they described, was the strategy I used to search for CDs and DVDs. Because I would always just put them in whatever box was lying around, the name on the case and what’s actually inside rarely matched up, but with the loop strategy I was always able to find them! I didn’t know why it worked until i watched this video :D

    • @peorakef
      @peorakef ปีที่แล้ว

      umm, any strategy of opening your cases works. literally open them randomly, because in your case, n=1

    • @NoNameNoWhere
      @NoNameNoWhere ปีที่แล้ว

      The loop strategy greatly reduced the number of boxes I had to open.
      Unfortunately, the loop strategy broke down when I would open a case and it would be empty - some disk laying around somewhere.
      I've matured since then. lol

  • @louismyers8845
    @louismyers8845 5 ปีที่แล้ว +3

    im prisoner number 7 - i actually forgot the +c which they didn`t mention

  • @coolnoah8183
    @coolnoah8183 3 ปีที่แล้ว +2

    My sokution, which requires the prisoners to be able to see each other is to have some indicator for the next prisoner (i.e. where you stand afterwards) on whether or not you saw their number too, then they just check the same 5 or the other 5. That way it can only fail on the first prisoner and no others if the first prisoner passes, so the odds of them winning are just 50/50

    • @irrelevant_noob
      @irrelevant_noob 3 ปีที่แล้ว

      It can still fail, if some prisoner has a very short cycle and can't provide any helpful information to the next one. :-B
      But it is indeed an improved version of the strategy. 👍

    • @coolnoah8183
      @coolnoah8183 3 ปีที่แล้ว

      @@irrelevant_noob Not necessarily, if they didnt see the next persons number, then the next person knows not to pick any cards the other person picked, which takes 5 options away from a total 10, leaving 5 options, of which they will see their card

    • @irrelevant_noob
      @irrelevant_noob 3 ปีที่แล้ว +1

      @@coolnoah8183 except you don't explain WHICH 5 cards you go through if the loop length is small (like 1, 2, or 3)... And another flaw in your story: how do you know WHICH are the 5 cards the previous player looked through, so that you could choose the 5 "left" options? (And even if you get lucky and find your own number in there, how would you tell the next player whether you looked through your own loop, or the previous player's?) -.-

    • @coolnoah8183
      @coolnoah8183 3 ปีที่แล้ว

      @@irrelevant_noob That's what I mean that my solution is conditional, it requires this exact setup where the next players in line can actually see what the person before them is doing (i.e. which drawers they search). I understand it's not an elegant solution and I posted it in the opportunity to pause, before they gave away the solution

    • @irrelevant_noob
      @irrelevant_noob 3 ปีที่แล้ว +1

      @@coolnoah8183 oh, i thought you just needed the final bit on info, whether it was found or not. And really... talking about it made me realize that it *_is_* indeed all you need: you could in fact not use the loop strategy at all, just have the 1st player check boxes 1 through N/2, and signal whether "2" was in there or not. And every other player would signal which half to search, based on whether they saw p+1 or not. Which gets you back to 50-50. Neat!

  • @toxications
    @toxications 5 ปีที่แล้ว +3

    Okay, so the rules aren't really clear to me, I like thinking outside of the box. Assumptions:
    1. Prisoners know the order in which they are going.
    2. Although no communication, they can see each other during the test.
    If assumptions apply, this would be my solution:
    - The first prisoner looks at the left five cards.
    - Aside from their own number, the prisoner also looks for the number for the next prisoner.
    - If the number of the next prisoner has been found, the prisoner faces them. If the number hasn't been found, they turn their back towards them.
    - The next prisoner goes to take a look and if the previous inmate is facing them their number is in the left pile, if they do not face them it's in the right.

  • @Ruddigore
    @Ruddigore 5 ปีที่แล้ว

    Great video and signed/verified order placed for Alex Bellos;s new book 👍

  • @dreamingwolf8382
    @dreamingwolf8382 5 ปีที่แล้ว +31

    The fact that each person can observe what the others open will skew the result

    • @insoYT
      @insoYT 5 ปีที่แล้ว +3

      This. This was going to be also part of my plan until i realized that it wasn't really part of the puzzle. :p

    • @nopetuber
      @nopetuber 5 ปีที่แล้ว

      Sorry why is that? They are allowed to plan a common method.

    • @conoroneill8067
      @conoroneill8067 5 ปีที่แล้ว +1

      @@nopetuber Say you were the last person to go, and you saw that no-one had yet picked one of the drawers - you would have to pick that drawer, or else it would be guaranteed that at least one person would not have found their card. As such, it is a different problem when people are allowed to observe than not. I don't know if being able to observe allows for a better solution than the optimal strategy shown here, though (I doubt it).

    • @ragnkja
      @ragnkja 5 ปีที่แล้ว

      Conor O'Neill
      If nobody had picked a specific drawer, that must have been the drawer with your number on it, which means it doesn’t matter if you saw the other prisoners open their drawers.

    • @nopetuber
      @nopetuber 5 ปีที่แล้ว

      ​@@conoroneill8067 If you choose the correct strategy, there's only one last drawer left for you to pick -- the one marked with your prisoner number. Maybe you mean if by any chance they go with a different strategy (which is quite likely going to fail anyway).

  • @screwball1010
    @screwball1010 3 ปีที่แล้ว

    Finally a question on this channel I can answer.
    Blackstone's formulation says, "It is better that ten guilty persons escape than that one innocent suffer."
    I also agree that it is a good to punish the wicked, but it is a greater good to protect the innocent. If we assume all the criminals are in prison justly it is unjust to release them without cause.
    If the reason for killing them is because someone else failed a task, it would be unjust to do so. However, if it is the case that the solving of the puzzle is part of the original sentencing for their crime (assuming the original sentencing was just) it would not be unjust to kill them for the failure of one. In such a case,, the offering of the opportunity for freedom would actually be an extension of grace.

  • @lordkazzakgeneral
    @lordkazzakgeneral 5 ปีที่แล้ว +15

    Matt, I would appreciate if you didn't turn your videos' volume level so low. My old(ish) laptop is struggling to keep up and i was really looking forward to watching your video while having dinner. Thanks!

    • @joeeeee8738
      @joeeeee8738 5 ปีที่แล้ว +2

      Fix your laptop, don't blame him

    • @ashtonhoward5582
      @ashtonhoward5582 5 ปีที่แล้ว +2

      @@joeeeee8738 that's a bit rude. Not everyone can get their laptop fixed. And it doesn't necessarily need to be fixed, the speakers could just be kinda quiet to begin with.

    • @ashtonhoward5582
      @ashtonhoward5582 5 ปีที่แล้ว +1

      You should find some laptop speakers. They should be cheap, and most can get pretty loud.

    • @joeeeee8738
      @joeeeee8738 5 ปีที่แล้ว +1

      @@ashtonhoward5582 it may sound rude but it's true. See how "if you didn't turn your videos volume level so low" sounds. That's basically saying it's Matt's fault and not his fault for having bad sound. Even worse is this! : "I was looking forward to watching your video while having dinner" like "your low volume has brought me only disappointment" when it should be the opposite

    • @ashtonhoward5582
      @ashtonhoward5582 5 ปีที่แล้ว +1

      @@joeeeee8738 that's fair

  • @xTheUnderscorex
    @xTheUnderscorex 3 ปีที่แล้ว +1

    The chance to win is higher than that though, regardless of whether you use that strategy or not. Even if you didn't find your number, you have a 1/5 chance to guess it correctly anyway.
    So giving the chance with no combined strategy as 1/1,024 chance is very wrong, it's actually 0.0060466176 which is more than 6 times as likely.

  • @pinicius
    @pinicius 5 ปีที่แล้ว +34

    "always round down" is a crime because it breakes the "pi equals euler theorem"

    • @SpencerTwiddy
      @SpencerTwiddy 5 ปีที่แล้ว +11

      Pi Master Mithos imagine calling e "euler"😅

    • @pinicius
      @pinicius 5 ปีที่แล้ว +2

      @@SpencerTwiddy that's another crime. Crimeception.

    • @OriginalPiMan
      @OriginalPiMan 5 ปีที่แล้ว +13

      Always round to 3. All numbers in the real set round to 3.

    • @mgb360
      @mgb360 5 ปีที่แล้ว +1

      Also known as truncating

    • @KuraIthys
      @KuraIthys 5 ปีที่แล้ว

      Meanwhile, if we were doing 'crimes against compute performance'...
      Doing anything OTHER than truncating a value would be a crime. ;p

  • @SonOfSofaman
    @SonOfSofaman 5 ปีที่แล้ว +1

    Great shirt, Matt. Also, great video.

  • @fienddube
    @fienddube 5 ปีที่แล้ว +14

    I came up with a different strategy: you said they have to go stand on the other side of the room, but you didn’t say where on the other side. So, #1 goes over and picks a column: left or right. He’s looking for his own number sure, but mainly he’s looking for the next person’s number! If he finds #2 in the column he chose (left or right), he goes and stands in the corresponding corner of the far end of the room. If he does not, he goes and stands in the opposite corner. This now tells #2 which column his number is in. #2, knowing this, now goes and opens the column he knows his number is in, but he’s actually looking for #3, and he’ll go stand in the corresponding corner to signal #3 where his number is, and so on. Therefore, the only person whose selection is random is #1, who has a 50% chance of finding his own number. Therefore, half the time they will get 100% success, and half the time they’ll get 90% success. Bam.

    • @lausdomini7478
      @lausdomini7478 5 ปีที่แล้ว +1

      I was thinking along the same lines trying to work out the puzzle. Nice!

    • @cevalfonso
      @cevalfonso 5 ปีที่แล้ว +1

      Cool trick, but I don't see how you get the 90% value. If the first prisoner finds their number they all win, else they all lose, so 50% sucess rate.

    • @txj2998
      @txj2998 5 ปีที่แล้ว +3

      The very first rule of this puzzle was no communications. Your method is breaking practically the only rule there was to this puzzle. If you want to enable communications like that, there are way simpler ways to solve the puzzle.

    • @fienddube
      @fienddube 5 ปีที่แล้ว +1

      Torossian Jesse well yeah, but the 2 guys up front don’t know you’re communicating. It’s a secret. 😀

    • @catprog
      @catprog 5 ปีที่แล้ว

      And if you have to go to the next room as soon as you find your number this strategy fails as well.

  • @looiepoohie7363
    @looiepoohie7363 5 ปีที่แล้ว

    There's a book called _Algorithms to Live By: The Computer Science of Human Decision_ that pretty much explains this very phenomenon and other. One that I found that was pretty cool is named The Secretary Problem. I encourage you guys to check it out. The solution is pretty neat!

  • @bg6b7bft
    @bg6b7bft 5 ปีที่แล้ว +5

    Are they not allowed to watch how the previous prisoner's draw? That would make it much easier to survive.

    • @to12
      @to12 5 ปีที่แล้ว +1

      That was my thought as well.
      I thought they should have had the first guy pick 5 from the same side, hoping to get his number but looking for the next person's. For example if he chose the left side and did not see the next guys he could hold up his right hand signaling to the next person where his card is. He then would go through the right side knowing he would get his number but looking for the next person's card again to signal them where their's is. They would be guaranteed to get 9 out of 10 correct and a 50% chance to get 10 out of 10. Although this would not work for the higher numbers of people that they were talking about.

    • @bg6b7bft
      @bg6b7bft 5 ปีที่แล้ว +1

      @@to12 I imagine signaling would draw the wrath of the evil warden, but as described, they can watch the order the previous prisoners open the drawers.

  • @seanm7445
    @seanm7445 5 ปีที่แล้ว +2

    I love how Matt’s shirt pattern matches the football pattern.
    Always good to see a fellow football enthusiast. ;)

    • @irrelevant_noob
      @irrelevant_noob 3 ปีที่แล้ว +1

      The "football pattern"? You mean just a plain old hexagonal grid?

  • @buzzsawenthusiast1756
    @buzzsawenthusiast1756 5 ปีที่แล้ว +8

    A real Parker's hair cut you've got there, not gonna lie

  • @SirPaul0o
    @SirPaul0o 5 ปีที่แล้ว +1

    Grant is indeed an international treasure !

  • @darjanator
    @darjanator 5 ปีที่แล้ว +3

    #6 has the best shirt. #howdoyouwanttodothis

  • @toxicore1190
    @toxicore1190 5 ปีที่แล้ว

    At 4:50 in a more rigorous way:
    There exist (10 binomial 5) possibilities to choose the cards.
    Now, (9 binomial 4) of them contain the selected card [there are 4 out of 9 other cards to choose from].
    Thus, the chance is (9 binomial 4)/(10 binomial 5) = 50% for every prisoner to find their card.

  • @fabriziosantin7420
    @fabriziosantin7420 2 ปีที่แล้ว +7

    Veritasium just posted the solution to the number of prisoners going to infinity, of anyone's interested