You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This ruby script demonstrates the apparently-absurd fact underlying the Monty Hall problem (http://en.wikipedia.org/wiki/Monty_Hall_problem).
There are three doors. Two doors have a goat behind them. One door has a new car behind it. The contestant chooses a door. Monty Hall opens a second door, revealing a goat. The contestant must choose whether or not to switch between the two other doors.
Running this yields:
$ ruby goats.rb
By not switching doors, you win 33335304 times out of 100000000.
By switching doors, you win 66664697 times out of 100000000.