Monty Hall problem and simulation

There’s been a bit of a debate on the forum at about the Monty Hall problem. The crux of the problem is:

  • There are three doors. Behind one is a car, behind the other two a goat.
  • The contestant picks a door.
  • One of the other doors is opened to reveal a goat.
  • The contestant is then asked if they want to stick with the door they chose originally or change to the other unopened door.

Is it better to always stick or always change?

Remarkably, you have a 2/3 chance of winning if you decide to change every time.

To help sort things out, I wrote a little simulation program:
Monty Hall simulation.

And here is The Wikipedia entry on the Monty Hall problem.

This entry was posted in Programming. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s