The Grey Labyrinth is a collection of puzzles, riddles, mind games, paradoxes and other intellectually challenging diversions. Related topics: puzzle games, logic puzzles, lateral thinking puzzles, philosophy, mind benders, brain teasers, word problems, conundrums, 3d puzzles, spatial reasoning, intelligence tests, mathematical diversions, paradoxes, physics problems, reasoning, math, science.

Author Message
Ghost Post
Icarian Member

 Posted: Mon Dec 13, 1999 6:17 pm    Post subject: 1 I just read the answers to the Monty Hall problem and cannot believe so many people who posted an incorrect answer. The correct answer is you have a 50% chance. it is easy to get lost, by the mis-leading cases posted. The problem with the other answers is that they fail to incorporate the following fact. The hosts choise is not random when the wrong door is intially selected, but is random if the correct door is selected. Given one possiblity of Door1=Correct, Door2=Door3=Wrong, the following possibilties arise Pick Remove Left Stay Switch 1 2 3 W L 1 3 2 W L 2 3 1 L W 3 2 1 L W The results will be the same for the other two cases, thus resulting in a 50% chance. The puzzle would be the same if the host had removed the door first and then asked you to pick (ie. the same 50% chance). Others have forgotten that there are two possible outcomes when the correct door is selected first. If you still do not see the light feel free to e-mail me and I will show you the way. (smcadams@mccormicktaylor.com)
Amy
Daedalian Member

 Posted: Mon Dec 13, 1999 6:27 pm    Post subject: 2 Given that we can demonstrate empirically that the odds are better if you switch, why are we still bothering to argue about this?
Ghost Post
Icarian Member

 Posted: Mon Dec 13, 1999 6:32 pm    Post subject: 3 Because the posted answer is wrong. I don't think a wrong answer should be left up there as if it were correct. If you want to can empirically show me a wrong answer, that's fine, but I thought others may want the correct answer.
Ghost Post
Icarian Member

 Posted: Mon Dec 13, 1999 6:39 pm    Post subject: 4 You didn't answer Amy's question, which is: If you perform an experiment with a large number of trials, you will find that you will win approximately 2/3 of the time when you switch. How can this be?
Ghost Post
Icarian Member

 Posted: Mon Dec 13, 1999 6:58 pm    Post subject: 5 Also, you wrote: >Given one possiblity of Door1=Correct, Door2=Door3=Wrong, the following >possibilties arise code:``` >Pick Remove Left Stay Switch >1 2 3 W L >1 3 2 W L >2 3 1 L W >3 2 1 L W ``` >The results will be the same for the other two cases, thus resulting in a 50% chance. The mistake you make here is obvious. You list 4 outcomes, 2 of which result in losing when you switch, and two of which result in winning when you switch. You conclude, from 2 out of 4, that you have a 50% chance of winning when you switch. But it is quite obvious that the four outcomes are not equally likely. Two of those outcomes only occur when you pick door #1 (which is the winning door). If they are all equally likely, then you are presupposing that there is a 50% chance that you will initially pick the winning door (i.e., when door #1 is correct, 2 out of 4 of your supposedly equally likely scenarios have you picking door #1). [This message has been edited by extro... (edited 12-13-1999).]
Calfaile
Daedalian Member

 Posted: Mon Dec 13, 1999 9:11 pm    Post subject: 6 But for the two choices where you pick the wrong door, there is no other door to remove (Like in the third possibility, there is no other door you can remove). (I know that 2/3 works, can someone point out the flaw in my logic?)
Calfaile
Daedalian Member

 Posted: Mon Dec 13, 1999 9:14 pm    Post subject: 7 Oh. NVM, I get it! possibility 3 and possibility 4 must be concidered TWICE (So that u have an = possibility of choosing all three doors). Which results in a 2/3 win for switching! The fact that two of them are the same have nothing to do with it! Sheepish, -Calfaile [This message has been edited by Calfaile (edited 12-13-1999).]
Ghost Post
Icarian Member

 Posted: Tue Dec 14, 1999 11:27 am    Post subject: 8 All right, mcadams. I hereby offer to play 100 rounds of Monty Hall with the following payoffs: For each round, I will pay you \$110 if I lose, and you'll pay me \$100 if I win. Name the place and the moderator.
Terry
Guest

 Posted: Wed Dec 15, 1999 7:11 pm    Post subject: 9 I enjoy this puzzle more when the conversation is live because it takes less time. Perhaps, mcAdams is just having fun with the forum members. Anyway, here's my 2 cents... The problem is directly the equivalent of step #1 - pick a card, any card step #2 - from the remainder of the deck I will discard 50 cards which are not the Ace of Spades. This leaves you with one card and me with one card. Question: who is more likely to have the Ace of Spades? Answer: ME! Only 1 time in 52 would you have picked the correct card first. Compare this to the following... step #1 - from a full deck of cards I will discard 50 cards which are not the Ace of Spades. step #2 - pick a card from the remaining 2 cards in my hand. Question: who is more likely to have the Ace of Spades. Answer: 50/50 The logic flaw in the 50/50 answer to Monty Hall problem is that when he opens a bad door, you assume that the problem has been reduced. It hasn't. Monty has simply told you something you already knew, and that is that one of the remaining two doors is not the correct one. Try the card test with someone and think why the games are different. If you really want to discuss it more, we can take it out of the forum so as not to frustrate anyone else.
Wonko the Sane
Daedalian Member

 Posted: Thu Dec 16, 1999 8:02 pm    Post subject: 10 The card test that you posted is also incorrect. In the card test, you fail to include the most important aspect of the puzzle. You don't allow whoever drew first to trade cards with you. Here's how the problem should go Nobody can look at their card until the end of this experiment. I pick a card out of 52. I have a 1/52 chance of getting the Ace of Spades You discard 50 cards that aren't the Ace of spades. 51/52 chance of ending up with it. (The only case you don't get it is if I pick it) Right now, there are two cards, either I have it, or you have it. Although I only had a 1/52 chance of PICKING it, I no longer have a 1/52 chance of HAVING it because there are not 52 to cards that can be the ace of spades. There are 2, one is, one isn't. You have card one and card two, each one has a 50% chance of being the ace of spades. Now, I'm offered the option to trade cards. There are four cases. Case 1: I have the ace of spades a) I keep it and win (25%) b) I trade and lose (25%) Case 2: I don't have the ace of spades a) I keep my card and lose (25%) b) I trade and win (25%) Combine odds, I have a 50% chance of winning, and a 50% chance of loosing. The size of the system is inconsequential. By giving the option to trade, you're now working with a reduced system. The old system has been completely destroyed, it no longer matters.
Evil Empire
Soopy's Favourite

 Posted: Thu Dec 16, 1999 8:16 pm    Post subject: 11 Hey Wonko the Insane, Try your experiment with a friend. Since, by your logic you have a 50% chance of winning if you don't trade cards keep yours to make the experiment simple. You should do it 100 times and to make it exciting you should throw some cash down on it. Good Luck. PS. If you need someone do discard the non Ace of Spades for you I will make myself available.
mithrandir
Daedalian Member

 Posted: Thu Dec 16, 1999 8:55 pm    Post subject: 12 wonko, i think you need a refresher course in probability. lets say you take a card. you have a 1/52 chance of having the ace of spades. now, i'll take the other 51 cards. I have a 51/52 chance of having the ace of spades. now, we both know i have at least 50 non ace of spades cards. so i can get rid of these 50 cards, WITHOUT affecting the probabilities. now, lets look at the monty hall problem. what is the probability you pick the correct door at first? 1/3 now lets say instead of opening a wrong door and giving you the option of switching, he just gives you the option of taking both doors. what are the odds of one of those two doors being the right one? 2/3 so how is this any different? it's not.
Terry
Guest

 Posted: Thu Dec 16, 1999 9:02 pm    Post subject: 13 So Wonko, what you're saying is both games I presented are the same. What you're also saying is that in that first game you'd be just as happy to stick with your original card as to switch with me. Let's modify the game and see where it leads us... Step #1 - pick a card any card Step #2 - This time I don't throw away any cards. I just keep the rest of the deck in my hand. Question: who is more likely to have the Ace of Spades. Now you might say that of course the odds are better now because I kept 51 cards in my hand. This is exactly accurate. What is also true is that both you and I know that at least 50 of those cards are NOT the Ace of Spades, right? So what if I decide to show you those 50 bad cards? The odds don't change, it is still highly likely that the card that I don't show you is the Ace of Spades. Please try both games from yesterday with a friend and observe the difference for yourself.
Andy
Daedalian Member

 Posted: Thu Dec 16, 1999 9:16 pm    Post subject: 14 Wonko - your suggested experiment is intriguing, but there are some details omitted. For example, if neither of the participants is allowed to look at the cards until the exp is finished, how can you be sure the ace of spades isn't among the 50 cards you discarded? The presumption in the original version is that you (the player) pick a card, and then I (the dealer) discard 50 cards that I have examined and determined to be not the ace of spades. Having a third party examine them doesn't really change anything; the result is that if the ace of spades is among the 51 cards you didn't pick, I will have it; if you picked it, I will have one of the other cards. 51 times out of 52 I will have the ace of spades whether I examined the 51 cards myself or had someone else do it for me. If in fact you intend that no one look at any of the cards until the game is over, then we do have a 50/50 proposition - sort of. If we discard 50 cards without looking, then I keep the last card and you have the card you picked. When we examine the 50 discards, we will find 50 times out of 52 that the ace of spades has been discarded. We can decide to replay the game when that happens. We then will have a useful result only twice out of 52 games, when you picked the ace of spades or it wasn't discarded so I still have it. In this case, you will have the ace of spades half the time and I will have it the other half - but this only happens because we threw out the 50 times when neither of us had it. Do you have a better way to discard 50 cards without looking, and ensure that the ace of spades isn't among them? A Monty Hall version of this would be: you pick a door. Monty then picks one of the other doors randomly and opens it. If the prize is behind Monty's door, he closes it, the prize is placed behind a randomly-chosen door, and you start over. If the prize is not behind Monty's door, you may either keep your door or switch to the other unopened door. In this game, you have a 50% chance of winning the prize either way. The difference is that here, Monty chooses a door at random. In the original game show, his choice isn't as random - he must choose a door that doesn't hide the prize. This is a significant difference.
Wonko the Sane
Daedalian Member

 Posted: Thu Dec 16, 1999 11:41 pm    Post subject: 15 I concede. Had to prove myself wrong though first. I wrote a C++ program (another one) that will calculate a user-specified number of trials for a user-specified number of objects (I'll put it at the bottom). Sorry about the junk code I posted on the other thread, I have to say I did it the long way. Anyway, with 500,000 trials of 52, there were something like 490,000 wins and 10,000 losses. The numbers for the actually Monty Hall problem were a bit ambiguous, but the odds still landed better if you switched. Anyway, here's the code. Good show. Thanks for driving it in to my head. I was being rather dense. ~Wonko //Sorry about the lack of comments... //I threw this together in 5 minutes. #include #include #include #include main() { time_t t; srand((unsigned) time(&t)); clrscr(); int q,j,k,e,f,w=0,l=0; bool c; cout << "How many trials? "; cin >> j; cout << "How many objects? "; cin >> q; bool a[q]; for (; j > 0; --j) { c = false; for (int i = 0; i < q; ++i) { k = rand() % 2; if (k == 1 && c == false) { c = true; a[i] = true; } else a[i] = false; } f = rand() % q; if (!a[f]) ++w; else ++l; } cout << endl << "Wins: " << w; cout << endl << "Losses: " << l; return 0; }
Lisa
Guest

 Posted: Sat Jan 08, 2000 8:02 pm    Post subject: 16 All this discussion is quite amusing when you consider probability laws and the probability of each choice itself. We have already established, and I'm sure everyone agrees that on the onset of the game, you have a 1/3 chance of choosing the right door. So, the probabitily looks something like this... doors 1 2 3 y n n n y n n n y y=good prize n=not so good prize We are all forgetting that probability relies on what is unknown based on chance...does not rely on what is certain. So now, regardless of whether or not the door with the good prize is initially chosen, when one of the doors is revealed, it has now become a certainty....which is always a not so good prize...so your odds become, and were meant to be from the beginning, 1/2 - yes or no - good prize or bad prize...Once you are certain about what is behind one of the doors, you can't just shift it's initial probability worth onto the door you haven't chosen...that doesn't make any sense. If that still doesn't rub you right, then consider this... Suppose you choose any one of the outcomes stated above...it really doesn't matter which one, because they are all essentially the same... We'll go with outcome 1 door 1 2 3 y n n a.) you pick 1, then are shown 2 b.) you pick 1, then are shown 3 c.) you pick 2, then are shown 3 d.) you pick 3, then are shown 2 Regardless of which door you choose, the above 4 are the only possible outcomes. Each of the above has a 1/4 chance of happening. Now within each choice, there is a 1/2 chance that you stay or switch and since the door they show is not an option, your options are now down to 2 and you can only make 1 choice, therefore 1/2. You see, each of the above (a-d) has a 1/2 chance that you stay or go. In options a and b, if you stay you win. In option c and d, if you switch you win. So to stay and win has a 2/4 chance and to switch and win also has a 2/4 chance. So the probablities are 50% and there is no benefit what-so-ever to switch or stay. It is just as probable as a flip of a coin....
Lisa
Guest

 Posted: Sat Jan 08, 2000 8:11 pm    Post subject: 17 ...another thing...door number 1 seems like it's being chosen twice, but it isn't, it relies on which ever door is revealed by the host making both outcomes totally valid and does not imply that the other two must be considered twice each....this is ridiculous...probabitily relies on each possible outcome and there are only 4, you can not add an outcome twice and say "it's not fair"...probability doesn't work that way....
Quailman
His Postmajesty

 Posted: Sat Jan 08, 2000 9:46 pm    Post subject: 18 This has been addressed extensively here and in the old forum, but I like to beat a dead horse, so here goes: If you choose door 1, your chances are 1/3. If Monty then offers to let you switch to doors 2 AND 3, your chances would be 2/3. If he opens a loser among those two before you switch - and it was 100% that there was at least one loser there - your odds will still be 2/3. And the odds that you chose correctly the first time are still 1/3. It doesn't matter that he showed you that there was a loser in the two you didn't chose. That is a given.
Ghost Post
Icarian Member

 Posted: Sat Jan 08, 2000 9:55 pm    Post subject: 19 To repeat a question asked earlier, I would be most curious as to how you would explain the following: If you perform an experiment with a large number of trials, you will find that you will win approximately 2/3 of the time when you switch after a door that you didn't pick, and without a prize behind it, is opened. How can this be? Also, you listed four outcomes, as follows: a.) you pick 1, then are shown 2 b.) you pick 1, then are shown 3 c.) you pick 2, then are shown 3 d.) you pick 3, then are shown 2 And claim "Each of the above has a 1/4 chance of happening." What you need to understand is that it is not always true that all outcomes have an equal probability of occuring. The probabilities associated with the above outcomes are as follows: a.) you pick 1, then are shown 2 --- 1/6 b.) you pick 1, then are shown 3 --- 1/6 c.) you pick 2, then are shown 3 --- 1/3 d.) you pick 3, then are shown 2 --- 1/3 Again, if they each had probability 1/4, then you would have to conclude that there is a 1/2 probability that you pick 1 (when 1 is the winner), because the two cases where you pick 1 each have probability 1/4, and 1/4 + 1/4 = 1/2
Andy
Daedalian Member

 Posted: Mon Jan 10, 2000 6:03 pm    Post subject: 20 Lisa - I'm not going to try to give you instruction in probability theory; I've posted enough elsewhere as have many others. I recommend that you consider some independent study. A book that I found to be eminently readable is _Probability, Statistics, and Truth_ by Richard von Mises, Dover Publications, Inc., ISBN 0-486-24214-5. The first version of this book was published in German in 1928; the Dover edition was first published in 1981.
Terry
Guest

 Posted: Mon Jan 10, 2000 9:22 pm    Post subject: 21 I must admit that this is probably my favorite dead horse to beat so.... Lisa: Consider what effect you picking a door to begin with has on the game. What it does is force Monty, 2 of 3 times, to open the only remaining lousy door, thus pointing you to the winning door. Consider how the game might work if Monty did not allow you to first choose a door. This version, in fact, would leave you with a 50/50 probability given the remaining two doors. I think you should carefully think about the version of the game where you get a first pick and the version where you don't. You are still left with 2 doors, yet the odds are different. Why?
Drew
Guest

 Posted: Fri Jan 14, 2000 2:08 am    Post subject: 22 I have seen many explination for why it is better to switch, but most of them do not come across very clearly and leave people not quite believing the logic. Here is the explination that I find to be most easily understood: First, consider the possible ways that the prize can be placed behind the three doors. There are three different arrangements. The prize is either behind door 1, door 2, or door 3. We are assuming that each of these cases is equally likely. Now lets see what happens in each case. We'll assume that we choose door 1. It is okay to assume this because the numbers are arbitrary (if we had chosen another door we could relabel the doors and call the one we picked door 1 instead). Case #1 ------------ The prize is behind door 1. In this case, it doesn't matter which of the other doors is opened. Monty can pick randomly. In any case, if we switch we don't get the prize. If we stay we get it. In this case, switching wins 0% of the time. Case #2 ------- The prize is behind door 2. In this case, Monty will open up door 3 to show us the prize is not there. If we switch we win. In this case, switching wins 100% of the time. Case #3 ------- The prize is behind door 3. In this case, Monty will open up door 2 to show us the prize is not there. If we switch we win. In this case, switching wins 100% of the time. Put it all together ------------------- Each case is equally likely(1/3) to occur. If you always switch, you will win 2/3 of the time. To summerize: p=prize, n=nothing 1 2 3 outcome p n n lose n p n win n n p win If you have a problem with the "assume we chose door 1" idea, feel free to use the same logic without this assumption. You'll have 9 cases (3 arangements * 3 door choices) to work out. The result is the same.
Nora
Guest

 Posted: Sun Jan 16, 2000 6:21 pm    Post subject: 23 I know I'm late to contribute to the "Monty Hall" problem but here's my two cents worth. Most people's initial intuition is that the chances are fifty-fifty when asked to switch. After reading the answer (that you should switch) I agreed with it logically it but I still could not put it into an intuitive perspective at first - well, here's my new 'intuitive explanation' "When you picked initially, you probably picked wrong (one in 3 chance), therefore when given the chance to reconsider you should take it (since now you have a one in two chance, but don't forget, initially you probably picked wrong)". Works for me and it is easy to understand intuitively now.
Ghost Post
Icarian Member

 Posted: Fri Jan 21, 2000 2:02 pm    Post subject: 24 Don't make the solution harder than it is. The easiest way to understand is to use the demo at the bottom of the solution. Pick the same door (let's say 'A') each time and DON'T switch. Ignore the results counter (we'll assume it is rigged) and just observe the individual outcomes. When the prize is behind door 'A', you win. If it is behing 'B' or 'C', you lose. A 1 in 3 chance of winning. Now keep picking door 'A', but always switch. You will soon notice that if the prize is behind door 'A' you lose, but if it is behind EITHER 'B' or 'C' you ALWAYS win. Basically, if you initially choose the wrong door, which there is a 2 in 3 chance of doing, the second wrong door will be opened by Monty, regardless of which other door it is, and you will win by switching since the only door left will contain the prize. To summarize: If you DON'T switch you HAVE to pick the CORRECT door to win. Odds are 1/3. If you DO switch, you need to initially pick the WRONG door to win. Odds are 2/3.
Ghost Post
Icarian Member

 Posted: Fri Jan 21, 2000 10:53 pm    Post subject: 25 I certainly agree, but I don't see why my explanation is any more difficult - I have said exactly what you have.
Ghost Post
Icarian Member

 Posted: Sat Jan 22, 2000 5:47 am    Post subject: 26 Sorry Nora, that wasn't directed at you. It just seems that some are following a red herring and making this harder than it needs to be.
Murray
Daedalian Member

 Posted: Tue Feb 01, 2000 5:05 pm    Post subject: 27 Actually, Nora, there is an oddity in your explanation. You say: "When you picked initially, you probably picked wrong (one in 3 chance), therefore when given the chance to reconsider you should take it (since NOW YOU HAVE A ONE IN TWO CHANCE, but don't forget, initially you probably picked wrong)." By saying that one has a fifty-fifty chance at some point, you are introducing a falsehood. I'm glad you were able to come up with a method to help you understand this non-intuitive problem, but you must be careful about your phrasing.
Ghost Post
Icarian Member

 Posted: Fri Feb 04, 2000 4:57 am    Post subject: 28 McAdams is strangely quiet. Perhaps off attending the annual meeting of the flat earth society.
Ghost Post
Icarian Member

 Posted: Thu Feb 10, 2000 6:00 am    Post subject: 29 I believe the solution to the Monty Hall puzzle is RIGHT and can be proved. Let's approach it like this. The chances of having a choc/gold combination with the host is 2/3. (It is the complement to the chance of your having selected the gold). If the combination with the host is choc/gold, you're home. He will eliminate the choc and give you the gold. So, put together now : Chances of your selecting gold - 1/3 Chances of the host giving you the gold - 2/3 Cheers.......Karthik
Amy
Daedalian Member

 Posted: Thu Feb 10, 2000 6:28 pm    Post subject: 30 Um, RK, I think you (and everyone else posting on this matter) are just preaching to the choir now. Is there anyone left here who *doesn't* think the posted solution to this puzzle is correct? Let's have a show of hands. If everyone is convinced, then can we please stop explaining the same solution over and over again, unless someone actually has a new twist to offer?
Quailman
His Postmajesty

 Posted: Thu Feb 10, 2000 6:59 pm    Post subject: 31 Amy, that was RK's first post to the discussion forums. I think it's become sort of an initiation rite to document your own personal understanding of the logic behind Monty's doors. The next step might be to add to the celebrities thread, or guns or movies...
Quailman
His Postmajesty

 Posted: Thu Feb 10, 2000 7:10 pm    Post subject: 32 Besides, when smcadams of Philadelphia, PA started this thread, he must have checked the box to be notified any time a reply is posted. When I hit the [Submit Reply] icon in a moment, my screen will clear and some several lines of fine print will show up . The last line has an e-mail address. This is the thread where we should hold our next 'race to 100.'
Evil Empire
Soopy's Favourite

 Posted: Thu Feb 10, 2000 8:41 pm    Post subject: 33 32
araya
Daedalian Member

 Posted: Fri Feb 11, 2000 1:25 am    Post subject: 34 Hey guys!!! guys guys guys! I just noticed that the monty hall problem is a big sham! It's actually better not to switch! I figured it out! You're all wrong! It's weird that you could all be wrong but you are! Okay, talk amongst yourselves. I'll be back in a year and half.
Monty Hall
Guest

 Posted: Fri Feb 11, 2000 1:59 am    Post subject: 35 I guess I'm just going to have to settle this once and for all. Araya is right as usual. I've been waiting for someone to step forward all along and discover the horrible truth. Araya, thank you. Without you I would be spinning in my grave. Wait, I'm not dead yet, am I? Well, anyway, the celebrity I most resemble is myself. Am I still a celebrity? Probably nowhere else but the GL. Once I was on top and now I'm nothing but a GL piece of trivia. How much lower could someone sink? If Buzzsaw only knew this, he would feel much better. Araya, you explain the math. I'm too depressed.
Amy
Daedalian Member

 Posted: Fri Feb 11, 2000 4:09 pm    Post subject: 36 Teehee! Actually, my dad told me that an analysis of this puzzle was published in a statistical journal he gets, and in the next issue there was a flurry of letters debating the solution (the only people who read this journal are professional statisticians and even *they* didn't all agree on it!). In the issue after *that*, there was a flurry of responses to the previous responses, one of which was from none other than...Monty Haul. I guess he wanted to clarify a couple of points, like "Yes, I did always know which prize the door was really behind, and yes, I did always reveal one of the phony prizes." I don't know whether he gave any indication of what percentage of contestants chose to switch.
Ghost Post
Icarian Member

 Posted: Sat Feb 12, 2000 2:53 am    Post subject: 37 OMG.
Ghost Post
Icarian Member

 Posted: Sat Feb 12, 2000 3:15 am    Post subject: 38 Guys, check out http://math.rice.edu/~ddonovan/montyurl.html I used to wonder why so much attention has been given to this rather simple probability puzzle. I'm just now starting to realize its profound significance for human psychology. Kewl.
C.D.Wright
Guest

 Posted: Fri Feb 18, 2000 10:10 am    Post subject: 39 As Ellis says, the point of this is actually the human psychology. If you sell raffle tickets, you might be able to get one price for them, but if you let people choose their own numbers you can sell them for more, often much more. People get attached to their own choice, right or wrong, and the game show ensured that this very human reaction reduced the number of times they had to give away the car.
Wonko the Sane
Daedalian Member

 Posted: Fri Feb 18, 2000 3:10 pm    Post subject: 40 Okay, I finally when and patched up this code so it really works. If anyone wants a compiled version then I'll post my e-mail address, send me an e-mail and I'll reply with the .exe for this. Anyway, you feed it the number of objects you want to use and how many trials you want to run (if you run a LOT of trials it can take awhile). It generates two random numbers, each one between 0 and one less than the number of objects (that's just how the modulus function works and it's pointless to add on because the user never sees the intermediate value). Then it has 4 vars, one is how many wins if you switch, one is how many losses if you switch, one is how many wins if you don't switch, and one is how many losses if you don't switch. To find out if you win or lose, it compares the two random numbers, if they are the same, then you win by staying, lose by switching, if they are different, then you win by switching, lose by staying. You'll find that the probability of winning if you stay is about 1 / the number of objects. You'll usually get some deviation after the first 3 digits, but I think this is pretty conclusive. Here's the code. //This is pretty much universal. Compile it with whatever C++ compiler you want. //Authored by Wonko the Sane //Modified on a few days that I'm not listing //include files #include #include #include #include //main function main() { clrscr(); //clear the screen time_t t; srand((unsigned) time(&t)); //set the random seed int q,j,i,d,c,switchWins=0,switchLosses=0,stayWins=0,stayLosses=0; //bunch of vars for various purposes //input cout << "How many trials? "; cin >> j; cout << "How many objects? "; cin >> q; for (i = 0; i < j; ++i) { d = rand() % q; //get a random door c = rand() % q; //get a random choice if (d == c) //if you win by staying { ++stayWins; //add to wins by staying ++switchLosses; //add to losses by switching } else //if you win by switching { ++switchWins; //add to wins by switching ++stayLosses; //add to losses by staying } } //final output cout << "Staying yeiled:" << endl << stayWins << " wins." << endl << stayLosses << " losses." << endl << "Switching yeiled:" << endl << switchWins << " wins." << endl << switchLosses << " losses." << endl; return 0; //exit program }
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year by All usersAmyAndyAnonymousarayaCalfaileEvil EmpireGhost PostmithrandirMurrayQuailmanWonko the Sane Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum Puzzles and Games----------------Grey Labyrinth PuzzlesVisitor Submitted PuzzlesVisitor GamesMafia Games Miscellaneous----------------Off-TopicVisitor Submitted NewsScience, Art, and CulturePoll Tournaments Administration----------------Grey Labyrinth NewsFeature Requests / Site Problems
You cannot post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum