Published on System iNetwork (http://systeminetwork.com)
A Mind Is a Terrible Thing...
By linda.harty@penton.com
Created Nov 11 2009 - 17:29

By:
Scott Klement [1]

I thought it was really interesting, so I decided rather than give you another IBM i programming tip, I'd tell you about how I wasted my brainwaves.

Do you do this? My mind is always going, and it needs something to work on or I get bored. Waiting for things drives me crazy, so whenever I know I'm going to have to wait, I try to have something that occupies my mind. Often, this involves surfing the web, looking for something that amuses me. Some would refer to this as wasting time, but I refer to it as wasting brainwaves.

The Boy/Girl Paradox

I was wasting some brainwaves on Wikipedia the other day, and I came across a logic problem. No problem, right? I'm a computer programmer. I'm great at both logic and math. I can't fail! Here's the problem:

Mr. Smith has two children. At least one of them is a boy. What is the probability that both children are boys?

The question assumes that boys are born 50 percent of the time, and girls are born 50 percent of the time. The logic is easy, right? The remaining kid can be either a boy or a girl, and they're equally likely, so it's 1/2, right?

Wrong. This is your mind playing tricks on you.

Let's enumerate the possibilities:

First KidSecond Kid
GirlGirl
BoyGirl
GirlBoy
BoyBoy

It would seem equally likely, except that the first option (Girl/Girl) isn't possible, because you know that one of the kids is a boy. That leaves three possibilities all equally likely, and of those three, only one of them has a second boy. There's only a 1/3 chance that the other kid is a boy.

For a much more detailed look at this problem, check out Wikipedia's page [2].

The Monty Hall Problem

This next one was really interesting to me as well. Does anyone remember the game show "Let's Make a Deal" with Monty Hall?

Well, Wikipedia has a logic problem that they refer to as The Monty Hall problem. This was apparently published many years ago in PARADE magazine, by columnist Marilyn vos Savant. Here's how it was stated:

Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?

Marilyn vos Savant answered that you should switch. You'd be right 2/3 of the time if you switched doors, and only 1/3 of the time if you didn't. Miraculously, I agreed with her. But it turns out, many people did not! The Ask Marilyn column received thousands of letters in response, and 92 percent of them said she was wrong. Indeed, several folks who disagreed with her (and me!) had doctorates in math!

You can read all about it on vos Savant's site. [3] I was intrigued by the letters she received in response to her column. People truly believed in their answers!

So many people believed that she was wrong that vos Savant asked schools to play out the problem in math classes. Doing that, she could prove that she was right. And she was!

Here's what went through my mind as I read vos Savant's article. Each door holds 1/3 chance of success. So after my initial choice, my odds are 1/3. That is, before Monty reveals a goat and gives me the option to switch, the doors are equal. That means if I switch, I'd have a 2/3 chance of being right. If my original door had a 1/3 chance of success, then switching would be me the remaining 2/3 chance of success, because I'd have my pick of the other two doors. You might be thinking, "Wait! You don't get to choose from the other two doors. You get only one of them." That's true, but Monty has already revealed the other door to be a goat. So I would never choose that one anyway! It's the same odds as it would be if I had chosen it myself.

Let's lay it out as we did with the boy/girl one. At the start, there are three possible layouts:

Door 1Door 2Door 3
CarGoatGoat
GoatCarGoat
GoatGoatCar

Since these layouts are random at the start of the game, it doesn't matter which door the contestant picks. They're all equally likely. For the sake of illustration, let's assume the contestant picked door 1.

Door 1Door 2Door 3KeepSwitch
CarGoatGoatwinlose
GoatCarGoatlosewin
GoatGoatCarlosewin

If the contestant keeps his original choice, he wins 1/3 of the time. If he switches, he wins 2/3 of the time.

Think about it from Monty's perspective. He has to reveal one goat, then give you the option to switch. He can't reveal the car, and he can't reveal the door you already picked. So in the first possibility where you actually did pick the car, he has a choice, he can reveal either door. If you keep your original door, you win, and if you switch you do not. In the other two possibilities, he has only one door he can choose, since there's only one that you haven't picked that contains a goat. In those circumstances, if you switch, you'll win the car.

Another perspective: Consider if there are 1,000,000. You pick door 1. The host, who knows exactly where the car is located, then goes through all 999,999 remaining doors, revealing a goat behind all of them, except that he skips door number 777,777, leaving it closed. You'd want to switch to that one, wouldn't you?

Monty Fall

In the Monty Hall problem, switching is to your advantage because you've been given a very useful clue. You've been shown a door that's guaranteed to be a goat. That's what enables switching to give you the 2/3 chance.

What if, instead of Monty deliberately showing you a door that has a goat, he falls and accidentally reveals what's behind one of the doors? This has been dubbed the "Monty Fall variant." If Monty falls, and the door revealed just happens to be a goat by chance (but you're still allowed to switch to the unrevealed door), then the odds of winning by switching drop to 1/2.

Of course, if he accidentally revealed the car when he fell, it doesn't matter whether you switch or not, since you can't win.

Monty Crawl

In this variant, Monty knows which door contains the car, but he's tired. He's standing on one end of the stage but will always pick the closest curtain he can. What are the odds now?

In this variant, which door Monty reveals gives you more information than it did before. Once again, assuming you picked door 1, there are three possibilities:

Door 1Door 2Door 3KeepSwitch
CarGoatGoatwinlose
GoatCarGoatfoolishwin
GoatGoatCarlosewin

In red, I've provided the door that Monty will pick in each case. Note that in the second variant, you know to switch because Monty wouldn't pick door 3 unless he had no choice. If Monty picks door 2, then you have a 1/2 chance whether you switch or not.

Monty from Hell

Monty doesn't give you the chance to switch unless your original choice was the car.

You have it made in this variant—just don't switch.

Angelic Monty

Monty tells you immediately if you picked the car. If you didn't, he gives you the choice to switch.

Always switch if given the chance.

© 2010 Penton Media, Inc.

Source URL: http://systeminetwork.com/article/mind-terrible-thing

Links:
[1] http://systeminetwork.com/author/scott-klement
[2] http://en.wikipedia.org/wiki/Boy_or_Girl_paradox
[3] http://www.marilynvossavant.com/articles/gameshow.html