started at . submit by
now I know my probabilities, next time won't you guess with me? explain the monty hall problem. submissions may be written in any language.
the monty hall problem is a well-known probability question with a result many find unintuitive. here's how it goes.
imagine you're on a game show where you have the chance to win a car. the host presents to you 3 doors and tells you that behind one of the doors is a car; behind the other two, goats. she invites you to pick a door, and you pick one – let's say you pick the first one. the host, who knows the location of the car, opens another door with a goat behind it – in this case, door number 2. she tells you, "whatever's behind your door, door #1, is yours to keep if you open it now. but you can also choose to swap and open the other door, door #3, instead. you can only open one of them." which door should you choose? does it matter?
the answer to this puzzle is that you should always swap and open the other door. in this example, there is a ⅔ chance that door #3 has a car behind it.
but why? your challenge is to demonstrate the solution to this problem programmatically, via any way or how. as any language is allowed, and this problem is open-ended, there is no fixed API.
0 entries have been received so far.