The Monty Hall Simulation is a web app that demonstrates the Monty Hall problem, a famous probability puzzle. The app allows users to play a simulation of the game show "Let's Make a Deal", in which they must choose one of three doors to open in an attempt to win a prize. After the user makes their initial choice, one of the remaining doors is opened to reveal a losing prize. The user is then given the option to stick with their original choice or switch to the other remaining door. The app tracks the number of wins and losses for each strategy and displays the results in an interactive bar chart.
20230106031717.mp4
Clone the project
git clone https://github.com/tyagi200/Monty-Hall-Simulation.git
Go to the project directory
cd my-project
Install dependencies
npm install
Start the server
npm run start
-
Open the app in your web browser at http://localhost:3000.
-
Click on one of the doors to make your initial choice.
-
After the first door is opened, you will be given the option to stick with your original choice or switch to the other remaining door. Click on the "Stick" or "Switch" button to make your final choice.
-
The app will reveal the winning. The results of the game will be added to a table showing the total number of wins and losses for each strategy, as well as the probability of winning for each strategy.
-
To play again, click on the "Reset" button. The app will reset and you can make a new choice.
-
To view the results of your previous plays, the table at the left of the page will be updated after each game. The table shows the total number of wins and losses for each strategy, as well as the probability of winning for each strategy.
The Leetcode Time Analyzer was built using the following technologies:
- React: Frontend JavaScript library for building the user interface