Thursday, March 27, 2008

An interesting problem: part 2

So, did you think about an answer for the problem I suggested earlier?

To recap: Imagine you're on a game show and you are asked to choose from one of three doors. In one door, there's a prize (a beautiful car) and on the other two doors, there is a goat on each door. After you choose the door, the game show host will show where one of the goats is from the remaining two doors (remember there are two goats to start with, which means that no matter which door you choose, there will always be at least another goat on the doors that you didn't choose). In addition to showing you where one of the goats is, the game show host gives you the opportunity to swap between the original door that you chose and the remaining door.

So, faced with this decision what would you do? Would you stick with your initial decision? Or would you swap doors? At first, this seems to be an irrelevant choice, right? Well, think again...

By the way, this is called the Monty Hall Problem.

Watch this video of the popular television show Numb3rs to help you with the answer:

If you still need a clearer explanation, check out the following video:

And if you're still not convinced, then use the following programs that I created (in Java) to test this theory:

Monty Hall Problem (No Swapping) - Source
Monty Hall Problem (Swapping) - Source

These programs perform this test 100 million times each, where the first option doesn't swap the initial choice and the second does.

Surprise, surprise, here are the results that I obtained:

  • No Swapping: The program got it right 33% of the time.
  • Swapping: The program got it right 66% of the time.
Usually, the Random generator of a computer is not really a reliable random generator, but even if you try this test yourself (with cards or some other objects) you'll obtain similar results.

So, always remember to swap your choices :-)

1 comment:

Nelson said...

Math... It fuck's up with logic :).