Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1exp 10/6/83; site ihuxl.UUCP Path: utzoo!linus!decvax!harpo!gummo!whuxle!pyuxll!eisx!npoiv!npois!hogpc!houxm!ihnp4!ihuxl!leo From: leo@ihuxl.UUCP Newsgroups: net.math Subject: RE:Monty Hall simulation by kobold.UUCP (T.J.Teixeira) Message-ID: <651@ihuxl.UUCP> Date: Tue, 11-Oct-83 12:28:30 EDT Article-I.D.: ihuxl.651 Posted: Tue Oct 11 12:28:30 1983 Date-Received: Thu, 13-Oct-83 01:14:33 EDT Organization: AT&T Bell Labs, Naperville, Il Lines: 45 The problem with the simulation is that Monty Hall NEVER EVER shows you the door with the good prize. The simulation presented assumes that he might randomly pick the good door. He knows which is the good door, and he only picks randomly if you picked the good door. He has no choice if you picked a loser; he must pick the other loser. I did a quick and dirty modification to the program to take this into account, and below is the result. =============================================================================== int wins; /* number of times I win by switching doors */ int losses; /* number of times I lose after switching */ int monty; /* number of times Monty shows me the good door */ int doors[3]; /* count how often each doors is a winner */ /* to verify the random number generator */ main() { register int i, door, mydoor, montysdoor; for (i = 0; i < 10000; i++) { /* pick a winning door at random */ door = rand() % 3; doors[door]++; /* I pick a door at random */ mydoor = rand() % 3; /* Monty picks a door, but not mine! */ while (((montysdoor = rand() % 3) == mydoor) || (montysdoor == door)); if (mydoor != door) wins++; /* I win by switching */ else losses++;/* I feel like a sap! */ } printf("monty %d wins %d losses %d\n", monty, wins, losses); printf("door #1 %d #2 %d #3 %d\n", doors[0], doors[1], doors[2]); } =============================================================================== monty 0 wins 6598 losses 3402 door #1 3275 #2 3382 #3 3343 As anyone can see, if Monty never picks the right door, the odds change drastically from the original simulation. Leo R. ihnp4!ihuxl!leo