A minimal, command-line visualizer built in Python using urwid to show the probabilities of the Monty Hall problem.
This is a terminal-based visualization of the Monty Hall problem. There are three doors, where a random door is picked as the winning door, a random door is chosen as the "initial pick", a random non-winning, un-selected door is revealed, and whether to stay or switch is randomly chosen. Wins are sorted by whether or not the decision to stay or switch was made. The simulator can be sped up or slowed down.
The interface is built in urwid.
- To run the project, you will need:
To install the project, just clone it from GitHub:
git clone https://github.com/bradendubois/monty-hall-visualization
cd monty-hall-visualization
Run the MontyHall.py
file in Python:
python MontyHall.py
- Q: Quit / Exit
- S, space: Toggle simulation
- A, left arrow: Decrease simulation speed
- D, right arrow: Increase simulation speed
- The terminal icon used in my README is from Font Awesome Free 5.2.0 by @fontawesome - https://fontawesome.com, licensed under the Creative Commons Attribution 4.0 International license. Changes/alterations were not made to the image.