Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jaredcat/100doors
Monty Hall simulator
https://github.com/jaredcat/100doors
100-prisoners 100-prisoners-problem 100prisoners 100prisonersproblem hacktoberfest math mathmatical-paradox monthy-hall-problem monty-hall monty-hall-simulator paradox paradoxes simulation veritasium
Last synced: 5 days ago
JSON representation
Monty Hall simulator
- Host: GitHub
- URL: https://github.com/jaredcat/100doors
- Owner: jaredcat
- License: mit
- Created: 2015-02-25T06:16:52.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2023-10-30T21:05:52.000Z (about 1 year ago)
- Last Synced: 2024-06-17T23:08:40.484Z (5 months ago)
- Topics: 100-prisoners, 100-prisoners-problem, 100prisoners, 100prisonersproblem, hacktoberfest, math, mathmatical-paradox, monthy-hall-problem, monty-hall, monty-hall-simulator, paradox, paradoxes, simulation, veritasium
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 100Doors
## Monty Hall Simulator
There was a post about the Monty Hall problem and how it stumped the mathmatics world for years. After explaining it, people in the comments still firmly belived that the odds should be 50%. So, I wanted to see how easy I could build this
in python just to prove a point to myself and see the win rate with some big data.
A few hours later and I had a pretty robust simulator that confirms that you have n-1/n odds of winning when you switch
instead of staying with your initial guess!The name comes from the concept of extrapolating the initial scenario to a large number to make it easier to understand
why odds shift to the unopened door and not equally between the two remaining closed doors.### Instructions
Requires Python (3.4 if you run into issues on lower versions)
Follow on screen instructions### Features
The script features two play modes:
Auto play mode: If set to y then the game will play any amount of times with any amount of doors and either switch or stay
every time while randomly selecting a door. (Proves odds favor switching with big data)
Player mode: Allows the player to simulate being on a game show with as many doors as they want.
In player mode, a player gets to pick which door they want and a winning one is randomly selected from the pool of
doors.
Then the player gets to pick whether they would like to switch or stay when the doors are opened.
The players win rate and percentage is displayed and carried with the player till they quit.## 100 Prisoners Simulator
TODO