Talk:Monty Hall problem: Difference between revisions

Line 37:
 
Perl implementation looks suspiciously short. I don't know much of Perl, but it seems to me that the function <tt>play</tt> just calculates a random number in range 0 to 2 and then checks if the result was 0. So it does not actually play the game. --[[User:PauliKL|PauliKL]] 14:25, 12 November 2008 (UTC)
:It seems like it actually just puts the winner in the same place every time(?) The call <tt>play 1</tt> means "play the switch strategy", while <tt>play 0</tt> means "play the stay strategy". Then it picks a door (<tt>my $door1 = !int(rand 3);</tt>) then asks "are we switching?" (<tt>$_[0] ?</tt>). If we are, return not the door we picked (<tt>!$door1</tt>), otherwise return the door we did pick (<tt>$door1</tt>). I think it's right, but I'm not sure where it places the winning door. --[[User:Mwn3d|Mwn3d]] 14:42, 12 November 2008 (UTC)
Anonymous user