• 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!

21 - I am confused

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    #71
    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
    The Mods stole my post count!

    Comment


      #72
      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.

      Comment


        #73
        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.

        Comment


          #74
          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!

          Comment


            #75
            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.

            The Mods stole my post count!

            Comment


              #76
              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];

              }
              The Mods stole my post count!

              Comment


                #77
                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.

                Comment

                Working...
                X