
Show HN: The Monty Hall Problem in JavaScript - atum47
https://github.com/victorqribeiro/montyhall
======
jancsika
One thing that helps IMO here is to exaggerate the problem:

Start with one million doors.

Choose one.

Now have Monty open 999,998 of them.

Do you switch doors?

I believe it works because the chooser is forced to reckon with the 1 in a
million chance that they chose the correct door. Additionally, it becomes
clear that Monty actually fed the chooser new information by opening 999,998
doors.

It may not take the first time, but given a few rounds of the million door
challenge both truths should sink in for the chooser.

Perhaps it would help to have a Javascript version that starts with a
sufficiently large number of doors the first round, then cuts that in half
each round until you get down to 3. The odds of winning decrease each time but
the principle _should_ still hold. (Although I can imagine some people getting
back down to three doors and suddenly reverting back to their previously held
intuition...)

~~~
systemBuilder
Most people mistakenly think Monty chooses randomly. He doesn't.

~~~
wyattpeak
It's a common error, but I don't know if it's most in my experience. I've seen
plenty of people fully understand the problem (for some value of fully
understand) and insist it doesn't matter whether or not you switch.

------
s9w
Some constructive feedback:

\- The language randomly seems to switch to something else ("porta")

\- Even if you're faintly familiar with the problem (like me), it's hard to
gauge the actual goal of the game. For example I didn't recall if a door being
empty is good or not.

\- The coloring seems not very helpful. Red for the chosen door? Red is
usually associated with something bad. And the colors for opened and still
closed doors are not easily associated with their state. A simple bitmap or
even a text would say much more than those colors.

\- The statistics give a lot of numbers that aren't meaningful, and don't show
the meaningful ones. In particular the absolute counts of how often was
switched are hardly of importance. It's about the ratio of correct decisions -
in particular that number should be split into switching and not switching
decisions.

~~~
mping
Porta mesma door in Portuguese. Author is probably pt/pt or pt/br

~~~
atum47
yes I am pt/br

------
tombert
Ah, the good ol' Monty Hall problem...this problem (and .999...=1) have caused
a ton of arguments between me and my not-quite-as-mathematical friends.

I guess the fact that it's statically better to switch is definitely a tough
pill to swallow.

~~~
freefriedrice
I remember reading this in Parade Magazine when Marilyn Vos Savant published
her column. And then was completely blown away by the landslide of scathing
letters written by adult professors at colleges belittling her for being so
dumb. And they were wrong. Truly amazing demonstration of how bias (and the
limbic system) work against rational thought.

Here is a link with some hilarious quotes from livid professors saying dumb
shit:

[https://priceonomics.com/the-time-everyone-corrected-the-
wor...](https://priceonomics.com/the-time-everyone-corrected-the-worlds-
smartest/)

~~~
abiogenesis
This letter explains why we are in trouble:

    
    
        You made a mistake, but look at the positive side. 
        If all those Ph.D.’s were wrong, the country would 
        be in some very serious trouble.
    
        Everett Harman, Ph.D.
        U.S. Army Research Institute

------
madrox
When I got my statistics degree, a significant amount of time was spent in
early classes demonstrating how non-intuitive statistical thinking can be.
This, of course, is probably the most memorable example. Another fun one was a
TED talk about Peter Donnelly on how juries get fooled that included a bunch
of similar examples:
[https://www.ted.com/talks/peter_donnelly_how_juries_are_fool...](https://www.ted.com/talks/peter_donnelly_how_juries_are_fooled_by_statistics?language=en)

~~~
atum47
well, I made this experiment cause I didn't believed that you would have more
chance switching doors. Couldn't wrap my head around the idea...

~~~
madrox
Totally! Simulation is a great way of learning this stuff. I spent a lot of
time in R doing similar things over the years.

~~~
Frost1x
The Monty Hall problem supposedly even confused Paul Erdos (famous
mathematician) who even rejected it after given a statistical proof.

He didn't accept the answer until stepping through a computer simulation so if
it seems unintuitive, you're in good company. This problem is, in lore,
claimed to trip up more nobel laureates then most problems because it's so
counter intuitive to not notice the conditional probability and injected
information from Monty.

~~~
atum47
that's really interesting

------
atum47
More information about the project here
[https://github.com/victorqribeiro/montyhall](https://github.com/victorqribeiro/montyhall)

------
karanke
I've won 100% of the time by switching and then not switching doors, surely
that can't be right?

~~~
atum47
how many times did you play?

~~~
Skunkleton
I played ~20 times, and won ~2/3s of the time as expected.

------
newtoday
Typo: Times you didn't swicht doors: 2

