This is a falacy. It ignores the possibility that the host will pick the door with the car and therebye deprive you of the option of switching your original choice.

Try this simulation and see if you still agree?

#! perl -slw use strict; use List::Util qw[ shuffle ]; our $TRIALS ||= 1_000_000; my $DIVISOR = $TRIALS / 100; my( $stick, $switch, $loseEitherWay ); for my $try ( 1 .. $TRIALS ) { ## Randomly hide the prizes behind the doors. my @doors = shuffle 'car', 'goat', 'goat'; ## Pick a door my $choice = int rand 3; ## The host opens a door that I didn't pick my $opened = ( grep{ $_ != $choice } 0 .. 2 ) [ rand 2 ]; ## If the host picks the car, I lose anyway. $loseEitherWay++, next if $doors[ $opened ] eq 'car'; ## Count my wins if I stick or switch $doors[ $choice ] eq 'car' ? $stick++ : $switch++; } printf "Odds of Losing either way: %.3f Win if you don't switch: %.3f Win if you do switch: %.3f\n", $loseEitherWay / $DIVISOR, $stick / $DIVISOR, $switch / $DIVISOR; __END__ P:\test>384288 Odds of Losing either way: 33.370 Win if you don't switch: 33.307 Win if you do switch: 33.324 P:\test>384288 -TRIALS=5000000 Odds of Losing either way: 33.318 Win if you don't switch: 33.336 Win if you do switch: 33.346

Any bias between the outcomes is statistical variation only.

It runs very quickly because it doesn't loop trying to pick a number that hasn't already been picked. The grep removes the number I picked from the choices, and rand 2 picks between the 2 that are left.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
"Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon

In reply to Re: Marilyn Vos Savant's Monty Hall problem by BrowserUk
in thread Marilyn Vos Savant's Monty Hall problem by mutated

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.