December 2, 2008

The Monty Python Hall Problem

Filed under: science — Joshua @ 9:37 am

I like to make fun of Evolutionary Psychology as being nothing more than a bunch of just so stories. If an experiment finds that men cheat more than women, why that’s because humans evolved that way! And if next week someone finds some evidence that women cheat more than men, no doubt there’ll be some reason to believe that it’s “only natural” that we evolved THAT way as well. Since nothing in human evolution can be tested in the laboratory, it’s an endless generator of pointless ex post “explanations” for stuff we already know with next to no useful predictive power.

However, a recent entry on Mr. Tweedy’s blog reminds me that there are some evolutionary mysteries here and there. It deals with the Monty Hall Problem - a famous cognitive illusion named after the host of gameshow Let’s Make a Deal, which used a verion of the problem as its main schtick.

The game is played like this. You are presented with three doors, all closed. Behind one of the doors is a prize of some kind (usually a car), and behind the other two are goats. You are asked to pick one at random, so you do. At this point, your chances of having picked the door with the car behind are 1/3. The host is now obligated to open one of the remaining two doors, and he always opens a door to reveal a goat. So at this point in the game, we’ve seen one of the three doors opened and have been shown a goat behind it. You are now given a choice: you may stick with your original guess, or you may switch your guess to the other unopened door. If the door you pick has a car behind it, you get to keep it. If it has a goat, you go home empty-handed. The question is, is it to your advantage to switch your choice or to stick with your original pick?

The professor who first introduced me to this problem confesses that every time he teaches it he has to first reconvince himself that the answer is right. And he’s not alone. According to the Wikipedia article on the problem (linked above), when this was featured in Parade magazine in 1990 something like 10,000 people, about 1,000 of whom had PhDs and some of whom even had Nobel prizes in related fields, wrote in to say that the magazine had got it wrong. And of course I’m not going to sit here and pretend that I’m any different: it’s really counterintuitive for me too, and when I read Mr. Tweedy’s entry I had to sit down for about 20mintues and think it through even though I already knew his explanation was right. As you’ve no doubt guessed from the preceding discussion, the right answer is indeed that you should switch your choice. As it turns out, if you switch your choice, you get it right 2 out of every 3 games you play, whereas if you stick with your original choice, you’re only right 1 out of every 3 times.

Why?(!!???!!) I mean, I and apparently everyone else in the world would like to say that you’re no better off having seen the goat behind the door the host opens - and that’s because seeing the goat hasn’t added any information about which of the remaining two doors the car is behind. In the original situation, you have a 1/3 chance out of three mysterious doors to be right. In the updated situation, you have a 1/2 chance, but the point is there is nothing to distinguish your two choices, right?

Right, actually, which is why the illusion is so powerful. But is IS an illusion, and here’s why. The trick is that it isn’t so much seeing the goat as being allowed to switch your pick that’s the source of the advantage. People are right that seeing the goat doesn’t add any knowledge about which of the two remaining doors the car is behind - not really. The advantage comes from the fact that you are given an opportunity to pick from a greater pool of choices, half of which have been helpfully eliminated for you.

To see this, think of each possibility in the game as a tuple, where the number on the left represents your choice, and the number on the right represents the door with the car behind it. There are nine possible games, in other words, and in three of the nine cases your original choice is correct:

(1,1) (1,2) (1,3)
(2,1) (2,2) (2,3)
(3,1) (3,2) (3,3)

Let’s say you chose door 1. That means that you’re playing out of the choices in the top row, and your chances of being right are indeed 1/3 - because there’s only one situation out of the three situations where you pick door number one where the car is also behind that door.

(1,1) (1,2) (1,3)
(2,1) (2,2) (2,3)
(3,1) (3,2) (3,3)

But if your chances of being right were 1/3, your chances of being wrong were 2/3. There are two possibilities for where the car could be that differ from your first choice, but only one that coincides with it.

(1,1) (1,2) (1,3)
(2,1) (2,2) (2,3)
(3,1) (3,2) (3,3)

So think of it this way. There is a 1/3 chance that the yellow tuple is right, but a 2/3 chance that one of the blue tuples is right. If you switch your choice, you get to pick from a group that has a 2/3 chance of being right, but you are assured of not making the wrong choice out of this group. The host has shown you which choices in this group are definitely wrong, so you’re given an advantage here. Since the host has kindly shown you which of the two of that 2/3 pool is wrong, you can choose from this pool with relative safety. You have a 2/3 chance of being right by switching, and only a 1/3 chance by sticking. The real game is the choice between yellow and blue, and blue always has a 2/3 chance of being right.

Mr. Tweedy wrote a PHP program to demonstrate this, which you can run here. Since PHP is messy and unreadable and Python is clean and clear, I’ve done the world the great favor of posting a Python version, which you can see or download by clicking on the link. It accepts a command line parameter for how many tests you want to run, so to run 500 trials from the command line (assuming you have Python installed on your system - which of course you should!):

$python monty-python.txt 500

It’s written in such a way that you can increase the number of doors if you like. Just change the numberDoors variable at the top of the file to something else. (Or, if you want to add a command line parameter for the number of doors, just uncomment line 48.) If you’ve been paying attention, it should be obvious that the higher you increase the number of doors, the closer your chances get to being even on switching and sticking (although, unless I’m mistaken, there’s always a slight advantage to switching no matter how great the number of doors, so long as the number is finite).

I’ve included an online version too - but only variable by number of trials, not by number of doors. Type the number of trials (less than 1000) you want to see in the space below and hit Send and it will show you results. (I haven’t done any sanity checks, so if you want to put something stupid in there like an exclamation point, go ahead and be clever like that - you’ll get a not very helpful error message.)


In any case, as you can see by running either of our programs, a large enough number of times, switching does indeed win you the game 2/3 of the time, whereas sticking only works out for you 1/3 as often. Strange but true.

Evolving this kind of systematic failure to understand how the world really works doesn’t seem like much of an evolutionary advantage. Ah - but there’s the rub about evolution in general. Evolution isn’t meant to explain every little detail about why we are like we are. It just so happens that we ended up at the top of the food chain even with this massive inbuilt perceptual disadvantage. The best we can say is that (a) we didn’t seem to have any critical competitors who didn’t have the same disadvantage at crucial stages in our evolution or (b) that if they did have the advantage that it was never decisive at the right moments. Or else (c) that our ability to reason compensates. Or (d) that any number of millions of combinations of these things is true. Or even (e) that someday we’ll meet The Buggers out in space and they won’t have evolved this disadvantage and we’ll be royally screwed. Or (f) we won’t because they’ll have some other cognitive disadvantage that’s worse. Or… Or… See - not very helpful this evolutionary psychology stuff.

November 6, 2008

Yet Another Unnecessary Evolutionary Psychology Angle

Filed under: science — Joshua @ 4:35 pm

This study has been making the rounds on the internet. It purports to show that men are better at detecting when their partners are cheating, but also that men are more likely to suspect cheating when there is none. It’s all based on the oh-so-accurate method of asking people in anonymous surveys if and how often they’ve cheated and if and how often they’ve suspected their partners of cheating (and, presumably, if and how often they’ve been right about this). Since the study is based entirely on self-reported data (and is thus really a story about gender differences in attitudes about cheating rather than facts), we might as well throw in some evolutionary psychology.

Andrews says this makes evolutionary sense because unlike women, men can never be certain a baby is theirs. “Men have far more at stake,” he says. “When a female partner is unfaithful, a man may himself lose the opportunity to reproduce, and find himself investing his resources in raising the offspring of another man.”

Brilliant! No doubt if it had come out the other way, Andrews would’ve been convinced that THAT made evolutionary sense because as women don’t go off with hunting parties in hunter-gatherer tribes as often, they were uniquely adapted to detect things such as cheating at long distance.

If anything is pseudoscience it’s Evolutionary Psychology. This field of “science” spits out more untestable hypotheses based on confimation bias than Astrology. I’m not even being all that flippant. Just like we can’t adjust the position of Mars to see if it makes people more aggressive, there’s no way to go back in time and push humans down another evolutionary path to see whether things turn out differently. In the meantime, since we can’t test anything, we might as well just make it up as we go along.

The thing is, Andrews’ “explanation” for his data actually does make sense - it’s just that I’m not sure we needed evolution to reach this stunning insight. Even without the idea that these attitudes were hardwired in genetically, we’d no doubt achieve the same results. I’m willing to bet a metric assload of money, for example, that if we set up an Economics experiment wherein we gave people money and partnered them up so that they bought stocks together, we could simulate the same effect. Here’s my idea.

We’ll take a group of people and divide them randomly up into “red” and “blue” and have them play a stock market simulation game. Everyone starts out with an account of money and is informed that they have a week to pick partners. Red has to pair with blue because, in this society, due to some crazy laws invented probably by Democrats for special Democrat reasons, only red players can invest, but they can’t do it unless part of the money they’re investing is contributed by one of the blue people. Now, let’s say that there’s also a rule that says that red has to split profits from investments proportionally among all the contributors. So, if I’m a blue and I have $400 and I meet a red who has $500 and we pool our accounts (because remember, red can only invest with seed money from blue), then at the end of 6 months red gets 5/9 of the total value of stocks we “own” and I get 4/9. Whichever individual ends the game with the most money wins. The game needs one final constraint: for the duration of the game, partners can only access stock quotes from a shared account set up in such a way that both passwords have to be entered. So, this ensures that they only play in cooperation in pairs. They come in once a week, each types in his password in secret - but the existence of two passwords ensures that both have to be present - and they make simulated trades.

Ok - obviously there will be some incentive for the blue to invest some of his money in some other red. The catch is that he can’t see what the red is doing with this money - but he can hope he gets a nice fat bonus at the end of the game. Likewise, there is some incentive for red to accept money from some other blue besides her designated blue, since this gives more to play with, thus increasing the chances that she comes out on top. The catch, of course, is that each blue makes his investments with some suspicion that some portion of the money he is playing with on screen will simply disappear at the end of the game (because she pays it to the other “outside” blue in proportion, rather than her designated partner). The red, likewise, plays with some suspicion that at the end of the game her partner will shoot ahead of her in total wealth as he might have invested some of it in another, possibly more successful, red and get a big payout.

I am willing to bet that the blues are more suspicious than the reds here on average - again, for the reason that they are doing a lot of work trying to win a game with money some of which might turn out not to be theirs. Red will be somewhat suspicious of blues as well, but probably a bit less so since all reds are sure to get a payout on in proportion to the money they invest. The red member of each pair is only suspicious that her partner may, at the end of the game, suddenly show up with an account bigger than reported. However, she knows exactly what her account will be. Since reds have a bit more control over the situation than blues, they are less likely, I think, to be resentful and suspicious.

Of course, I don’t know this until I do the experiment, but I’m willing to bet that any readers have the same intuition that I do. No sex or evolution or genes of any kind are needed to explain this effect. It is an economic phenomenon - and we can explain it perfectly well with Game Theory.

In other words, if I want marriage advice, I’ll talk to Gary Becker before I consult a lab quack.