GithubHelp home page GithubHelp logo

monty-hall-simulation's Introduction

Monty Hall Simulation

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.

Demo

20230106031717.mp4

Run Locally

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

Usage/Examples

  • 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.

Technologies

The Leetcode Time Analyzer was built using the following technologies:

  • React: Frontend JavaScript library for building the user interface

monty-hall-simulation's People

Contributors

tyagi200 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.