Let’s Make A Deal!
July 24, 2009
Since the host always reveals a goat, the only thing that matters is whether the contestant’s initial pick was an auto or a goat; if the initial pick was an auto, staying wins, and if the initial pick was a goat, switching wins. The monty function (named after the original host, Monty Hall), plays n games and reports the number of wins when switching and the number of wins when staying:
(define (monty n)
(let monty ((n n) (switch 0) (stay 0))
(let ((auto (randint 3)) (pick (randint 3)))
(cond ((zero? n) (values switch stay))
((= auto pick) (monty (- n 1) switch (+ stay 1)))
(else (monty (- n 1) (+ switch 1) stay))))))
stay count the number of wins for each strategy.
) returns a non-negative integer less than n; variable
auto records the location of the automobile, and variable
pick records the location of the contestant’s initial pick.
monty for 100,000 contests shows a clear winner:
> (monty 100000)
When the contestant first makes a choice, he wins the automobile one-third of the time. The other two doors hide the automobile the other two-thirds of the time. When the host reveals a goat, the probabilities don’t change: the door first chosen by the contestant wins the automobile one-third of the time, and wins a goat two-thirds of the time. But since the other two doors hid the automobile two-thirds of the time, and we now know that one of the doors certainly does not hide the automobile, the other door must hide the automobile two-thirds of the time. It is better to switch than stay.
When this puzzle appeared in Marilyn vos Savant’s column in Parade Magazine in 1990, it generated more mail than any previous column; over a thousand people with Ph.D.s thought she was wrong.
Pages: 1 2