Skip to content

This is the program written to prove the 100 Prisoners Riddle made by Veritasium.

License

Notifications You must be signed in to change notification settings

RuthvikSaiKumar/100-Prisoners-Riddle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

100-Prisoners-Riddle

This is the program written to prove the 100 Prisoners Riddle made by Veritasium.

First it calculates the probability of the prisoners winning on hundred attampts (to calculate the percentage),
then, I repeated it for 1000 times to calculate the average percentage of winning.

Output:

| ████████████████████████████████████████████████████████████████████████████████████████████████████  | 100 % done
Average number of times prisoners are freed: 30.026%

The value comes close to what was expected by Veritasium.

You can repeat the calculation any number of times to calculate precise average (by changing the times variable).
You can also change the number of prisoners.

Thank you for reading! Have a good day 😄

About

This is the program written to prove the 100 Prisoners Riddle made by Veritasium.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages