Skip to content

lukass-code/100_prisoners_problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

100 Prisoners Problem

Description

"The 100 prisoners problem is a mathematical problem in probability theory and combinatorics. In this problem, 100 numbered prisoners must find their own numbers in one of 100 drawers in order to survive. The rules state that each prisoner may open only 50 drawers and cannot communicate with other prisoners. At first glance, the situation appears hopeless, but a clever strategy offers the prisoners a realistic chance of survival." (Source: Wikipedia)
For more information read the full article: 100 prisoners problem

This video describes it very well: Video

Code

I wanted to take a closer look at this problem and to retrace the solution approach. The solution is very interessting. This code is used to model the problem. In addition, the solution is implemented and the probability of success can be calculated.

Have fun trying it out yourself.

Requirements:

  • numpy (pip install numpy)

About

A code to solve the 100 prisoners problem

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages