Originally posted by Pickle2
View Post
- 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.
Logging in...
Previously on "21 - I am confused"
Collapse
-
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:
-
Originally posted by Pickle2 View PostMaybe 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
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:
-
Originally posted by crack_ho View Post
Mainly because it uses pointing fingers and smiley faces!
Leave a comment:
-
Originally posted by Pickle2 View PostMaybe 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 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:
-
Originally posted by original PM View PostBut 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?
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:
-
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:
-
Originally posted by original PM View PostBut 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:
-
Originally posted by snaw View PostIsn't it all about the wording
Leave a comment:
-
Originally posted by original PM View PostBut 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?
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:
-
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.
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:
-
Originally posted by thelurker View PostMy 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:
-
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:
-
Originally posted by Doggy Styles View PostWhat 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.
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:
- Home
- News & Features
- First Timers
- IR35 / S660 / BN66
- Employee Benefit Trusts
- Agency Workers Regulations
- MSC Legislation
- Limited Companies
- Dividends
- Umbrella Company
- VAT / Flat Rate VAT
- Job News & Guides
- Money News & Guides
- Guide to Contracts
- Successful Contracting
- Contracting Overseas
- Contractor Calculators
- MVL
- Contractor Expenses
Advertisers
Contractor Services
CUK News
- Streamline Your Retirement with iSIPP: A Solution for Contractor Pensions Sep 1 09:13
- Making the most of pension lump sums: overview for contractors Sep 1 08:36
- Umbrella company tribunal cases are opening up; are your wages subject to unlawful deductions, too? Aug 31 08:38
- Contractors, relabelling 'labour' as 'services' to appear 'fully contracted out' won't dupe IR35 inspectors Aug 31 08:30
- How often does HMRC check tax returns? Aug 30 08:27
- Work-life balance as an IT contractor: 5 top tips from a tech recruiter Aug 30 08:20
- Autumn Statement 2023 tipped to prioritise mental health, in a boost for UK workplaces Aug 29 08:33
- Final reminder for contractors to respond to the umbrella consultation (closing today) Aug 29 08:09
- Top 5 most in demand cyber security contract roles Aug 25 08:38
- Changes to the right to request flexible working are incoming, but how will contractors be affected? Aug 24 08:25
Leave a comment: