Hacker News new | ask | show | jobs
by skizm 4215 days ago
You told us he opens the door with the goat. All cases consist of the host opening the door with a goat after you have picked.
1 comments

But it matters whether you have the guarantee or not.

If the host picked at random and happened to get a goat, it is 1/2 vs 1/2. If the host picked a door he knew had a goat, it's 2/3 vs 1/3.

Again, write the simulation. It shouldn't take you 5 minutes.

You do have a guarantee. The premises of #2 above is that the host shows a goat.
Yes, _this time_. But how on earth are you evaluating probabilities without considering all the priors and/or doing multiple trials? Is this some new kind of mathematics you've invented?

The hidden assumption is that the odds that he opens a door containing a car is zero. That is what changes the odds in the second step. Without that they don't change.

Seriously. Write the simulation.

Read your second question again. It says that the host shows a goat. Then asks if you would switch. Yes, you would switch.

I understand what you were trying to ask but you worded the second question wrong. You can't tell the listener that the host picks a goat. That defeats the purpose of the "randomness" which is meaningless since we know the host picks a door with a goat.

I found this on the internet and modified it so you can just change the commented out options to run it under the different scenarios.

  car = wins = 0
  many = 100000
  actual = 0

  many.times do
    choice1 = rand(3)
    car = rand(3)
    #host_opts = [0, 1, 2] - [choice1, car]  # host knows what is behind
    host_opts = [0, 1, 2] - [choice1]  # host doesn't know what is behind
    #choice2 = [choice1]  # don't switch
    choice2 = [0, 1, 2] - [choice1, host_opts.first]  # switch
    if host_opts.first == car then
        # Discard? Automatic win? It doesn't actually matter!
        # It only changes the denominator.
    else 
        # According to the puzzle, it is decision time!
        wins += 1 if choice2.first == car 
        actual += 1
    end
  end
puts "#{(wins * 100) / actual}%"
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.

> 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)

WRITE THE SIMULATION
No doubt. See seriuslyguys post above. He did it and now agrees.