Skip to content

A quick simulation visualization to illustrate the Monty Hall Paradox.

Notifications You must be signed in to change notification settings

bradendubois/monty-hall-visualization

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

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

About

A quick simulation visualization to illustrate the Monty Hall Paradox.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages