Skip to content

A simulation of the Monty Hall Problem that verifies its solution.

Notifications You must be signed in to change notification settings

saul-herrera/Monty-Hall-Problem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 

Repository files navigation

Monty-Hall-Problem

A simulation of the Monty Hall Problem that verifies its solution.

The 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?" (from Wikipedia).

So any one of the three doors could have the car, which means you would have a 1/3 probability of winning. One may think: "how could switching my choice make any difference on my chances of winning?".

This problem is famous for having a non-intuitive solution. It turns out switching doors doubles your probability of winning: you have a 2/3 probability of winning if you switch, compared to 1/3 if you don't.

After knowing the correct answer, you might try to convince yourself that this makes sense, but it doesn't. According to some accounts, not even Paul Erdős, the famous mathematician, was fully convinced of this result until he was shown a Monte Carlo simulation of the problem (allegedly, he objected that he still didn't understand it, but at least now he was convinced it was true).

This example attempts to ilustrate that a computer program can be used to find correct answers to problems that are difficult to grasp by pure reasoning.

About

A simulation of the Monty Hall Problem that verifies its solution.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages