Skip to content

KaterynaMeleshenko/MontyHallProblem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Monty Hall Problem

This code simulates results for Monty Hall problem that is:

In the game show "Let’s Make a Deal" Monty Hall asks us to choose one of three doors. One of the doors hides a prize, and the other two doors have no prize. We state out loud which door we pick but we don’t open it right away. Monty opens one of the other two doors, and there is no prize behind it. At this moment, there are two closed doors, one of which we picked. The prize is behind one of the closed doors, but we don’t know which one. Monty asks us, “Do you want to switch doors?”

The task is to evaluate our chances of winning with and without switch the door.

How to Use the Code

To run the code, follow these steps:

  1. Install the required dependencies: numpy, matplotlib and seaborn. You can install them using pip:
pip install numpy matplotlib seaborn
  1. Clone or download the code to your local machine.

  2. Run the monty_hall_problem.py file using a Python interpreter:

python monty_hall_problem.py

The code will run 500 simulations of 500 games and visualize the distribution of results on histograms.

File Structure

The project includes one file:

monty_hall_problem.py: contains the Python code to simulate the Monty Hall games and generate histograms.

Contributing

Contributions to the code are welcome. If you find a bug or have a feature request, please open an issue on the GitHub repository. If you want to contribute code, please fork the repository and submit a pull request.

About

Simulations for Monty Hall problem (probability puzzle)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages