Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site kobold.UUCP Path: utzoo!linus!decvax!genrad!grkermit!masscomp!kobold!tjt From: tjt@kobold.UUCP (T.J.Teixeira) Newsgroups: net.math Subject: Re: Let's Make a Deal Message-ID: <165@kobold.UUCP> Date: Sat, 8-Oct-83 11:50:21 EDT Article-I.D.: kobold.165 Posted: Sat Oct 8 11:50:21 1983 Date-Received: Tue, 11-Oct-83 05:13:01 EDT References: <169@mi-cec.UUCP> Organization: Masscomp, Littleton, MA Lines: 43 Having read Dave Martindale and Dan Klein's responses (always switching doors gives you a 2/3 chance of winning), I don't believe it. Firstly, if you hypothesize a second contestant who will win what is behind the other door, both contestants can increase their chance of winning to 2/3 by swapping doors! Secondly, I did my own simulation: ================================================================================ 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); if (montysdoor == door) monty++;/* Monty shows me the car */ else 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 3302 wins 3258 losses 3440 door #1 3330 #2 3419 #3 3251 ================================================================================ If Dave and Dan are right, why are the wins and losses roughly equal, and what's wrong with my simulation (no flames please on coding style -- it's just a 60-second hack)? I showed you mine, now show me yours!