• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Reply to: 21 - I am confused

Collapse

You are not logged in or you do not have permission to access this page. This could be due to one of several reasons:

  • You are not logged in. If you are already registered, fill in the form below to log in, or follow the "Sign Up" link to register a new account.
  • You may not have sufficient privileges to access this page. Are you trying to edit someone else's post, access administrative features or some other privileged system?
  • If you are trying to post, the administrator may have disabled your account, or it may be awaiting activation.

Previously on "21 - I am confused"

Collapse

  • oracleslave
    replied
    Originally posted by Pickle2 View Post
    As you can see, this is very close to 2/3 probability, as suggested.

    I also ran the simulation for When the player NEVER swops, and the avereage came out at 3355 wins out of 10,000, which is very close to 1/3 probability as expected.

    Leave a comment:


  • Pickle2
    replied
    And here is the very dodgy asp.net page, if you want to run it yourselfs. excuse lazy coding practices. If you run the code, and see the results, its obvious why now.

    If you ALWAYS swop, you win whenever you first pick a goat and lose whenever you first pick the car. And prob of first picking a goat is 2 out 3.



    private Random random = new Random();

    protected void Page_Load(object sender, EventArgs e)
    {
    int countSuccess = 0;
    for (int i = 0; i < 10000; i++)
    {
    Response.Write("<BR>Starting a game: ");
    int[] doors = new int[] { 1, 2, 3 };

    int c = getRandomCarPosition();
    Response.Write(" car is: " + c.ToString());
    int s = getRandomContenstantSelection();
    Response.Write(" selec is: " + s.ToString());
    doors = removeGoatDoorFromArray(doors, s, c);
    Response.Write(" doors left after removal are " + doors[0] + " and " + doors[1]);
    s = swopSelection(doors, s);
    Response.Write(" after swop s is " + s);


    if (s == c)
    {
    countSuccess = countSuccess + 1;
    Response.Write(" Therefore WIN");
    }
    else
    {
    Response.Write(" Therefore LOSE");
    }
    }

    Response.Write("<BR><BR> TOTAL WIN RATE IS " + countSuccess + " OUT OF 1000");

    }

    private int getRandomCarPosition()
    {
    return random.Next(1, 4);
    }

    private int getRandomContenstantSelection()
    {
    return random.Next(1, 4);
    }

    private int[] removeGoatDoorFromArray(int[] doors, int contestantSelection, int carPosition)
    {

    if (contestantSelection == 1)
    {
    if (carPosition == 1) return new int[] { 1, 2 };
    else if(carPosition == 2) return new int[]{1,2};
    else return new int[]{1,3};
    }
    else if (contestantSelection == 2)
    {
    if (carPosition == 1) return new int[] { 1, 2 };
    else if(carPosition == 2) return new int[]{1,2};
    else return new int[]{2,3};
    }
    else
    {
    if (carPosition == 1) return new int[] { 1, 3 };
    else if(carPosition == 2) return new int[]{2,3};
    else return new int[]{2,3};
    }
    }

    private int swopSelection(int[] doors, int contestantSelection)
    {
    if (doors[0] == contestantSelection) return doors[1];
    else return doors[0];

    }

    Leave a comment:


  • Pickle2
    replied
    Originally posted by Pickle2 View Post
    Maybe someone can knock up a quick 10 line app that runs over a sufficient sample size to test it out. The results should tend towards the correct answer, surely? Either 1/2 or 2/3

    ie
    countSuccess =0;
    for (i = 1 to 100,000)
    {

    array doors = {1,2,3}

    c = getRandomCarPosition // will be 1 or 2 or 3

    s = getRandomContenstantSelection // will be 1, 2 or 3

    removeGoatDoorFromArray(doors, s); // array now have only 2 numbers in, one of which will be s and one (possibly the same one) will c.

    s = swopSelection(doors, s); // s will become the other one in the array

    if(s==c) countSuccess ++;
    }

    if count success approx 66000 then the theory is correct. Surely?

    Otherwise its all bollox
    OK! Ive knocked this together, the result are in. I ran the model 10 times with a sample size each time of 10,000 plays: For each run through, here are the number of car wins whern the player ALWAYS swops.

    6725
    6783
    6632
    6614
    6655
    6667
    6685
    6793
    6644
    6702

    ------------- AVERGAGE 6690

    As you can see, this is very close to 2/3 probability, as suggested.

    I also ran the simulation for When the player NEVER swops, and the avereage came out at 3355 wins out of 10,000, which is very close to 1/3 probability as expected.

    Leave a comment:


  • jmo21
    replied
    For me, the first large image on this link actually explains the reasoning much clearer than any of you lot trying, or the descision tree gif that was also linked too.

    Mainly because it uses pointing fingers and smiley faces!

    Leave a comment:


  • TimberWolf
    replied
    Originally posted by Pickle2 View Post
    Maybe someone can knock up a quick 10 line app that runs over a sufficient sample size to test it out. The results should tend towards the correct answer, surely? Either 1/2 or 2/3

    ie
    countSuccess =0;
    for (i = 1 to 100,000)
    {

    array doors = {1,2,3}

    c = getRandomCarPosition // will be 1 or 2 or 3

    s = getRandomContenstantSelection // will be 1, 2 or 3

    removeGoatDoorFromArray(doors, s); // array now have only 2 numbers in, one of which will be s and one (possibly the same one) will c.

    s = swopSelection(doors, s); // s will become the other one in the array

    if(s==c) countSuccess ++;
    }

    if count success approx 66000 then the theory is correct. Surely?

    Otherwise its all bollox
    That could be simplified. Assuming what's behind the doors each game is random, you could pick door 1 each game.
    The host would then pick a goat door (out of doors 2 and 3).
    You would then switch to door 3 or 2, i.e 3 if the host picked 2.

    I'm not entirely sure whether it could be simplified futher, i.e the host always picks the first goat door (out of doors 2 and 3). And then the final logic would simply be you selecting the first door after the first goat door in doors 2 and 3.
    Last edited by TimberWolf; 17 June 2009, 16:00.

    Leave a comment:


  • expat
    replied
    Originally posted by original PM View Post
    But this logic is flawed

    As soon as you open a door it is eliminated from the probability and thus the probability is re-set.

    Once you change the boundary conditions you can use information from previous boundary conditions

    Lets say you have 3 cups in front of you each one with a blue ball and 2 with a red ball in - you are asked to pick a cup and you aim is to get a blue ball.

    Regardless of which cup you pick you know that a cup is going to be removed which contains a red ball.

    You are then asked to pick a cup again - the choice is 50/50 - the inital stage of removing a cup to leave 2 cups is irrelevant and has no bearing on the probability of picking a blue ball or a red ball in the second stage???

    Surely?

    No. The action of opening a door that has a goat behind it does not "re-set the probability". This is the fallacy that leads people to the wrong answer.

    Try it by counting cases: say you do it 6 times, call your door A and the others B & C. they put the car behind each door for 2 of the 6 cases.
    1. Car behind door A.
    2. Car behind door A.
    3. Car behind door B.
    4. Car behind door B.
    5. Car behind door C.
    6. Car behind door C.

    Now, the host opens a door to reveal a goat:

    1. Car behind door A. Host picks door B.
    2. Car behind door A. Host picks door C.
    3. Car behind door B. Host picks door C.
    4. Car behind door B. Host picks door C.
    5. Car behind door C. Host picks door B.
    6. Car behind door C. Host picks door B.

    If you stick, you win 1 & 2.
    If you switch, you win 3, 4, 5 &6.

    That's probability as a proportion of equally likely cases.

    You are claiming that after e.g. the host opens door B, so eliminating cases 2, 3 & 4, the cases left are not 3 cases out of 6, but only 2 equally likely cases. This is incorrect. You are playing 6 games in all; now that door B is shown to have a goat, you know that this current game is 1, 5 or 6.

    Games 5 and 6 are two games out of the (now) possible three: you are ignoring that and thinking of them as only one game (out of two, therefore). They have the same outcome, but they are different plays of the game.

    It is true that game 1 has the car behind door A, and games 5 & 6 have the car behind door C; but do not be deceived into thinking that that is only 2 cases. From a probability point of view, that is 3 cases (2 of which are identical).

    When you say that opening door B "re-sets the probability", what you are doing is forgetting that you set up this round to have 6 games, you are throwing that information away. In probability, throwing information away leads you away from the best answer.
    Last edited by expat; 17 June 2009, 15:35.

    Leave a comment:


  • Pickle2
    replied
    Maybe someone can knock up a quick 10 line app that runs over a sufficient sample size to test it out. The results should tend towards the correct answer, surely? Either 1/2 or 2/3

    ie
    countSuccess =0;
    for (i = 1 to 100,000)
    {

    array doors = {1,2,3}

    c = getRandomCarPosition // will be 1 or 2 or 3

    s = getRandomContenstantSelection // will be 1, 2 or 3

    removeGoatDoorFromArray(doors, s); // array now have only 2 numbers in, one of which will be s and one (possibly the same one) will c.

    s = swopSelection(doors, s); // s will become the other one in the array

    if(s==c) countSuccess ++;
    }

    if count success approx 66000 then the theory is correct. Surely?

    Otherwise its all bollox

    Leave a comment:


  • Pinto
    replied
    Originally posted by original PM View Post
    But this logic is flawed

    As soon as you open a door it is eliminated from the probability and thus the probability is re-set.

    Once you change the boundary conditions you can use information from previous boundary conditions

    Lets say you have 3 cups in front of you each one with a blue ball and 2 with a red ball in - you are asked to pick a cup and you aim is to get a blue ball.

    Regardless of which cup you pick you know that a cup is going to be removed which contains a red ball.

    You are then asked to pick a cup again - the choice is 50/50 - the inital stage of removing a cup to leave 2 cups is irrelevant and has no bearing on the probability of picking a blue ball or a red ball in the second stage???

    Surely?


    You need to take into account the probability of your first choice revealing the Aygo, i.e. only 1/3, but you have a 2/3 chance of ending up with a goat. You would only have a 1/2 chance if you were allowed to switch the car behind the 2 remaining doors thereby resetting the probability.

    The car however hasn't moved. There's still only a in 1/3 probability of it having been placed behind your chosen door, which means that there's a 2/3 probability that's in one of the other doors. As one of those other doors was opened to reveal a goat, your 2/3 probability is now on the remaining unchosen door.
    Last edited by Pinto; 17 June 2009, 15:26.

    Leave a comment:


  • TimberWolf
    replied
    Originally posted by snaw View Post
    Isn't it all about the wording
    Some PHd's were upset with Marion Vos Servent some 10 years ago over her wording of the problem. I don't think she made it clear that the host must pick a goat, which changed the problem, or at least made it ambiguous enough to gave them an escape route. I was actually on Marion's side at the time.

    Leave a comment:


  • snaw
    replied
    Originally posted by original PM View Post
    But this logic is flawed

    As soon as you open a door it is eliminated from the probability and thus the probability is re-set.

    Once you change the boundary conditions you can use information from previous boundary conditions

    Lets say you have 3 cups in front of you each one with a blue ball and 2 with a red ball in - you are asked to pick a cup and you aim is to get a blue ball.

    Regardless of which cup you pick you know that a cup is going to be removed which contains a red ball.

    You are then asked to pick a cup again - the choice is 50/50 - the inital stage of removing a cup to leave 2 cups is irrelevant and has no bearing on the probability of picking a blue ball or a red ball in the second stage???

    Surely?

    Isn't it all about the wording - from that wiki on page 1, this is how it should be mathematically stated:

    Suppose you’re on a game show and you’re given the choice of three doors. Behind one door is a car; behind the others, goats. The car and the goats were placed randomly behind the doors before the show. The rules of the game show are as follows: After you have chosen a door,the door remains closed for the time being. The game show host, Monty Hall, who knows what is behind the doors, now has to open one of the two remaining doors, and the door he opens must have a goat behind it. If both remaining doors have goats behind them, he chooses one randomly. After Monty Hall opens a door with a goat, he will ask you to decide whether you want to stay with your first choice or to switch to the last remaining door. Imagine that you chose Door 1 and the host opens Door 3, which has a goat. He then asks you “Do you want to switch to Door Number 2?” Is it to your advantage to change your choice?

    Leave a comment:


  • original PM
    replied
    Film is not as good as the book IMHO. The guy has two others that I'm aware of; one on the creation of the Mercantile Oil exchange in Dubai and the other on the Japanese stock market about the time of Nick Leeson.

    As for the logic:

    You originally pick a door (a) and you have a 1/3 chance of being correct, therefore a 2/3 chance of the car being behind the other doors (b,c).

    Guy shows you door (b) has a goat behind it. So, logically there is a 2/3 chance that door c has a car and a 1/3 chance that door a does.
    But this logic is flawed

    As soon as you open a door it is eliminated from the probability and thus the probability is re-set.

    Once you change the boundary conditions you can use information from previous boundary conditions

    Lets say you have 3 cups in front of you each one with a blue ball and 2 with a red ball in - you are asked to pick a cup and you aim is to get a blue ball.

    Regardless of which cup you pick you know that a cup is going to be removed which contains a red ball.

    You are then asked to pick a cup again - the choice is 50/50 - the inital stage of removing a cup to leave 2 cups is irrelevant and has no bearing on the probability of picking a blue ball or a red ball in the second stage???

    Surely?

    Leave a comment:


  • Pondlife
    replied
    Originally posted by oracleslave View Post
    Pondlife gave a simple explanation on the first page of the thread.
    Yeah, but he's an idiot.

    Leave a comment:


  • oracleslave
    replied
    Originally posted by thelurker View Post
    My head is still spinning, as all i can see is it being 50/50 chance.

    2 doors

    one door: Car

    One door: Goat

    Pondlife gave a simple explanation on the first page of the thread.

    Leave a comment:


  • thelurker
    replied
    My head is still spinning, as all i can see is it being 50/50 chance.

    2 doors

    one door: Car

    One door: Goat

    Leave a comment:


  • expat
    replied
    Originally posted by Doggy Styles View Post
    What difference would it make if it was happening? You've still got two doors and you don't know what's behind either of them.
    If the random re-allocation was happening, then the odds of finding a car behind your first choice of door would be 1/2, same as if there had been only 2 doors to begin with. If no re-allocation happens, then the odds of finding a car behind your first choice of door are not changed by seeing a goat in a doorway, they are the same as when the car was put behind 1 of 3 doors, i.e. 1/3.

    So it makes a critical difference: is it a random distribution to 1 in 3, or to 1 in 2?

    Now, ISTM that the trap in this one is that people's minds reset for the 2 doors, but the distribution does not. Hence the discord between expectation and reality.

    Leave a comment:

Working...
X