Skip to main content

Posts

Showing posts from January, 2010

Monty Hall Problem Simulator (ruby implementation)

Monty Hall problem is a probability problem based on an American TV show, Let's make a deal. The details are in the Wiki, http://en.wikipedia.org/wiki/Monty_Hall_problem . The point of this blog entry is a simulator of the problem, so, I only make a brief explain about that. --- Rule --- There are three doors (A, B, C), and (cat, donkey, donkey) are behind randomly. The player choose a door. The host always open one of the door that is not chosen by the player, regardless which door was chosen by the player. The host knows the where is the car, and always open the donkey door. If both unchosen doors are donkey door, the host decide the door by flipping a coin. (Cited from Wikipedia Japan's Monty Hall problem) The question is 'Should the player switch the choice?', or it does not matter? The answer is 'always switch is better.' The switch makes twice possibility to get a car. At the end of this blog, you can find the Monty Hall Problem simulator. I...