Hacker News new | past | comments | ask | show | jobs | submit login

> if host_opts.first == car then

That is false 100% of the time given the parameters that the outcome of the host's choice is a goat (as the question states)




Yes, and we don't bump the wins or the number of tries for that case. The question is your odds if you switch in the other branch of the if, and that's what we are calculating.

Edited to add:

I think there may be a different misunderstanding here...

Set aside, for the moment, whether the above implements the originally posed question or the variant. Imagine a gameshow that runs the above code, but the switch/stay code is moved below the "decision time!" line and the decision is made based on a prompt rather than hard coded. When you hit that prompt, "Monty" has already picked his door, and we've checked that it's not a car.

Do you expect your chance to win, on answering "switch" at that prompt, to depend on which line above is commented out?




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: