/Monty-Hall-problem-simulation

It's a repo about Monty Hall problem. I simulate the game in python.

Primary LanguageJupyter NotebookMIT LicenseMIT

Monty Hall Simulation

This repository contains a simulation program for the Monty Hall problem, a probability puzzle based on a game show scenario.

Description

The Monty Hall problem is a probability puzzle that is loosely based on the game show "Let's Make a Deal," where a contestant is presented with three doors, one of which hides a prize (such as a car) and the other two hide goats. The contestant initially chooses one door, and then the host (Monty Hall) opens one of the remaining doors, revealing a goat. The contestant is then given the option to switch their choice to the remaining unopened door or stick with their initial choice.

This simulation program replicates the Monty Hall problem scenario and allows users to run multiple simulations to analyze the outcomes based on different strategies (e.g., always switching doors, always staying with the initial choice).

Installation

To run the simulation program, follow these steps:

  1. Clone this repository to your local machine.
    git clone git@github.com:Sebastian-0912/Monty-Hall-problem-simulation.git
  2. Open the monty_hall_simulation.ipynb file in Jupyter Notebook or any compatible platform.
  3. Run the cells in the notebook to execute the simulation and view the results.

Usage

The notebook provides detailed explanations and code comments to guide you through the simulation process. You can modify parameters, such as the number of simulations or the chosen strategy, to conduct different analyses.

Results

After running the simulation, the notebook will display the results, including the number of successful outcomes for each strategy and the corresponding success rates.

Acknowledgements

This project benefited from the assistance of GPT (Generative Pre-trained Transformer) developed by OpenAI. GPT provided guidance and insights that enhanced the quality and clarity of this README and the accompanying code.

Contributing

Contributions are welcome! If you have any suggestions, improvements, or bug fixes, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License. See the LICENSE file for details.