Wednesday, September 16, 2015

What Are the Odds?

I was going to return to discussions of new language features available in Node 4.0.0 today, but I feel like a discussion of today's comic is in order. Node's not going anywhere. I can talk about it on Friday.
Science! When you don't want a goat!

The comic today is once again interactive as the story arc continues. Business Frog is trying to win money for the company instead of earning it. The lottery ticket plan from Monday failed, but with Science Frog's help maybe a television game show will work. Remember Let's Make a Deal? It spawned one of the most highly contested and poorly understood examples of the laws of probability...what is now known as the Monty Hall Problem.

The problem seems simple. The game show host, presumably Monty Hall, shows the contestant three doors. Behind one of the doors is the grand prize. Behind the other two are much less desirable prizes. In the classic description of the problem, the less desirable prizes are goats. I don't know why, but they are. Goats. Yes. After the contestant picks a door, Monty offers a deal. He'll give you whatever is behind one of the other two doors and the game ends. He opens one of the doors, revealing a goat. Do you want a goat? Probably not. You want the grand prize! So you continue. There are still two closed doors. Monty asks if you want to stick with your first choice door, or if you want to change your mind and pick the other closed door.

What should you do?

You should always change doors.

That's right. If you initially picked Door 1 and Monty opened Door 3, switch to Door 2. If you initially picked 3 and Monty showed you 2, switch to 1. And so on.

Your chances of winning the grand prize are greater when you switch doors. It seems counter-intuitive, but it is absolutely true.

Here's why. Assume that Monty knows what is behind each of the three doors. Initially, you have a 1 in 3 chance of picking the grand prize and a 2 in 3 chance of picking a goat. But after making your selection, Monty is going to open one of the other two doors. He's not going to open the door you selected, and he's certainly not going to open the one with the grand prize behind it! That means sticking with your original door still gives you a 1/3 chance, but the 2/3 chance of picking a goat is now a 2/3 chance of picking the grand prize since one of the two goats has been revealed and can no longer be selected!

It boggles the mind!

But to prove it, I put a working simulation of the game in the comic. In the third frame, help Business Frog win the money. Try it a bunch of times by refreshing the page and see for yourself - switching doors leads to wins more often than staying with your first choice.

In the end, though, I couldn't resist tossing in a more philosophical line about the nature of winning. How do you know if you're a winner? Business Frog always considers himself a winner. You should too. comic for 16 September 2015

No comments:

Post a Comment