Thread: Something about probablility

  1. #46
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by mike_g View Post
    Make sense?
    No...

  2. #47
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> The previous choice will have no consequence on the outcome of this new choice.
    The previous choice does have a consequence on what door the host opens. That is how the outcome is affected by the original choice, and that is the piece that I believe you are missing in your analysis.

    Unlike the gambler's situation that started this thread, in this case the previous events do have an effect on later events. If you pick a door with a donkey, that forces the host to open the other door with a donkey. Therefore, your choice affects what the final options will be, and it is that effect that shows up in the different probability.

  3. #48
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Yes Daved. But the host always opens a losing door, no matter my choice. So his action has a null value.

    I'm still firmly convinced of my answer, but can't ignore the overwhelming majority. So, I'll give this some hard thought before I post again.

    I just think you guys are trying to mix events and forgetting that the one event that matters is that last instant where the contestant is faced with two doors.

    Meanwhile, sorry robwhit. Didn't read your post correctly the first time.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #49
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Mario F. View Post
    Oh, no. You can't do it that way. You proved there is a 1/3 chance of winning if nothing else happens. That is, the available doors is kept at 3.

    But something changed. The host removed a losing door and asked you to start all over again. Choose one of two doors. That is your event, laserlight. The previous choice will have no consequence on the outcome of this new choice.

    CornedBee mentioned this exercise goes against intuition and I've been wracking my brain ever since trying to see where I'm failing. However I can't. This is really that simple. In the end you are just asked to choose from two doors.

    For your odds to become 66% you would have to be able to pick 2 doors out of three and not know what's behind the 3rd door.
    *sigh*
    Read the question: "If you're the contestant, should you switch doors? Should you stay on your door? Does it matter?"

    The question is not "which of the doors has the highest probability of winning?" The question is: "which of the two strategies is better, or are they equally viable?"
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #50
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    1x + 2y - 1y = 1x + 1y no matter how you look at it.

  6. #51
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    1x + 2y - 1y = 1x + 1y no matter how you look at it.
    Thats not how it works. You have to remember the host removes a door with a donkey. Theres only a 1/3 chance that he has 2 donkeys. I dident get it at first either. Good luck figuring it out

  7. #52
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by laserlight View Post
    *sigh*
    Read the question: "If you're the contestant, should you switch doors? Should you stay on your door? Does it matter?"

    The question is not "which of the doors has the highest probability of winning?" The question is: "which of the two strategies is better, or are they equally viable?"
    Have pity. I answered that question on my very first post.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  8. #53
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    Quote Originally Posted by mike_g View Post
    Theres only a 1/3 chance that he has 2 donkeys.
    So what?

  9. #54
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    I answered that question on my very first post.
    Oops, sorry.

    It really doesn't matter. MY chance of hitting the right door is 1:2 whether I switch or not.
    Basically, you are saying: the probability of hitting the right door is 1/2 if the contestant does not switch.

    Do you agree then, that if there are three billion contestants, all of whom choose at random and do not switch, about 1.5 billion contestants will choose the right door?

    Do you also agree that if all of them choose at random, about 1 billion of them will choose the right door at the start, and about 2 billion of them will choose the wrong door at the start?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  10. #55
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by laserlight View Post
    Basically, you are saying: the probability of hitting the right door is 1/2 if the contestant does not switch.
    Correct.

    Do you agree then, that if there are three billion contestants, all of whom choose at random and do not switch, about 1.5 billion contestants will choose the right door?
    Correct.

    Do you also agree that if all of them choose at random, about 1 billion of them will choose the right door at the start, and about 2 billion of them will choose the wrong door at the start?
    Correct.

    You are now going to ask me if I don't see the "obvious" inconsistency.

    But there isn't any inconsistency. It just so happens that your first and second question pertains to the last part of the game when there are only 2 doors left. And and the 3rd question to the first part of the game when there were 3 doors.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #56
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    But there isn't any inconsistency. It just so happens that your first and second question pertains to the last part of the game when there are only 2 doors left. And and the 3rd question to the first part of the game when there were 3 doors.
    Ah, but the contestants have to go through the first part first. They have to select a door, and we know they will not switch. If they do not switch, how can it be that it appears that half a billion of them have switched?
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  12. #57
    Registered User
    Join Date
    Oct 2001
    Posts
    2,129
    laserlight, which side are you on? It's a little hard to tell.

  13. #58
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by laserlight View Post
    Ah, but the contestants have to go through the first part first. They have to select a door, and we know they will not switch. If they do not switch, how can it be that it appears that half a billion of them have switched?
    Because the odds became 50% when the host eliminated a bad door! They are no longer 33%. By eliminating a wrong door the host increased the contestant odds to 50%.

    I really have no other way of saying this.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  14. #59
    Deathray Engineer MacGyver's Avatar
    Join Date
    Mar 2007
    Posts
    3,210
    Code:
    #include <stdio.h>
    #include <stdlib.h>
    #include <time.h>
    
    int selectBadDoor(int iRightDoor, int iGuess);
    int doRound(void);
    
    int selectBadDoor(int iRightDoor, int iGuess)
    {
    	int i;
    	for(i=0;i<3;i++)
    	{
    		if((iRightDoor != i) && (iGuess != i))
    		{
    			return i;
    		}
    	}
    	return -1;
    }
    
    int doRound(void)
    {
    	int iGuess, iRightDoor, iBadDoor;
    	char yn;
    	
    	/* Select right door. */
    	iRightDoor = rand() &#37; 3;	/* [0,3) */
    	printf("\tDEBUG: %d has been selected.\n", iRightDoor+1);
    	/* Ask user for original selection. */
    	printf("Select a door [1-3]: ");
    	fflush(stdout);
    	scanf("%d", &iGuess);
    	iGuess--;
    	/* Select a bad door. */
    	iBadDoor = selectBadDoor(iRightDoor, iGuess);
    	/* Ask user to switch. */
    	printf("Door %d has been eliminated.  Do you wish to switch? [Y/N]: ", iBadDoor+1);
    	fflush(stdout);
    	getchar();
    	scanf("%c", &yn);
    	/* Confuse code reader for fun. */
    	yn = ((iGuess==iRightDoor) && !((yn == 'Y') || (yn == 'y'))) || (!(iGuess==iRightDoor) && ((yn == 'Y') || (yn == 'y')));
    	printf("You %s!\n", yn?"win":"lose");
    	return yn;
    }
    
    int main(void)
    {
    	int iGoodSwitch = 0, iBadSwitch = 0, i, iResult;
    	
    	srand(time(NULL));
    	
    	for(i=0;i<10;i++)
    	{
    		iResult = doRound();
    		if(iResult)
    		{
    			puts("Switch = Good.");
    			iGoodSwitch++;
    		}
    		else
    		{
    			puts("Switch = Bad.");
    			iBadSwitch++;
    		}
    		putchar('\n');
    	}
    	printf("Switching was the right move %d times.\n", iGoodSwitch);
    	printf("Staying   was the right move %d times.\n", iBadSwitch);
    	return 0;
    }
    Hint: Redirect stdin at the command line or pipe it with another program. Also increase from 10 tries to something more substantial. Etc. etc..

    Note: I know rand() isn't truly random, but this is just for fun.

    Also of note: I left in a statement to print the value of the selected door which ruins the guessing aspect, but makes it easy to debug in case there are suspected errors.

  15. #60
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    laserlight, which side are you on? It's a little hard to tell.
    I think that switching is the better strategy. That is, those who switch can be expected to win 2/3s of the time.

    Because the odds became 50&#37; when the host eliminated a bad door! They are no longer 33%. By eliminating a wrong door the host increased the contestant odds to 50%.
    That's ignoring the contradiction.

    By the way, would you accept a computer simulation as evidence?

    EDIT:
    Heh, MacGyver already wrote one, apparently.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed