Hacker News new | ask | show | jobs
by jayvanguard 4219 days ago
He does in this single instance, but in order to calculate the probably you need to consider all the possible cases. Does the case where opens the door with the car calculate in? Why or why not? Seriously, write the simulation to calculate the probabilities. It makes the assumptions very obvious.
2 comments

You don't need to because you're asking what is the probability of winning by switching once the goat has been revealed. We want to know:

(# of possible worlds in which we win after switching) / (all possible worlds in which we are shown a goat after the initial pick)

vs

(# of possible worlds in which we win without switching) / (all possible worlds in which we are shown a goat after the initial pick)

in this case 2/3 vs 1/3. We are only considering the cases where a goat has been shown so what happens when a goat isn't shown or what the host's intentions are when a goat is show is irrelevant.

But 1 in 3 times the host opens a door with a car. That changes the probabilities. Or are you assuming this never happens? Why?
Let's suppose we are doing a computer simulation.

1. We simulate a million trials where the contestant chooses one of three door, one of which has a car and two a goat

2. We simulate the host randomly choosing one of the remaining doors to open.

3. We discard all trials that resulted in a car. We are left with the number of trials that resulted in a goat and store that number in a variable 'total'

4. In the remaining trails we switch and reveal what was behind the door. We store the number of times we saw a car in a variable called 'wins'.

5. The probability of winning after switching is 'wins' / 'total'

It doesn't matter how many times the host shows a car because those trials are discarded.

Did you actually write that simulation? Because once up on a time (many years ago) I followed the same line of reasoning, wrote a simulation to show that I was right, and that simulation showed me I was wrong.

If the host picks randomly and you discard rounds with a car, your odds switching are 50/50. If the host uses knowledge of where the car is to definitely reveal a goat, your odds switching are better.

@dllthomas

I've written the simulation, and you're right. It is 50% when the host chooses randomly!

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.
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}%"
WRITE THE SIMULATION