Skip to content

Represents the Monty Hall paradox, one of the most famous problems in probability theory. This simulation allows you to play the game and make experiments. Enjoy!

Notifications You must be signed in to change notification settings

aleqsanbr/MontyHallParadox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monty Hall paradox

This simulation is based on the Monty Hall paradox, a probability problem that is based on a game show. The game show host presents the contestant with three doors. Behind one of the doors is a car, and behind the other two doors are goats. The contestant picks a door, and then the host opens one of the other two doors to reveal a goat. The contestant is then given the option to switch doors. The question is: is it in the contestant's best interest to switch doors?

What you can do with this simulation

  1. Just play the game and see what happens.
  2. Automate the game and run it multiple times to see the results.
  3. Run the experiment of the simulation with different strategies to see which one is the best. It also prints the table with the relative frequency of wins depending on the number of doors and the strategy.

How to run the simulation

  1. Install Ruby
  2. Clone the repository
  3. Run the simulation with the following command:
    ruby main.rb
  4. Follow the instructions in the terminal to play the game or run the simulation with different strategies :)
  5. Enjoy!

About

Represents the Monty Hall paradox, one of the most famous problems in probability theory. This simulation allows you to play the game and make experiments. Enjoy!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages