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.
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.
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.
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}%"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)
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?
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.
open_door = host_opts.sample
choice2 = [0, 1, 2] - [choice1, open_door] # switch
if open_door == car then
As for the denominator, good point.(# 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.
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.
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.
I've written the simulation, and you're right. It is 50% when the host chooses randomly!
Two game shows, two hosts, both reveal a goat. The random host revealed a goat with 1/3 probability; the canonical host revealed a goat with 1 probability.
We know that both hosts revealed a goat. We also know (for the purposes of this problem) that they had different likelihoods of doing so before the fact.
Does it make intuitive sense to you that the prior probability of an event could affect how you react to it? That's all that's going on here.
I understand the math. I know what the op was trying to say. But they worded it wrong. The 2nd riddle is the same as the first.
Are you familiar with the concept of prior probability? The premise of the meta-riddle is that both hosts showed a goat, but one host could have not shown a goat. So there must be a difference in the information conveyed by that goat.
Again, there isn't anything special about this problem, it's just how probabilities work. Respectfully-- there are a number of different people trying to explain this to you in different ways, and you can verify it on Wikipedia. Are you positive you do understand the math?
If "... and shows you a goat" is a part of the procedure of the game show, there is additional information imparted by the host's selection compared to the situation where "... and shows you a goat" is an artifact of the particular play through the game that is being described in the riddle and the procedure by which that situation was arrived at did not incorporate knowledge of where the car was.
If the host picks randomly, and the host picks a goat, and you switch, your odds of a car are 1/3, just as if you'd stuck. There's no point.
If the host always chooses a goat, and the host picks a goat, and you switch, your odds are 2/3 in favor of now having a car. You should always switch.
Intuition suggests this. Statistics proves it. If you implement this in software, you will see it happening to you in black and white, right before your eyes.
1/2, once you see the goat. One of 1/3, 2/3, and 1/2 beforehand, depending on what happens when Monty shows a car: whether you automatically win, automatically lose, or start over from the top, respectively.
Again, write the simulation. Either the switch strategy will win 2/3 of the time or 1/2 of the time, depending on how you write Monty. Only one of those approaches matches the results we saw IRL - Monty never revealed the car (so far as I'm aware) - but either is consistent with many phrasings of the question, and OP correctly specified the other case above.