• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Adrien Design

  • Blog
  • 3 Doors
You are here: Home / 3 Doors

3 Doors

One night a couple years ago, I was reading a book before bed when the book posed a question. I had to know the answer for myself. I stopped reading, grabbed a pen & paper, and stayed up until 2am furiously rolling dice and marking the results.

What was the question? It was “The Monty Hall Problem.”
It’s similar to the 3-door game in “The Price is Right” but with more rigid rules:

There are 3 doors. One of them has a big bag of money behind it, and the others have nothing but stinky garbage behind them. The host asks you to pick a door for a chance to win the money.

You choose door #3.
The host opens door #2, revealing stinky garbage.
Now two doors remain: Your chosen door (#3), and door #1.

The host offers you a final choice — stay with door #3, or change to door #1.

Should I stay or should I change?

What would you do? Stay or change?
Will either of these choices offer you better odds to win?

Before you answer, consider the full rules:

  • The prize/garbage doors are decided completely at random — no manipulation.
  • You are free to choose any door for your first choice.
  • The host will eliminate (by revealing garbage) all but 2 doors:
    • your chosen door will remain untouched
    • the prize door will also remain untouched
  • The host will never try to influence your 2nd choice to stay or change your answer (unlike in The Price is Right).
  • The host will always offer you the choice to change, even if you’ve guessed correctly with your first choice.

Try it out

Here’s where the magic of code comes in. Actually, after making a simple system for randomizing my pen-paper-&-dice method, people were still skeptical of my results!

I tried 100 trials, assigned the “prize door” by rotating 1-2-3-1-2-3-etc. and then rolled a 6-sided die for the first guess of each trial (1 or 2 for door #1, 3 or 4 for door #2, 5 or 6 for door #3).

But skepticism prevailed, so I used JavaScript to get completely random values for the prize and the first door choice. Click the buttons below to see countless tests yourself:

  • Try theNew game
  • Reset your score
  • Observe some cases

Try out a game or two and see how you do.
Are you more successful staying with your first choice or changing your answer?

For a challenge, stick to 3 doors for a while and just think about your chances to win based on your first or second choice.

After a couple games, you can try observing thousands of cases.

Monty Hall game:

Your score: 0 / 0

Let's try 3 doors first, shall we?

Try with one more door.

Now you can play with a lot of doors. Does the game become easier, or harder?

Ok. Try all the doors you'd like!

How many doors would you like to play with?

  • 3
  • 4
  • 8
  • 16
  • 32
  • 60
  • 100
  • 300

Please choose a door!

I have eliminated all but two doors. One of them contains the $$$. One contains stinky garbage. Click the door you'd like to open. This is your chance to change your answer!

You WIN!

You LOSE!

  1.  
    Observing cases:

    How many doors would you like to test?

    • 3
    • 4
    • 5
    • 8
    • 16
    • 32
    • 60
    • 100
    • 300

    How many cases will you observe?

    • 10
    • 50
    • 100
    • 1000
    • 5000
    • 10000
    • 200000
    cases w/ doors each.

    The program created unique sets of doors, where both a prize door and a first choice are chosen randomly.

    Theoretically, we're observing two people try each set simultaniously: a person who changes their answer, and a person who stays with their first choice.

    Changers (people who changed their answer):

    Won out of cases (with % odds to win).

    Stayers (people who stuck to their first choice):

    Won out of cases (with % odds to win).

    Primary Sidebar

    About the Author

    I studied design in college, but I discovered what I really want to do when I started getting into web design and coding. The beautiful part about it is how you can study, practice, and learn every day; and you'll never reach the bottom of the well.

    Every day working as a WordPress developer is challenging and fulfilling.

    This is my personal site where I come to put down my thoughts and experiment with code ideas.

    Copyright © 2022 · Adrien Sanborn