------THIS IS INCOMPLETE--------
three doors. One with prize, two with nothing
You pick door A. door C is opened to reveal nothing.
Should you keep door A or switch to door B?
What are the odds for both?
Answer:
Actually you should switch. The odds that the prize is
behind door B has now doubled. When you picked door A
the odds that it was the right door was 1/3. After door
C is revealed, the odds that door A is right won't change,
so it's still 1/3. That means the odds that door B is
right is 2/3.
Another way to look at it is that you don't learn anything
about which door is right, you just learn something about
which doors are wrong. If you look at the original three
possibilities based on which door is wrong:
Doors B and C are wrong -> A is right
Doors A and C are wrong -> B is right
Doors A and B are wrong -> C is right
You can see that each door appears twice in the above possibilities
1 A,B Shows A (C right)
2 A,B Shows B (C right)
3 B,C Shows B (A right)
4 B,C Shows C (A right)
5 A,C Shows A (B right)
6 A,C Shows C (B right)
By picking A they can no longer show that door, so they can't do
possibilities 1 and 5.
3 B,C Shows B (A right)
4 B,C Shows C (A right) <-
5 A,C Shows A (B right)
6 A,C Shows C (B right) <-
When they picked C it was a 1/3 chance that A was right (so they had a
choice of picking B or C) and a 2/3 chance that they had to pick it.
You can use this perl script to verify it for yourself:
#!/usr/local/bin/perl5
srand();
$num=1000;
sub rand_range {
my ($min,$max);
$min=($_[0]<$_[1] ? $_[0] : $_[1]);
$max=($_[0]<$_[1] ? $_[1] : $_[0]);
int(rand()*($max-$min+1) + $min);
}
$i=$num;
while($i--) {
@door=(0,0,0);
$prize=rand_range(0,$#door);
$door[$prize]=1;
$guess=rand_range(0,$#door);
@bad=();
for ($c=0; $c<3; $c++) {
push(@bad,$c) if ($c!=$guess && !$door[$c]);
}
$show=$bad[rand_range(0,$#bad)];
# Neat way to pick the door that wasn't guessed or shown
$switch=2 if ($guess+$show==1); # (guess,show) is (0,1) or (1,0)
$switch=1 if ($guess+$show==2); # (guess,show) is (0,2) or (2,0)
$switch=0 if ($guess+$show==3); # (guess,show) is (1,2) or (2,1)
print "[$prize] Guess: $guess Show: $show (switch: $switch)\n";
$right++ if ($door[$guess]);
$or_right++ if ($door[$switch]);
}
print "Original: $right/$num = ", ($right/$num), "\n";
print "Switch: $or_right/$num = ", ($or_right/$num), "\n";