in reply to Marilyn Vos Savant's Monty Hall problem

Why use rand?

If you stay with your first choice, you have 1/3 chance of getting the car.

If you switch, there is 2/3 chance of getting the car:
2/3 chance you will pick a goat on the first pick, he reveals the other goat, and then you switch to the car.
1/3 chance you will pick a car, he reveals a goat, and you switch to the other goat.

  • Comment on Re: Marilyn Vos Savant's Monty Hall problem

Replies are listed 'Best First'.
Re^2: Marilyn Vos Savant's Monty Hall problem
by mutated (Monk) on Aug 31, 2004 at 13:00 UTC
    Your right, Rand really isn't neccessary, and I can remove the do while loop as well, but I think that having them in there helps connect the word problem with the code..after all once someone has thought the problem through enough to realise that the do while is not neccesary they don't need a demonstration program any more to prove it ;).


    daN.