Monday 14 September 2015

The Monty Hall problem


Alright this is a famous mathematical problem we've all probably heard of.

A game show presents a candidate with three doors. Behind one of these doors there is a brand new car. Behind the other two...a goat.
The presenter asks the candidate to pick a random door. Then, once selected, the presenter -who, by the way, knows what is behind each of the doors- opens one of the non-selected doors to reveal a goat. The question then is whether you wish to stick with your original choice or switch to the remaining door, for your final choice.

Most people will choose to stick to their original choices because intuition (or whatever internal force is a play here) figures that chances of getting the right door and thus the car is 50/50 or even. However, the Monty Hall problem explains that this is wrong.
It is better to switch.

Now for somebody who is rather terrible at math the explanation often given by 'math-heads' on the internet is rather (unnecessarily) complex. So I've taken it upon myself to give you two explanations. A simple one, and one to understand the simple one.

The explanation:

There are several solid facts you need to understand about the Monty Hall problem.

1. There are, for a fact, two goats and one car hidden behind the doors.
2. The presenter knows where the car and the goats are at.
3. After your initial choice the presenter will always show you a goat behind one of the    remaining doors.
4. You really, really want that car.

So, knowing this, you make your first choice for a door. This is a 1/3 or 33% chance of getting the car. 2/3 or 66% of getting one of the goats. So, in short, chances of getting the goat first time is larger than getting the car.

Suppose this is the case, your first choice is for a door concealing a goat (66% chance, so more likely). The presenter then opens one of the other doors and shows you a goat.
So, basically, you just forced the presenter's hand since he'll always show you a goat after your initial choice. So he is 'forced' to show you the location of the remaining goat which -since there are two remaining doors- automatically reveals the location of the car. So switching would get you the car. I could give you all kinds of other numbers here but I'm no mathematician.

Naturally it is still a game of chance. You could've picked the car first time. Then switching would lead to riding the goat home. However, mathematically the chances are better to switch.

For instance, increase the number of doors and goats and something fun happens.

Now suppose there are a hundred doors concealing 99 goats and one car.

You pick a door. Now there's a 99 percent chance that you've picked a door concealing a goat. So, pretty certain.

Now the presenter opens 98 of the doors, all containing goats, leaving only two. The one you selected and another one. Now you already know (with 99 percent certainty) that your door conceals a goat. So, you switch and get yourself a nice new car.

Or, with my luck, a goat.




Now for some fun.

As I was working on this I made a little game to accompany it. Now my flash programming skills are a bit rusty but it does the job.

UPDATE: it appears that Firefox and flash had a marriage dispute (and forgot to tell the kids) so some people can’t see the flash file. But, you can download it HERE.
 



No comments: