Quote:
Originally Posted by Fobic
Interesting code: made me think .... always a good thing.
Liked your shortcut for resetting the list.
However, i dont think the code works the way it should for the case when the contestant changes their choice.
You seem to be removing the first door you come across with a Goat behind it (which may even be the contestant's chosen door) and then choosing at random from the 2 remaining doors, rather than swapping to the unchosen door.
I suspect this will give results of 33% and 50% in your output which is not the correct answer.
|
I think 33% and 50% are the correct answers. If they choose to change they have a 50% chance of winning the car
Wait just figured it out. Tis Wrong.
---------- Post added at 21:39 ---------- Previous post was at 21:00 ----------
The CORRECT Answer:
Didn't change: 33.5% chance of winning
Did Change: 66.78% chance of winning
Also got to remove the nasty loop adding/removing. Bonus points for spotting the Beatles reference.