Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Toughest Game Show Question

41 views
Skip to first unread message

divya bisht

unread,
Jan 9, 2012, 11:56:20 PM1/9/12
to
Why this is marked as abuse? It has been marked as abuse.
Report not abuse
Toughest Game Show Question
(Source : http://hardest-puzzle.blogspot.com/2012/01/toughest-game-show-question.html
)

You are on a game show and there are three doors. The presenter tells
you that behind one of doors there is a car and behind the other two
are goats, if you pick the car you win it. After you have picked a
door the presenter opens a different door with a goat behind it, he
then gives you the chance to change what door you open, what should
you do?

Discuss Solution in link below
http://hardest-puzzle.blogspot.com/2012/01/toughest-game-show-question.html

Follow Us on Facebook at
http://www.facebook.com/pages/Weekly-Hardest-Puzzle/277415275612476

Bill Reid

unread,
Jan 10, 2012, 9:47:02 AM1/10/12
to
On Jan 9, 8:56 pm, divya bisht <bisht88.di...@gmail.com> wrote:
>
> You are on a game show and there are three doors. The presenter tells
> you that behind one of doors there is a car and behind the other two
> are goats, if you pick the car you win it. After you have picked a
> door the presenter opens a different door with a goat behind it, he
> then gives you the chance to change what door you open, what should
> you do?
>
OH NO, THE DREADED "MONTY HALL" PROBLEM, IT'S BEEN AT LEAST A
DECADE SINCE I'VE SEEN THIS MONSTROUSITY REAR IT'S UGLY HEAD IN
USENET!!!!!!!

The answer is that it doesn't matter, your odds are still one
in three no matter what you do...but wait, does it matter if the
presenter knows what's behind the doors and shows you the goat
to make the game more interesting? Let's see what happens with
the "regs" here, might be fun...

---
William Ernest Reid

tom st denis

unread,
Jan 10, 2012, 10:11:31 AM1/10/12
to
On Jan 10, 9:47 am, Bill Reid <hormelf...@gmail.com> wrote:
> OH NO, THE DREADED "MONTY HALL" PROBLEM, IT'S BEEN AT LEAST A
> DECADE SINCE I'VE SEEN THIS MONSTROUSITY REAR IT'S UGLY HEAD IN
> USENET!!!!!!!
>
> The answer is that it doesn't matter, your odds are still one
> in three no matter what you do...but wait, does it matter if the
> presenter knows what's behind the doors and shows you the goat
> to make the game more interesting?  Let's see what happens with
> the "regs" here, might be fun...

Never switch your bet. Pigeons know it.

Tom

Eric Sosman

unread,
Jan 10, 2012, 11:23:10 AM1/10/12
to
Stick with the original choice. You can't eat a car.

--
Eric Sosman
eso...@ieee-dot-org.invalid

John Gordon

unread,
Jan 10, 2012, 11:48:01 AM1/10/12
to
In <78ecc52b-cc20-477c...@u20g2000yqb.googlegroups.com> Bill Reid <horme...@gmail.com> writes:

> The answer is that it doesn't matter, your odds are still one
> in three no matter what you do

It does matter. If you switch, you have a two-in-three chance of winning.

> ..but wait, does it matter if the presenter knows what's behind the
> doors and shows you the goat to make the game more interesting?

The presenter does know. He doesn't open a random door.

--
John Gordon A is for Amy, who fell down the stairs
gor...@panix.com B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"

Stephen Sprunk

unread,
Jan 10, 2012, 12:21:58 PM1/10/12
to
Mythbusters recently tested this. You're always better off switching.

S


--
Stephen Sprunk "God does not play dice." --Albert Einstein
CCIE #3723 "God is an inveterate gambler, and He throws the
K5SSS dice at every possible opportunity." --Stephen Hawking

Seebs

unread,
Jan 10, 2012, 2:15:56 PM1/10/12
to
On 2012-01-10, John Gordon <gor...@panix.com> wrote:
> The presenter does know. He doesn't open a random door.

Our spammy friend seems to have a religious objection to an unambiguous
problem statement, and has not specified this.

-s
--
Copyright 2011, all wrongs reversed. Peter Seebach / usenet...@seebs.net
http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
I am not speaking for my employer, although they do rent some of my opinions.

Shao Miller

unread,
Jan 10, 2012, 2:33:28 PM1/10/12
to
On 1/10/2012 09:47, Bill Reid wrote:
> On Jan 9, 8:56 pm, divya bisht<bisht88.di...@gmail.com> wrote:
>>
>> You are on a game show and there are three doors. The presenter tells
>> you that behind one of doors there is a car and behind the other two
>> are goats, if you pick the car you win it. After you have picked a
>> door the presenter opens a different door with a goat behind it, he
>> then gives you the chance to change what door you open, what should
>> you do?
>>
> OH NO, THE DREADED "MONTY HALL" PROBLEM, IT'S BEEN AT LEAST A
> DECADE SINCE I'VE SEEN THIS MONSTROUSITY REAR IT'S UGLY HEAD IN
> USENET!!!!!!!
>

One can download the following book "Information Theory, Inference, and
Learning Algorithms" by David J. C. MacKay from his site:

http://www.inference.phy.cam.ac.uk/mackay/itila/

Or better yet, one can purchase it and have it shipped.

This problem is discussed on page 57, exercise 3.8, if I'm not mistaken.

However, the above-stated details are a little different.

- Shao Miller

Keith Thompson

unread,
Jan 10, 2012, 4:27:51 PM1/10/12
to
Seebs <usenet...@seebs.net> writes:
> On 2012-01-10, John Gordon <gor...@panix.com> wrote:
>> The presenter does know. He doesn't open a random door.
>
> Our spammy friend seems to have a religious objection to an unambiguous
> problem statement, and has not specified this.

The question does say that the presenter opens a door with a goat behind
it.

--
Keith Thompson (The_Other_Keith) ks...@mib.org <http://www.ghoti.net/~kst>
Will write code for food.
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"

James Kuyper

unread,
Jan 10, 2012, 4:57:34 PM1/10/12
to
On 01/10/2012 04:27 PM, Keith Thompson wrote:
> Seebs <usenet...@seebs.net> writes:
>> On 2012-01-10, John Gordon <gor...@panix.com> wrote:
>>> The presenter does know. He doesn't open a random door.
>>
>> Our spammy friend seems to have a religious objection to an unambiguous
>> problem statement, and has not specified this.
>
> The question does say that the presenter opens a door with a goat behind
> it.

Yes, but it doesn't say whether he opened a random door that happened to
have a goat behind it, or whether he deliberately choose a door that he
knew had a goat behind it. The latter is, I believe, the intended
situation in the standard "Monty Hall" problem. A lot of very confusing
discussions about that problem have been based upon choosing a different
assumption. To take the most extreme case: what if the presenter only
bothers opening the second door if you happen to have already chosen the
correct door, and otherwise leaves it closed (obviously, you've not been
informed of this policy)?

Seebs

unread,
Jan 10, 2012, 5:39:46 PM1/10/12
to
On 2012-01-10, Keith Thompson <ks...@mib.org> wrote:
> Seebs <usenet...@seebs.net> writes:
>> On 2012-01-10, John Gordon <gor...@panix.com> wrote:
>>> The presenter does know. He doesn't open a random door.

>> Our spammy friend seems to have a religious objection to an unambiguous
>> problem statement, and has not specified this.

> The question does say that the presenter opens a door with a goat behind
> it.

But it does not say whether we know that the presenter ALWAYS does this,
or whether it's just that, on this single case, the presenter HAPPENED to
do this.

Imagine that you were running a game show for people who are familiar with
this problem; the host strategy would be to always show people a goat if they
picked the car, and not show them a goat if they already picked one. Then
people who know the problem in the formulation where the host *must* always
show you a goat will end up losing every time, because they only get the option
to switch when doing so will hurt them.

In the real show, the host chose whether or not to reveal another door in
a way that made it not obvious that you were better off switching, because
part of it was his read of the contestants.

Bill Reid

unread,
Jan 10, 2012, 6:43:59 PM1/10/12
to
On Jan 10, 9:21 am, Stephen Sprunk <step...@sprunk.org> wrote:
> On 10-Jan-12 08:47, Bill Reid wrote:
> > On Jan 9, 8:56 pm, divya bisht <bisht88.di...@gmail.com> wrote:
>
> >> You are on a game show and there are three doors. The presenter tells
> >> you that behind one of doors there is a car and behind the other two
> >> are goats, if you pick the car you win it. After you have picked a
> >> door the presenter opens a different door with a goat behind it, he
> >> then gives you the chance to change what door you open, what should
> >> you do?
>
> > OH NO, THE DREADED "MONTY HALL" PROBLEM, IT'S BEEN AT LEAST A
> > DECADE SINCE I'VE SEEN THIS MONSTROUSITY REAR IT'S UGLY HEAD IN
> > USENET!!!!!!!
>
> > The answer is that it doesn't matter, your odds are still one
> > in three no matter what you do...but wait, does it matter if the
> > presenter knows what's behind the doors and shows you the goat
> > to make the game more interesting?  Let's see what happens with
> > the "regs" here, might be fun...
>
> Mythbusters recently tested this.  You're always better off switching.
>
Did they use a Monte Carlo simulation where they fired cannonballs
through the garage doors of dozens of innocent people to see whether
there was a goat or car in the garage?

You're always better off switching, EXCEPT if the presenter
knows you've chosen the car and ONLY offers you a different
door to potentially keep you from winning the car. In THAT case,
you WILL win the car 1/3 of the time overall, and will win
100% of the time when you decline the switch...so the behavior
of the presenter DOES make a difference...

---
William Ernest Reid

Edward A. Falk

unread,
Jan 10, 2012, 7:05:37 PM1/10/12
to
In article <366ccd1c-1fa0-476b...@a40g2000vbu.googlegroups.com>,
tom st denis <t...@iahu.ca> wrote:
>On Jan 10, 9:47�am, Bill Reid <hormelf...@gmail.com> wrote:
>> OH NO, THE DREADED "MONTY HALL" PROBLEM ...

Ooooh, I love that problem. I've made money on that one.

>Never switch your bet. Pigeons know it.

That's why they're called "pigeons".

The key is that Monty knows where the goats are, and thus
introduces information into the game when he opens a door.
Thus, you should always switch. Math on request.

--
-Ed Falk, fa...@despams.r.us.com
http://thespamdiaries.blogspot.com/

Kaz Kylheku

unread,
Jan 10, 2012, 8:44:22 PM1/10/12
to
I think you an easily solve this by a simple division into cases,
and simple probabilities.

Look Ma, no conditional probability, no Bayes' theorem.


Suppose Monty always reveals the goat. (This builds suspense in the
audience and is good for the show's ratings, which are more important
than whether or not cars are given away.)


There are two cases:

Case 1: (p = 2/3) You picked the goat.

Monty knows that this case is occurring, and reveals to you the other goat! So
you must switch to get the car, and by switching the car is guaranteed.

Case 2: (p = 1/3) You picked the car.

In this case, you must not switch; you're already on the car.
Of course Monty reveals a goat in this case also.


Now you don't know which of these cases you are in. But you do know
that one of these cases requires switching and the other requires
staying and that the one that requires switching occurs with p = 2/3, and the
one that requires staying occurs with p = 1/3.

This essentially translates to "the probability that you must switch in order
to win the car is 2/3", and that translates to "the probability that
the car is behind the door you did not pick in round 1 is 2/3".

If you do not switch, you are betting on being in Case 2, which is p = 1/3: the
same odds as a one-round draw.

If you switch, you are betting that you are in Case 1, where you have p = 2/3
odds, an improvement.



Switching: no brainer.

Stephen Sprunk

unread,
Jan 10, 2012, 11:53:22 PM1/10/12
to
On 10-Jan-12 17:43, Bill Reid wrote:
> On Jan 10, 9:21 am, Stephen Sprunk <step...@sprunk.org> wrote:
>> On 10-Jan-12 08:47, Bill Reid wrote:
>>> OH NO, THE DREADED "MONTY HALL" PROBLEM, IT'S BEEN AT LEAST A
>>> DECADE SINCE I'VE SEEN THIS MONSTROUSITY REAR IT'S UGLY HEAD IN
>>> USENET!!!!!!!
>>>
>>> The answer is that it doesn't matter, your odds are still one
>>> in three no matter what you do...but wait, does it matter if the
>>> presenter knows what's behind the doors and shows you the goat
>>> to make the game more interesting? Let's see what happens with
>>> the "regs" here, might be fun...
>>
>> Mythbusters recently tested this. You're always better off switching.
>>
> Did they use a Monte Carlo simulation where they fired cannonballs
> through the garage doors of dozens of innocent people to see whether
> there was a goat or car in the garage?

They did a Monte Carlo simulation, but unfortunately nothing was
destroyed in the process.

I prefer the mathematical proof, but that doesn't make for good TV.

> You're always better off switching, EXCEPT if the presenter knows
> you've chosen the car and ONLY offers you a different door to
> potentially keep you from winning the car.

Their test scenario was that the presenter _always_ opens a losing door,
which they said is how the actual game show worked.

They also first tested how often people switched after that door was
opened; interestingly, zero (of twenty) contestants did so.

Seebs

unread,
Jan 11, 2012, 12:00:55 AM1/11/12
to
On 2012-01-11, Stephen Sprunk <ste...@sprunk.org> wrote:
> Their test scenario was that the presenter _always_ opens a losing door,
> which they said is how the actual game show worked.

They are wrong, I'm pretty sure. One of the discussions of this included
an interview with the guy, and there was no such rule.

Kaz Kylheku

unread,
Jan 11, 2012, 1:32:54 AM1/11/12
to
On 2012-01-11, Seebs <usenet...@seebs.net> wrote:
> On 2012-01-11, Stephen Sprunk <ste...@sprunk.org> wrote:
>> Their test scenario was that the presenter _always_ opens a losing door,
>> which they said is how the actual game show worked.
>
> They are wrong, I'm pretty sure. One of the discussions of this included
> an interview with the guy, and there was no such rule.

But odds are 2/3 that he lied in that interview.

Dann Corbit

unread,
Jan 11, 2012, 2:48:30 AM1/11/12
to
In article <201201101...@kylheku.com>, k...@kylheku.com says...
[snip]
Yeah, but what it you happen to *want* the goat?

James Kuyper

unread,
Jan 11, 2012, 7:22:31 AM1/11/12
to
On 01/11/2012 12:00 AM, Seebs wrote:
> On 2012-01-11, Stephen Sprunk <ste...@sprunk.org> wrote:
>> Their test scenario was that the presenter _always_ opens a losing door,
>> which they said is how the actual game show worked.
>
> They are wrong, I'm pretty sure. One of the discussions of this included
> an interview with the guy, and there was no such rule.
>
> -s
<http://en.wikipedia.org/wiki/Monty_Hall_problem> contains a section
titled "extended problem description" which fills out the unstated
assumptions behind the original statement of the problem. There's a fair
number of them.
There's also a section titled "other host behaviors" which summarizes
the results when other assumptions are made.
--
James Kuyper

James Kuyper

unread,
Jan 11, 2012, 7:23:35 AM1/11/12
to
That's easy - switch to the door opened by the Host.
--
James Kuyper

M. Strobel

unread,
Jan 11, 2012, 8:33:13 AM1/11/12
to
My simulation shows that by switching your total chance to win
the car is 1/2 or probability 0.5

I think this is true, due to the fact that by switching you might
go off the car choice.

/Str

Willem

unread,
Jan 11, 2012, 8:48:02 AM1/11/12
to
M. Strobel wrote:
) My simulation shows that by switching your total chance to win
) the car is 1/2 or probability 0.5

How did you do the simulation?

Here's how I did it:

1 - Randomly pick a door for the car.
2 - Randomly pick a door for the contestant.
3 - Randomly pick one of the remaining two doors for the host.
3a - If that contains a car, pick the other remaining one for the host.
4 - Look at the door that neither the host nor the contestant picked.
5 - Score a win if that door is the door from step 1.

And my simulation ends up with 2/3 wins and 1/3 losses.


So, could you describe the steps in your simulation?


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT

M. Strobel

unread,
Jan 11, 2012, 12:44:57 PM1/11/12
to
Am 11.01.2012 14:48, schrieb Willem:
> M. Strobel wrote:
> ) My simulation shows that by switching your total chance to win
> ) the car is 1/2 or probability 0.5
>
> How did you do the simulation?
>
> Here's how I did it:
>
> 1 - Randomly pick a door for the car.
> 2 - Randomly pick a door for the contestant.
> 3 - Randomly pick one of the remaining two doors for the host.
> 3a - If that contains a car, pick the other remaining one for the host.
> 4 - Look at the door that neither the host nor the contestant picked.
> 5 - Score a win if that door is the door from step 1.
>
> And my simulation ends up with 2/3 wins and 1/3 losses.
>
>
> So, could you describe the steps in your simulation?
>
>
> SaSW, Willem

Well, I do it with minimal abstraction in a list of 2 goats and
one car.

1 generate list by changing one of (goat goat goat) to car
2 player randomly picks element
2 moderator discloses one goat (not picked)
3 player changes / does not change

this all wrapped up in procedures, accounting only for the results.

Just can't find any errors there.

FWIW the code in Tcl is on http://pastebin.com/r6cZBET0
Oh my god, it is so OT! Let my post die in peace and don't waste your time if you
don't want to.

/Str.

Willem

unread,
Jan 11, 2012, 1:10:58 PM1/11/12
to
M. Strobel wrote:
) Well, I do it with minimal abstraction in a list of 2 goats and
) one car.
)
) 1 generate list by changing one of (goat goat goat) to car
) 2 player randomly picks element
) 2 moderator discloses one goat (not picked)
) 3 player changes / does not change
)
) this all wrapped up in procedures, accounting only for the results.
)
) Just can't find any errors there.

I think I can find at least one error, even though I don't speak TCL:

...
while {$gofindit} {
set zi [zerototwo]
if {($zi != $pick) && ([lindex $alpha $zi]=="goat") } {
set gofindit false
} else {
set pick [zerototwo] #<--- What is this doing here ??
}
}
...

By resetting pick in that loop, you make it more likely that 'pick' will be
a car after the loop.

M. Strobel

unread,
Jan 11, 2012, 1:23:04 PM1/11/12
to
Am 11.01.2012 19:10, schrieb Willem:
> M. Strobel wrote:
---cut
> ) Just can't find any errors there.
>
> I think I can find at least one error, even though I don't speak TCL:
>
> ...
> while {$gofindit} {
> set zi [zerototwo]
> if {($zi != $pick) && ([lindex $alpha $zi]=="goat") } {
> set gofindit false
> } else {
> set pick [zerototwo] #<--- What is this doing here ??
> }
> }
> ...
>
> By resetting pick in that loop, you make it more likely that 'pick' will be
> a car after the loop.
>
>
> SaSW, Willem

Oh, have to check it, will be back later. I thought Tcl was rather easy to read.

/Str.

BartC

unread,
Jan 12, 2012, 4:07:55 PM1/12/12
to
"Kaz Kylheku" <k...@kylheku.com> wrote in message
news:201201101...@kylheku.com...
> On 2012-01-10, Bill Reid <horme...@gmail.com> wrote:
>> On Jan 9, 8:56 pm, divya bisht <bisht88.di...@gmail.com> wrote:
>>>
>>> You are on a game show and there are three doors. The presenter tells
>>> you that behind one of doors there is a car and behind the other two
>>> are goats, if you pick the car you win it. After you have picked a
>>> door the presenter opens a different door with a goat behind it, he
>>> then gives you the chance to change what door you open, what should
>>> you do?

> I think you an easily solve this by a simple division into cases,
> and simple probabilities.

I found it easier to think of a million doors instead of three.

You choose one door (obviously with 1/1000000 probability of choosing the
one with the prize).

The host then opens 999,998 of the remaining 999,999 doors. One door stays
closed.

Which of the two closed doors (the one you chose at random, and the one
that's deliberately left by the host) is more likely to have the prize
behind it?

--
Bartc


Edward A. Falk

unread,
Jan 12, 2012, 5:51:18 PM1/12/12
to
In article <5a07f9e0-4011-45cb...@f11g2000yql.googlegroups.com>,
Bill Reid <horme...@gmail.com> wrote:
>>
>Did they use a Monte Carlo simulation where they fired cannonballs
>through the garage doors of dozens of innocent people to see whether
>there was a goat or car in the garage?

A friend of mine had this to say about that:

Well, if nothing else,
they've disproved the myth that
suburban houses are safe from
cannon attack.

That's something, anyway....

Joe keane

unread,
Jan 12, 2012, 5:53:09 PM1/12/12
to
#include <stdio.h>
#include <math.h>


int main(int argc, char **argv)
{
const char *arg;
unsigned long ori;
unsigned long red;
unsigned long div;
unsigned long ste;

if (argc != 2)
{
fputs("usage: factor <number>\n", stderr);
return 1;
}

arg = argv[1];
sscanf(arg, "%lu", &ori);
red = ori;
fprintf(stdout, "%lu", ori);
fputs(" = ", stdout);

if (red < 4)
{
fputc('0' + (int) red, stdout);
goto done;
}

if ((red & 0x1) == 0x0)
{
red >>= 1;
fputc('2', stdout);

if ((red & 0x1) == 0x0)
{
int x;

fputc('^', stdout);
red >>= 1;
x = 2;

while ((red & 0x1) == 0x0)
{
red >>= 1;
x++;
}

fprintf(stdout, "%d", x);
}

if (red == 1)
goto done;

fputc('*', stdout);
}

if (red % 3 == 0)
{
fputc('3', stdout);
red /= 3;

if (red % 3 == 0)
{
int x;

red /= 3;
fputc('^', stdout);
x = 2;

while (red % 3 == 0)
{
red /= 3;
x++;
}

fprintf(stdout, "%d", x);
}

if (red == 1)
goto done;

fputc('*', stdout);
}

div = 5;
ste = 2;

for (;;)
{
unsigned long lim;

relim:
lim = (unsigned long) floor(sqrt((double) red));

for (;;)
{
if (red % div == 0)
{
red /= div;
fprintf(stdout, "%lu", div);

if (red % div == 0)
{
int x;

fputc('^', stdout);
red /= div;
x = 2;

while (red % div == 0)
{
red /= div;
x++;
}

fprintf(stdout, "%d", x);
}

if (red == 1)
goto done;

fputc('*', stdout);
goto relim;
}

div += ste;
ste ^= 6;

if (div > lim)
{
fprintf(stdout, "%lu", red);
goto done;
}
}
}

done:
fputc('\n', stdout);
fflush(stdout);
return 0;
}

Ian Collins

unread,
Jan 12, 2012, 6:14:22 PM1/12/12
to
On 01/13/12 11:51 AM, Edward A. Falk wrote:
> In article<5a07f9e0-4011-45cb...@f11g2000yql.googlegroups.com>,
> Bill Reid<horme...@gmail.com> wrote:
>>>
>> Did they use a Monte Carlo simulation where they fired cannonballs
>> through the garage doors of dozens of innocent people to see whether
>> there was a goat or car in the garage?
>
> A friend of mine had this to say about that:
>
> Well, if nothing else,
> they've disproved the myth that
> suburban houses are safe from
> cannon attack.
>
> That's something, anyway....

That would depend on the construction of the house and the size of the
cannon. Mine would fail, but some neighbouring houses (built with
reinforced block) would survive a significant pounding (or, as recent
events have shown, significant earthquakes!).

--
Ian Collins

James Kuyper

unread,
Jan 12, 2012, 6:23:23 PM1/12/12
to
Your simulation is needlessly complicated:


#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

static int choose3(void)
{
int r;
// max is the largest multiple of 3 that is less than or equal to
// RAND_MAX+1
static const int max = 3*((RAND_MAX + 1UL)/3);

// This removes the bias that would otherwise exist due if
// max != RAND_MAX+1
while((r=rand())>= max);

return r/(max/3);
}

#define TRIAL_RUNS ULONG_MAX
int main(void)
{
srand(12345);
unsigned long keep = 0;
unsigned long change = 0;
for(unsigned long i=TRIAL_RUNS; i; i--)
{
int car = choose3();
int guess = choose3();
if(guess == car)// Host chooses one of the other doors.
keep++; // Sticking with your original choice wins.
else // Host chooses the other door with the goat.
change++; // Switching to the remaining door wins.
}
printf("%lu runs. Keeping wins %lu=%g%%; switching wins %lu=%g%%\n",
TRIAL_RUNS, keep, (double)keep/TRIAL_RUNS,
change, (double)change/TRIAL_RUNS);
return 0;
}


ImpalerCore

unread,
Jan 12, 2012, 6:17:20 PM1/12/12
to
On Jan 12, 5:51 pm, f...@rahul.net (Edward A. Falk) wrote:
> In article <5a07f9e0-4011-45cb-aec3-0c9c7f888...@f11g2000yql.googlegroups.com>,
> Bill Reid  <hormelf...@gmail.com> wrote:
>
>
>
> >Did they use a Monte Carlo simulation where they fired cannonballs
> >through the garage doors of dozens of innocent people to see whether
> >there was a goat or car in the garage?
>
> A friend of mine had this to say about that:
>
>   Well, if nothing else,
>   they've disproved the myth that
>   suburban houses are safe from
>   cannon attack.
>
>   That's something, anyway....

And the myth that cannonballs don't bounce.

pete

unread,
Jan 14, 2012, 11:38:31 PM1/14/12
to
That's the way that I think of it also.

--
pete

M. Strobel

unread,
Jan 15, 2012, 1:03:34 PM1/15/12
to
Am 13.01.2012 00:23, schrieb James Kuyper:
> On 01/11/2012 12:44 PM, M. Strobel wrote:
>> Am 11.01.2012 14:48, schrieb Willem:
>>> M. Strobel wrote:
>>> ) My simulation shows that by switching your total chance to win
>>> ) the car is 1/2 or probability 0.5
>>>
>>> How did you do the simulation?

---cut

>>
>> Just can't find any errors there.
>>
>> FWIW the code in Tcl is on http://pastebin.com/r6cZBET0
>> Oh my god, it is so OT! Let my post die in peace and don't waste your time if you
>> don't want to.
>
> Your simulation is needlessly complicated:
>

Oh yes. I tried a didactic programming style, but shot myself in the leg somehow.

/Str.

Willem

unread,
Jan 15, 2012, 2:42:02 PM1/15/12
to
James Kuyper wrote:
) Your simulation is needlessly complicated:
<snip>
) int car = choose3();
) int guess = choose3();
) if(guess == car)// Host chooses one of the other doors.
) keep++; // Sticking with your original choice wins.
) else // Host chooses the other door with the goat.
) change++; // Switching to the remaining door wins.

Your solution does not replicate the actual circumstances, I.E. it uses
some of the logic steps that are used to prove the 1/3 result, to simplify
the code. People who do not believe the proof will likely also not believe
results from your program.

Of course, you can optimize a simulation. But the point is that any
optimizing step is essentially one of the steps from the mathematical
proof (that shows that you should switch), so it cannot be used to
convince anybody that doesn't follow the proof.

James Kuyper

unread,
Jan 15, 2012, 4:57:01 PM1/15/12
to
On 01/15/2012 02:42 PM, Willem wrote:
> James Kuyper wrote:
> ) Your simulation is needlessly complicated:
> <snip>
> ) int car = choose3();
> ) int guess = choose3();
> ) if(guess == car)// Host chooses one of the other doors.
> ) keep++; // Sticking with your original choice wins.
> ) else // Host chooses the other door with the goat.
> ) change++; // Switching to the remaining door wins.
>
> Your solution does not replicate the actual circumstances, I.E. it uses
> some of the logic steps that are used to prove the 1/3 result, to simplify
> the code. People who do not believe the proof will likely also not believe
> results from your program.

If you could identify those logic steps, I could complicate the code to
demonstrate their validity. The best-known statement of the problem is
the one from Marilyn vos Savant's "Ask Marilyn" column on page 16 of the
1990-09-09 Parade magazine, and her answer was based on many unstated
assumptions, that strike me as quite reasonable - but a fair fraction of
those who disagreed with her made different assumptions. The problem was
originally posed in a letter by Steve Selvin to the American
Statistician in 1975, but I haven't seen a copy of that letter, so I'm
not sure if it contained the same assumptions.

My program was meant to simulate the standard version of the problem,
with all such assumptions stated explicitly, as specified in
http://www.usd.edu/~xtwang/Papers/MontyHallPaper.pdf. Anyone who objects
to my program because they made different assumptions is, of course,
correct: the original problem was under-specified.

I'm not sure how I should modify the program to make it's validity as a
simulation of the fully-specified problem more obvious. Here's an
attempt. I relies upon a user-defined function:

extern int host_choose_goad(int car, int guess);

This function's two arguments are supposed to each have values of 0, 1,
2; it's behavior if that is not the case is irrelevant. It must not
contain any feature which renders the behavior of the program as a whole
undefined, if passed valid arguments. It must return. It's return value
must be either 0, 1, or 2, and must not be equal to either of its two
arguments. Therefore, if the two arguments are not equal, there is only
one unique return value permitted. Otherwise it must choose between
exactly two possibilities; how it makes that choice is completely
irrelevant. It must do nothing to interfere with the randomness of the
numbers returned by choose3() below, for instance by calling srand().
Here's the rest of the main program:

#include <assert.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>

static int choose3(void)
{
int r;
// max is the largest multiple of 3 that is less than or equal to
// RAND_MAX+1
static const int max = 3*((RAND_MAX + 1UL)/3);

// This removes the bias that would otherwise exist due if
// max != RAND_MAX+1
while((r=rand())>= max);

return r/(max/3);
}

#define TRIAL_RUNS ULONG_MAX
int main(void)
{
srand(12345);
unsigned long keep = 0;
unsigned long change = 0;
for(unsigned long i=TRIAL_RUNS; i; i--)
{
int car = choose3();
int guess = choose3();
int goat = host_chooses_goat(car, guess);

assert(0 <= goat < 3);
assert(goat != car && goat != guess);

// If those assertions succeed, this expression gives the
// number of the only remaining unchosen door
int changed_guess = 3-(guess+goat);

if(guess == car)
keep++; // Keeping your original guess wins.
else if(changed_guess == car)
change++; // Changing your guess wins.
}
printf("%lu runs. Keeping wins %lu=%g%%; switching wins %lu=%g%%\n",
TRIAL_RUNS, keep, (double)keep/TRIAL_RUNS,
change, (double)change/TRIAL_RUNS);
return 0;
}

The key logic issue is that, if host_chooses_goat() satisfies the
requirements placed upon it, and if the second condition gets evaluated,
that condition is guaranteed to evaluate to 1. As as result, the second
condition can be optimized away,, rendering host_chooses_goat()
irrelevant, which is how I generated my original version of the code.

> Of course, you can optimize a simulation. But the point is that any
> optimizing step is essentially one of the steps from the mathematical
> proof (that shows that you should switch), so it cannot be used to
> convince anybody that doesn't follow the proof.

Is this version sufficient?
--
James Kuyper

Kaz Kylheku

unread,
Jan 15, 2012, 11:16:51 PM1/15/12
to
On 2012-01-15, Willem <wil...@toad.stack.nl> wrote:
> James Kuyper wrote:
> ) Your simulation is needlessly complicated:
> <snip>
> ) int car = choose3();
> ) int guess = choose3();
> ) if(guess == car)// Host chooses one of the other doors.
> ) keep++; // Sticking with your original choice wins.
> ) else // Host chooses the other door with the goat.
> ) change++; // Switching to the remaining door wins.
>
> Your solution does not replicate the actual circumstances, I.E. it uses
> some of the logic steps that are used to prove the 1/3 result, to simplify
> the code. People who do not believe the proof will likely also not believe
> results from your program.

People who do not believe the proof are going to be too ignorant to understand
whether a computer program is sound or not (but pretend otherwise), so it
doesn't matter.

Kenny McCormack

unread,
Jan 16, 2012, 7:14:40 AM1/16/12
to
In article <201201152...@kylheku.com>,
Kaz Kylheku <k...@kylheku.com> wrote:
...
>People who do not believe the proof are going to be too ignorant to understand
>whether a computer program is sound or not (but pretend otherwise), so it
>doesn't matter.

Good point. It's the old "You can't fix stupid".

Anyway, to change the topic slightly...

Is it known whether or not the host will *always* give you the choice
(chance) to switch? That seems to me to be critical in deriving the
standard answer to this question (*). Suppose the host employs the strategy
of offering you the choice only if you have the car. I.e., if you have a
goat, then you're stuck with it (**). In this case, it would be obvious
that you should *not* switch.

(*) That you should always switch.
(**) And he "wins".

--
They say compassion is a virtue, but I don't have the time!

- David Byrne -

Bill Reid

unread,
Jan 17, 2012, 10:31:47 AM1/17/12
to
On Jan 16, 4:14 am, gaze...@shell.xmission.com (Kenny McCormack)
wrote:
> In article <20120115201045....@kylheku.com>,
> Kaz Kylheku  <k...@kylheku.com> wrote:
> ...
>
> >People who do not believe the proof are going to be too ignorant to understand
> >whether a computer program is sound or not (but pretend otherwise), so it
> >doesn't matter.
>
> Good point.  It's the old "You can't fix stupid".
>
> Anyway, to change the topic slightly...
>
> Is it known whether or not the host will *always* give you the choice
> (chance) to switch?  That seems to me to be critical in deriving the
> standard answer to this question (*).  Suppose the host employs the strategy
> of offering you the choice only if you have the car.  I.e., if you have a
> goat, then you're stuck with it (**).  In this case, it would be obvious
> that you should *not* switch.
>
> (*) That you should always switch.
> (**) And he "wins".
>
You're right, you can't fix stupid, most pertinently since I posted
the exact same scenario as you did a few days ago...

---
William Ernest Reid

Tim Rentsch

unread,
Jan 26, 2012, 12:33:39 PM1/26/12
to
I disagree with the thesis: I think it depends on the program,
not just the person. Also there are different skill sets
involved -- it's easy to imagine someone having difficulty
following a proof (considering how many really horrible proofs
have been published) but who still could follow program logic,
especially if the program were carefully written with that in
mind.
0 new messages