Hacker News new | ask | show | jobs
by dllthomas 4215 days ago
I believe it doesn't change the result, but this is technically Monty always picking "the lower (leftmost?) door you didn't pick" not "a random door you didn't pick", right?

Also, "it only changes the denominator" may be misleading, as it does not change the only denominator actually visible in the code. It changes the total numbers of wins and losses, but not the total numbers of wins and losses given that you saw a goat.

1 comments

Re: first pick, right it doesn't affect things, but here is the code anyways using Ruby Array.sample().

  open_door = host_opts.sample
  choice2 = [0, 1, 2] - [choice1, open_door]  # switch
  if open_door == car then
As for the denominator, good point.