/Monty-Hall-problem

This code is a simulation to show what happens if to switch in Monty Hall problem.

Primary LanguagePythonMIT LicenseMIT

Monty Hall problem

"Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?"

source: https://en.wikipedia.org/wiki/Monty_Hall_problem

This code is a simulation to show what happens if to switch in Monty Hall problem.


How to test by yourself

$ git clone https://github.com/PabloEmidio/Monty-Hall-problem
$ python3 Monty-Hall-problem/main.py {matches number}

Some examples

[example@example ~]$ python3 Monty-Hall-problem/main.py 300
763 matches done, switching the door it'd win 494 times, 64.7% of the matches
[example@example ~]$ python3 Monty-Hall-problem/main.py 1000
1000 matches done, switching the door it'd win 665 times, 66.5% of the matches