Departments


We Have Mail


Last July we ran an unusual article — Michael Brandt's "Don't Mess with Marilyn." It stimulated an incredible amount of mail. The mail shows that the article also stimulated quite a bit of thought among our readers. That was my hope in stepping outside our normal bounds.

What follows are the first half dozen responses that came in. I believe they're typical of the whole collection, which is much too large to print in its entirety. I also believe it's best for me not to respond to each letter separately, as I often do. These letters cover the issues and speak for themselves quite well enough.

Dear Mr. Plauger:

Michael E. Brandt demonstrated ("Don't Mess with Marilyn", The C Users Journal, July 1992) a program that confirms Marilyn vos Savant's claims. When the original puzzle appeared in Parade magazine, I wrote a similar program which also confirmed her results.

I noticed, however, that the result was only as accurate as the pseudo-random number generator being used. This brought to mind another article ("A Fast Pseudo Random Number Generator", W. L. Maier, Dr. Dobbs Journal, May 1991) which indicates that the period before the rand function will begin repeating is 6.6e4 simulations while the r250 function is 1.8e75 simulations. This became 'evident' after several million rand simulations unexpectedly produced the exact same results (i.e. I expected slightly different answers, due to 'randomness'). This repetition of results did not occur after running several billion (yes, billion) simulations using r250. Additionally, the r250 function execution was faster!

People, whether C programmers or the general public, need to regard the computer "as a tool for testing the correctness of certain claims, or for simulating reality", as Brandt recommends. They should also become familiar with computer limitations (e.g. the r250 method), in an effort to expand their expertise and overcome these limitations.

Sincerely,

W. Randal Given
819 Crowder Court
Fort Wayne, IN 46825

Dear Mr. Plauger,

Michael Brandt provides an interesting approach to the problem presented in his article, "Don't Mess with Marilyn!" (July, 1992) However, he and other readers interested in the problem might appreciate the good mathematical analysis of this and several related problems presented by Leonard Gillman in an article "The Car and the Goats" (The American Mathematical Monthly, Volume 99, Number 1, January, 1992). In this article, Dr. Gillman points out that the proof provided by Marilyn addresses a slightly modified problem from the one posed, one in which the contestant has to announce whether he/she plans to switch before the host opens a door. The correct mathematical formulation of the problem posed is as a conditional probability and the correct answer depends on the strategy of the host in choosing the door to open if the contestant selects the door which has the car behind it.

Using Bayes' Theorem, it can be shown that the probability can be any number from 1/2 to 1. After analysing Dr. Brandt's simulation, I realized that he is actually addressing the same modified problem solved by Marilyn's proof, but that with the strategy he uses in the simulation for choosing the door to open, the probability is 1 that the car is behind door #2 when the contestant selects door #1 and the host opens door #3, because his strategy is for the host to always select door #2 when the contestant selects door #1 unless the car is behind door #2.

I always enjoy reading The C Users Journal and often find useful ideas in both the regular columns and feature articles, although I would find it more useful to have a greater percentage of the articles which are not operating system dependent or which deal with UNIX systems instead of DOS. Keep up the good work.

Sincerely,

J. Allen Crider
1935 Meadowbrook Dr., Apt. 804
Huntsville, AL 35803

Dear Mr. Plauger,

I must take exception to Michael Brandt's implication (CUJ July, 92), whether intended or implied that the computer is a tool to solve problems we don't understand. In his conclusion, Dr. Brandt seems to imply that in absence of agreement by scholars, a simulation can show who is correct. If the problem were one of intractability — the equations become too large or have no closed form — that is absolutely correct. This problem, however, is one of intractable logic. If one can rigorously prove that the stream of logic is correct, there is no need to simulate. If not, the simulation rests on questionable structure. I admit to being impressed (and not a little baffled) by the bit-fiddling demonstrated in his solution. I set out to find his error, and in the process, discovered that Ms. Savant was correct. A dictum of simulation says that you don't simulate something which can be determined analytically. I set out to see what really needs to be simulated. Consider: The doors need not have numbers, or they can be assigned arbitrarily. Let the door with the car be #1. Generate a random number from 1 to 3. If we are following the non-switching regimen, and the number is a 1, we win. Otherwise we lose. It matters not at all which door the host opens, since we know he will not reveal the car, and we will stand pat. The case is reversed for the switching option. The problem is that we insist on seeing a three way choice at first. We are really dividing the three doors into two groups, with the probability 1/3 that the car is in the "group" with only one door. If we take the chance to switch to the group with two doors (remembering that there is no new information provided in seeing a goat), we double our odds. Thus, if we know ahead of time whether we will switch, the die is cast (with apologies) when we choose a door, and nothing else need be simulated. Clearly, logical pursuit of a means to simulate a problem can lead to clearer understanding. A year ago, my statistics professor and I had "proven" that Ms. Savant was wrong. I only write to suggest that it is poor practice to imply that computers can find answers to the problems we don't understand, and to pose a challenge: Design an optimizing compiler "smart" enough to remove all of Dr. Brandt's code not required to run the simulation. No insult is intended. The program is truly interesting, and a valid "brute force" approach to simulating the game. I however, if it were necessary, it would be impossible to validate.

Sincerely,

Mitch West
7806 Old Hollow Ln
Ellicott City, MD 21043

P.S. Please get a CompuServe account. Not a BBS, just a mailbox. You must have other readers who are only connected by BellNet.

Dear Editor ofCUJ

I have a problem with the article on "Don't Mess with Marilyn", by Michael Brandt in the July 92 issue.

This is the puzzle with the car and the goats (some of us might prefer a goat to a car in fact, but let's say not.).

Consider the following reasoning:

1. Switching fails if and only if the first choice was in fact a car.

2. The probability of the first choice being a car is one-third.

3. So the probability of switching failing is one-third.

4. So the probability of switching succeeding is one minus one-third, that is two-thirds.

My problem is that I'm not a very clever chap, but this seems quite clear and also gives the right answer. If it is right, what is all this Monte Carlo simulation stuff for actually?

It seems a bad idea to employ brute-force computer demonstrations, when simple proofs are available. It gets our trade a bad name!

Yours

J Wheater
19a The Fairfield
Farnham
Surrey GU9 8AJ
England

Dear Dr. Plauger:

In my article "Don't Mess with Marilyn" (CUJ, July '92) I deliberately neglected to explain the correct solution to the game show puzzle proposed by Marilyn vos Savant in her Parade column. The purpose of writing the article was to have some fun, challenge the reader, and provide an educational example application of Monte Carlo simulation techniques using C. The letter by J. Wheater affords me an excellent opportunity to explain Ms.. Savant's non-numerical solution to the puzzle, and to clear up a misconception raised by the letter.

When the contestant selects door No. 1 there is a 1/3 probability that the car is behind it, and a 2/3 chance that it's behind one of the other two doors. At this point the host gives you a clue: If the car is behind No. 2, he shows you No. 3, and if the car is behind No. 3 he shows you No. 2. Therefore if you switch, you win if the car is behind either No. 2 or No. 3. In either case, you win! However, if you don't switch you only win if the car is behind No. 1. The key to the puzzle is that the host will always open a losing door which thereby constrains the solution.

With regard to the letter by J. Wheater then, all four points made are correct. However point 3 is correct only because the host has already opened a LOSING door. If the host does not open any door then the probability of a switch failing is 2/3 (you pick a door then change your mind — the probability of choosing a goat is the same as that of not winning, 2/3). Point 4 then follows trivially from 3. J. Wheater's answer is correct (just like the one derived numerically) but the explained reasoning is at best incomplete. It appears that the proof is anything but simple based on the statistics I quoted in my article. Even if it were simple, what's wrong with using the computer to do a little number crunching to solve a problem that may not be as intuitively obvious to the rest of us!

Michael E. Brandt, Ph.D.
The University of Texas
Health Science Center at Houston Medical School
Department of Psychiatry and Behavioral Sciences

Dear Dr. Plauger:

The article "Don't Mess with Marilyn" by Michael E. Brandt in the July 1992 issue contains erroneous conclusions. He claims to have modeled and verified Marilyn vos Savant's gameshow contestant puzzle. However, in his code, the host always picks the first door that has a goat but does not contain the car. This effectively gives the contestant additional information which skews the results. The rule "switch doors" inadvertently takes advantage of this information.

A special case illustrates this. Represent the doors using a three bit number with the lowest order bit being DOOR 0 and the highest being DOOR 2. Suppose the car is in DOOR 0 and the contestant picks DOOR 2. Namely:

CAR: 001
PICK: 100
The moderator will then pick DOOR 1. Given Mr. Brandt's inadvertent rule, the contestant then knows with absolute certainty that the car is behind DOOR 0. He knows this because the host always picks the first available door and if the car were not behind DOOR 0 the host would have picked it.

To be more complete, let's list all possibilities and obtain the probabilities by counting. For example if the car is in DOOR 0 we have (following Mr. Brandt's rule) the following possible picks:

Pick  Host Picks  Switch Doors  Stay

001   010         Lose          Win
010   100         Win           Lose
100   010         Win           Lose
We see that switching does indeed have a 2/3 chance of winning. However, if the host picks his door randomly amongst his possible choices, the first contestant pick above could also result in

Pick  Host Picks  Switch Doors  Stay

001   100         LOSE          WIN
thus giving the expected chance of winning of 1/2 since he wins two out of four times. The other possible positions of the car give the same result so that the contestant's overall chances of winning are indeed 1/2, given the puzzle as originally stated.

Mr. Brandt apparently intended this to be an example of how a computer simulation could provide the true solution to a problem that 65% of Ms. Savant's readers, (including, as he likes to point out, many highly trained PhD's) missed. I think what he has actually shown is that computer models do not relieve a person of the need to have a clear understanding of the problem being modeled. If such a seemingly harmless assumption in such a simple problem can cause such absurd results, imagine what can happen in much more complicated cases.

Sincerely,

David Hand
9237 Clubview Drive
North Huntingdon, PA 15642
CompuServe ID # 70621,3624
P.S. Ms. Savant's column often contains ridiculous statements. For, example, in a recent column, she showed a rectangle of a certain area. The rectangle was cut into four parts and rearranged into another "rectangle". The second "rectangle" seemed to have an area one larger than the original. This is clearly not possible. The area of a shape is the sum of the areas of its parts. The areas of the parts do not change by moving them around. What she failed to realize was that the second rectangle was not geometrically possible. There was in fact a small gap that accounted for the extra area.

Drawing the second erroneous "rectangle" is in some respects similar to a computer model and again illustrates what can happen when a person does not clearly understand the problem at hand.

Dear Mr P.J. Plauger,

I just bought Microsoft C/C++ version 7, and I'd like to know if there are any books that teach C using that compiler, on different topics like fractal designing, graphics, animation, and, of course, the basics. I also bought An Introduction to Object-Oriented Programming by Timothy Budd, this books explains all the concepts and it must be a very good book when you have Mr. Budd as a teacher in class, but unfortunately it lacks examples since those examples needs you to try it in to many languages. If there's one oriented on Microsoft C or on Turbo Pascal please mention it.

Alain Lafond
2311 St-Donat
Montreal, Quebec
Canada
HlL-5K3

P.S.: A last question: I saw that in the Journal (mostly) in the listings no mentions of the associated compiler is made. Does that mean that it's Standard C that works with all?

I can't keep up with all the books on C and C++. I personally haven't run across one geared specifically to Microsoft v7. I can, however, strongly recommend Scott Meyer's Effective C++ (Addison Wesley, 1992) as a generic text.

We ask our authors to identify code that depends on a specific dialect of C. Otherwise, we aim to print Standard C code as much as possible. pjp

Dear Mr. Plauger,

Having just received the June issue of the C Users Journal, I want to let know know how enchanted I was to see the front page being decorated with a wrench, measured in modern metric units. My European eyes spotted immediately that is was a 9 mm wrench, not a 7/16!

European software has long been a stepchild of the US market, despite the successes of respectable products and companies such as Software AG (Natural database) and Softlab Inc. (Maestro development environment), and languages such as IF/Prolog and the object-oriented Eiffel language. This list can be extended with excellent products from the UK, France, and Scandinavia.

I hope that your commitment to the worldwide market goes beyond the front page and I am looking forward to an international product review in your publication.

Yours sincerely,

Wolf Metzner, President
American InterFace Computer Inc.
One Westlake Plaza, Suite 200
1705 Capital of Texas Hwy. South
Austin, Texas 78746
Phone (512) 327-5344
Fax (512) 327-5176

We keep inching toward the metric system. Thanks to ISO, we are being dragged forcibly toward better international standards for programming languages. It's a matter of time. pjp