5 comments

[ 3.6 ms ] story [ 27.2 ms ] thread
Cool, but I'd have preferred some commentary and explanation, or at least a conclusion. What's the optimal play strategy?
Here's my python version, with some commentary. http://datadigger.tumblr.com/post/9709584448/monty-hall
"What I didn’t realize is that the real choice is this:

what’s behind the door you originally picked what’s behind BOTH of the other doors, minus the goat"

Mind blown. I've been trying for a long time to understand this intuitively, thank you!

I intentionally didn't do a write-up of Bayes' Theorem or this particular problem because there is so much literature about it on the web, but you did inspire me to add this comment:

The following source statement illustrates the essence of this problem as an example of Bayes' Theorem. There are two posterior situations, in one case there are two possible succeeding events, each with one-half probability. In the other case only one succeeding event is possible with 100% probability. before the source statement

let revealedDoor =

    if (doorWithPrize = fstChoice) then rndReveal doorWithPrize

    else forcedReveal doorWithPrize fstChoice
I think F# does a rather nice job of letting you write source code that reveals the intention of what the code is doing.