Skip to content

This is a Python code I wrote to calculate the probability of a set of prisoners escaping based on this riddle from a Veritasium video https://www.youtube.com/watch?v=iSNsgj1OCLA.

Notifications You must be signed in to change notification settings

danielalienyi/prisoners_riddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

The 100 Prisoners Riddle

This is a Python code I wrote to calculate the probability of a set of prisoners escaping based on this riddle from a Veritasium video https://www.youtube.com/watch?v=iSNsgj1OCLA.

The code uses Monte Carlo method to determine the probability of encountering a situation where no group has more than 50 loops. The result turns out to be around 0.33.

About

This is a Python code I wrote to calculate the probability of a set of prisoners escaping based on this riddle from a Veritasium video https://www.youtube.com/watch?v=iSNsgj1OCLA.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published