asilichenko / 100-prisoners-riddle

Checking 100 prisoners riddle strategy assumption: https://www.youtube.com/watch?v=iSNsgj1OCLA

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

100-prisoners-riddle

Checking 100 prisoners riddle strategy assumption.

Conditions:

  • 100 prisoners numbered 1-100
  • Slips with their numbers are randomly placed in 100 boxes in a room
  • Each prisoner may enter the room one at a time and check 50 boxes
  • They must leave the room exactly as they found it and can't communicate with the other after
  • If all 100 prisoners find their number during their turn in the room, they will all be freed. But if even one fails, they will be executed.

What is their best strategy?

Assumption is:
The strategy could give over 31% chance that all the prisoners will find their number.

Inspired by Veritasium's video: "The Riddle That Seems Impossible Even If You Know The Answer"

About

Checking 100 prisoners riddle strategy assumption: https://www.youtube.com/watch?v=iSNsgj1OCLA

License:GNU Lesser General Public License v2.1


Languages

Language:Java 100.0%