• Advertisement
Sign in to follow this  

Probability Challenge

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have run into a probability problem that I cannot seem to grapple with. Put plainly: You are on a game show. There are three doors, two have goats behind them and one has a BMW behind it. You pick one door. The game show host shows you one of the doors (NOT the door you picked) with a goat behind it. So you are left with two doors, one with a goat and one with a BMW. The game show host then says that if you want, you can switch to the other door to try and get the car. Are your odds of winning better if you switch doors? Is the probability of winning if you stay with your guess 1/2 or 1/3? Please explain why. I even wrote this computer program to test this (source code below), but it seems to reaffirm the probability of 1/3. Thanks
[SOURCE]
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#define GOAT 0
#define BMW 1

int _tmain(int argc, _TCHAR* argv[])
{
	long lTests;
	long lRight = 0;									// The number of times staying made you right
	long lWrong = 0;									// The number of times staying makes you wrong
	srand(time(NULL));		// Set the seed for our random number generator to the current time.
	printf("How many test runs would you like to do?\n");
	scanf("%li", &lTests);
	for(long i=0; i<lTests; i++) {
		char pDoors[3];
		memset(pDoors, GOAT, sizeof(char)*3);			// Set's the 3 doors to goats
		int iIndex = rand() % 3;						// Get a random number, either 0, 1, or 2
		pDoors[iIndex] = BMW;							// Set one of the doors to have a BMW
		printf("Door order: ");
		for(int j=0; j<3; j++) {
			if(pDoors[j]==GOAT)
				printf("Goat ");
			else if(pDoors[j]==BMW)
				printf("BMW ");
			else
				printf("System Error ");
		}
		printf("\n");
		int iSelection = 2 - rand() % 3;
		printf("You originally selected door number %d.\n", iSelection);
		int iGiveAway;
		for(;;) {
			iGiveAway = rand() % 3;
			if(iGiveAway!=iSelection && iGiveAway!=iIndex)
				break;
		}
		printf("The host tells you that door %d is a goat.\n", iGiveAway+1);
		for(int i=0; i<3; i++) {
			if(i==iGiveAway) 
				printf("Goat ");
			else
				printf("???? ");
		}
		if(iSelection==iIndex)
			lRight++;
		else
			lWrong++;
		printf("\n");
		printf("\n");
	}
	printf("The number of times staying with your first guess made you right: %li\n", lRight);
	printf("The number of times staying with your first guess made you wrong: %li\n", lWrong);
	return 0;
}


[/SOURCE]

Share this post


Link to post
Share on other sites
Advertisement
Google for the Monty Hall Problem. This has been debated into the ground. I think this is a good example, although you have to scroll down about half a page before it gets to the actual problem.

CM

Share this post


Link to post
Share on other sites
your original guess is going to be right 1/3 of the time ... PERIOD.

so if a game show was set up so that is ALWAYS showed you a wrong door and then let you pick between the 2 remaining ... then you should switch ... because then it is like saying ... if their was a 2/3 chance you picked wrong, and then they remove a wrong answer from the equation. In the 2/3 of cases where you picked wrong, switching is 100% going to be right ... so in 2/3 of the original cases, you should switch.

Now if it was a FAIR revelation, they would randomly reveal a door - which would be the BMW some of the time (and hence remove the possibility of you changing those losses to wins) ...

Share this post


Link to post
Share on other sites
And here is another thread adequately discussing the problem.

Share this post


Link to post
Share on other sites
Agreed... please don't post any more in this thread unless after reading the ample solutions to this problem within the archives of GD.net you still don't understand... which is unlikely, because I KNOW there are clear explanations in those archived threads...

Happy hunting,

Timkin

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
Formulate the question like this:

"Would you like to choose one door, or the union of the two other doors?"
That's how I originally solved it, in less...mathematical words.

Essentially, you had a 1/3 chance to choose the right door. After being told one of the others is not it, the chance that your pick was right is STILL 1/3... and probability always adds up to 1.

I liked statistics, too bad the teacher was a dick.

Share this post


Link to post
Share on other sites
Ahhh, good ole' Monty Hall.

I once pepped up a presentation on Bayesian Statistics with a few brief interludes for statistical swindles (Monty Hall, the St Petersberg Paradox (although strictly speaking this isn't a swindle), some postal swindles I have come across). This was a presentation to a group of medical folks (doctors, professors, some PhDs).

The discussion of this particular topic got particularly heated. There were one or two folks who just would not accept that switching doors was a good idea.

I'm not sure how much of the Bayes stuff they took away, but that was sure fun!!!

Regards,
Jim.

Share this post


Link to post
Share on other sites
It seems by this logic if I flip a coin and get heads then I should bet the next flip is going to be tails. How is the game after he shows you what is behind one door differant than a game where there are just two doors and he only shows you whether you won or lost? Oh, and personally, I have no preferance for a door that might be a winner plus one I know is a loser over just a just door that might be the winner. There is no longer a 1/3 chance that the door they showed me is the winner. There is a 0/3 chance of that.

[Edited by - LilBudyWizer on October 25, 2004 3:05:33 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by LilBudyWizer
It seems by this logic if I flip a coin and get heads then I should bet the next flip is going to be tails.


Not quite thje same thing.

If you don't switch choices, your chance of winning is always 1/3.

But if you do your chance of winning become 2/3 * 1 = 2/3. That is 2/3 chance of choosing a door with goat behind it in the beginning, host removes a losing door thereby leaving one door with the car and one door with goat (this is the one you chose), switching at this point gives 100% of winning the car, hence the 1.

The events are not independent like in your coin example.

Share this post


Link to post
Share on other sites
Ah, I see, I have a 2/3 chance of winning if I switch and 2/3 chance of losing if I don't so I clearly should switch?

Share this post


Link to post
Share on other sites
You are arrogant. People are actually trying to help you understand, here. Maybe you ARE wrong and everyone else IS right?

The idea is that the host ALWAYS shows a door that is wrong - regardless! He WILL NOT EVER open the door that has the BMW behind it.

Share this post


Link to post
Share on other sites
Look at it this way, there are three doors: A, B and C. There are two basic cases
a) you pick the door with the car.
and
b) you pick a door with a goat
Clearly (a) happens only 1/3 of the time, and (b) 2/3 of the time. So now, he removes a door, and get the option to switch. If you were wrong before (i.e. situation (b)) switching will win you the car. If you were right, switching loses you the car. But remember, you were wrong 2/3 of the time, so clearly 2/3 of the time it's better to switch.

Share this post


Link to post
Share on other sites
No, if you follow the link above there is a post by Fruny clearly showing that if you switch you have a 2/3 chance of winning and if you don't you have a 2/3 chance of losing. This is a picking without replacement problem. The door that was shown is the one that was picked because it is the only door for which you know what is behind it. It is a loser. One of the remaining doors is a winner and one is a loser. You are now free to choose between those two. You have a 50% chance of choosing the winner or the loser. Why don't you try showing me how this works with four door or more generally with n doors?

Share this post


Link to post
Share on other sites
But it's not a 1/2 chance of winning, because you know that there's a 2/3 chance that your first choice was wrong. There's extra information in here, more than would be if you were just given two doors.

Share this post


Link to post
Share on other sites
I honestly don't see the point of leaving this thread open. The answer is provided clearly in the link(s) posted above. An argument is ensuing and continuing the argument is only hurting those involved.

1) If you've read those threads and still don't understand, then read them again;

2) If you've read those threads and don't believe it, then send me a PM and I'll be happy to discuss the issues with you;

3) If you haven't read those threads and you disagree with the answer, go and read them and THEN review your opinion and choose either 1) or 2).

If anyone has serious problems with this thread being closed, please PM me with a reason and I'll review my decision.

Cheers,

Timkin

Share this post


Link to post
Share on other sites

This topic is 4838 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this  

  • Advertisement