Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 2.27 KB

README.md

File metadata and controls

60 lines (42 loc) · 2.27 KB
Terminal icon

monty-hall-visualization

A minimal, command-line visualizer built in Python using urwid to show the probabilities of the Monty Hall problem.

Python urwid

Contents

Description

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.

Requirements

Setup

To install the project, just clone it from GitHub:

git clone https://github.com/bradendubois/monty-hall-visualization
cd monty-hall-visualization

Running

Run the MontyHall.py file in Python:

python MontyHall.py

Controls

  • Q: Quit / Exit
  • S, space: Toggle simulation
  • A, left arrow: Decrease simulation speed
  • D, right arrow: Increase simulation speed

Acknowledgements