Talk:Monty Hall problem: Difference between revisions

Line 40:
::AFAIK the symbol '!' means "Not". Thus, variable door1 is set to boolean value True if the random number was not 0 (2/3 probability). There is no code for player selecting a door, host opening one of remaining door and player switching to the remaining door. Wasn't the original idea to make a program to simulate the game in order to see what is the probability, instead of using the known probability as starting point? --[[User:PauliKL|PauliKL]] 11:51, 13 November 2008 (UTC)
:It seems like it "fixes" the winning door to be the number 0. The user chooses a door in rand 3; if it choose the 0, !int(rand 3) gives true, so that the stay strategy wins, the leave strategy looses, and this is encoded in the next line. I suppose there's nothing wrong in fixing the prize behind the door labelled as 0; we could think of it as if we "move" the doors all together with prize or goats, so that the "player" index changes (it changes the order of the doors), but the judge of the game (Monty) will address the winner door always with 0, since that is the label he (and only he of course) can see. It is a sort of "mapping". To me it's ok.
::I disagree. I think the Perl implementation is totally wrong. The purpose of the task was to simulate the Monty Hall game in order to see what are the changes of win with the two strategies. Fixing the winning door would not be correct simulation even for a simpler game where user would just pick one of the doors and win if the car was there. But Monty Hall game is not that simple. There is the step where the host opens a door and another step where the player either switches the door or keeps the original selection. These steps have been omitted totally in the Perl implementation.
::Perl implementation does not simulate the game in order to find out the probability of win. Instead, it takes the answer (1/3 and 2/3 wins for keep/switch strategies), and then implements a random number generator to give 1/3 or 2/3 probability.
::This is actually the problem in many tasks. The tasks need to be made simple in order to keep the implementations short and clear. But then many contributors, instead of implementing solution to the problem, only implement solution to that specific case, or even jump directly to the answer without doing any computing.
::--[[User:PauliKL|PauliKL]] 14:56, 7 December 2008 (UTC)
Anonymous user