In reply to Rick Wicklin.

Rick,

As you know, I'm NOT a statistician. However, that said, doesn't the formula for more than three doors have to include a 1- the rest of the calculation. And, that said, wouldn't (N-2)/(N(N-2)) be more correct for the four door situation where the contestant never goes back to his/her initial choice?

There could of course be a problem with my code:

title '4 Doors maintaining an initial guess of 1';
data mh;
array a(3);
do i = 1 to 100000;
* Monty puts the prize behind a random door;
prize = rand("TABLE",.25,.25,.25);
* We pick door 1 as our choice;
initial_guess = 1;
* pick goat to reveal;
a(1)=prize;
a(2)=initial_guess;
call missing(a(3));
do until (door_to_remove not in a);
door_to_remove=rand("TABLE",.25,.25,.25);
end;
*pick switched guess;
a(1)=door_to_remove;
do until (new_guess not in a);
new_guess = rand("TABLE",.25,.25,.25);
end;

* pick 2nd goat to reveal;
a(1)=prize;
a(2)=initial_guess;
a(3)=door_to_remove;
do until (door_to_remove2 not in a);
door_to_remove2=rand("TABLE",.25,.25,.25);
end;
*pick switched guess;
a(1)=door_to_remove;
a(3)=door_to_remove2;
do until (new_guess not in a);
new_guess = rand("TABLE",.25,.25,.25);
end;

win_by_keep = (initial_guess eq prize);
win_by_switch = (new_guess eq prize);
output;
end;
run;
proc freq data=mh;
tables win_by_keep win_by_switch;
run;

Art, CEO, AnalystFinder.com