5 ms·
As long as the host doesn't accidentally open the prize door, it doesn't matter whether he forgot or not. To test my statement you could write a simulation wher
by rho4 5y ago
As long as the host doesn't accidentally open the prize door, it doesn't matter whether he forgot or not. To test my statement you could write a simulation where the host randomly opens a door.
- lmm 5y agoCompletely false. Draw up a probability table for the case where the host picks a door at random (so 1/3 times they reveal the prize) and you'll see.
- rho4 5y agoWhat happens if the host reveals the prize? Is the game repeated? I'm saying as long as he doesn't accidentally open the prize door, it doesn't matter. If you insta-loose in that case, we're talking a different game.
- lmm 5y ago> What happens if the host reveals the prize? Is the game repeated? Maybe. Maybe you insta-lose. Maybe you insta-win. It doesn't matter. (But by definition if the host picks a door at random, there is a possibility that they will pick the door with the prize behind it, so something must happen in that case). > I'm saying as long as he doesn't accidentally open the prize door, it doesn't matter. But that's false. If the host picked the door to reveal at random then your chance is 1/2 if you switch and 1/2 if you keep your original door. The 1/3-2/3 case only happens if the host deliberately picked a door that didn't have the prize.
- rho4 5y agoSee for yourself: import java.util.List; import java.util.Random; import java.util.stream.Collectors; import java.util.stream.Stream; public class MontyHall { public static void main(String[] args) { Random random = new Random(); final boolean GUEST_ALWAYS_SWITCHES = true /* change guest strategy */; final boolean HOST_IS_DRUNK = false /* simulate host knowledge */; final boolean GUEST_WINS_IF_HOST_PICKS_PRIZE_BY_ACCIDENT = true; final double GAME_COUNT = 1_000_000; double winCount = 0; for(int i = 0; i < GAME_COUNT; i++) { List<String> remainingDoors = Stream.of("A", "B", "C").collect(Collectors.toList()); String prizeDoor = remainingDoors.get(random.nextInt(3)); String guestInitialPick = remainingDoors.remove(random.nextInt(remainingDoors.size())); String hostPick; if(HOST_IS_DRUNK) { hostPick = /* host picks random */ remainingDoors.remove(random.nextInt(remainingDoors.size())); } else { // host is sober and always opens empty door hostPick = remainingDoors.get(0).equals(prizeDoor) ? remainingDoors.remove(1) : remainingDoors.remove(0); } if(hostPick.equals(prizeDoor)) { if(GUEST_WINS_IF_HOST_PICKS_PRIZE_BY_ACCIDENT) { winCount++; } continue /* insta win/loss */; } // guest decides to stick with inital pick or switch String guestFinalPick = guestInitialPick; if(GUEST_ALWAYS_SWITCHES) { guestFinalPick = remainingDoors.get(0); } if(guestFinalPick.equals(prizeDoor)) { winCount++; } } System.out.println(String.format("Win rate: %.2f", winCount / GAME_COUNT)); } }
- lmm 5y agoTry setting GUEST_ALWAYS_SWITCHES=false, you'll find your winrate is still 2/3. In the if(hostPick.equals(prizeDoor)) block, rather than maybe incrementing winCount, you need to decrement GAME_COUNT (or rather the number that you're going to divide by at the end - don't reduce the number of iterations) - we're talking about the probability when you're deciding whether to switch (so after the host has already opened the door and not hit the prize).
- rho4 5y agoMy statement was that if you always switch, it doesn't matter whether the host is blind or not. But I must say it is an interesting find of the simulation that your win rate is always 2/3 independent of your strategy (provided the host is blind and you win when the host makes a mistake). I'm always talking about the probability of winning the complete game when sticking to a certain strategy. I never look at intermediate probabilities. Decrementing the game count or the divisor would be the like crossing out or ignoring decision tree branches. If you change the game rules and say the game is repeated if the drunken host picks the prize, then the simulation would have to repeat until the guest has either won or lost, but the game count would still remain the same (= the number of times a simulated guest is invited to the game show).
- lmm 5y ago> My statement was that if you always switch, it doesn't matter whether the host is blind or not. Well, it does matter unless you have the rather unusual rule that you win if the host reveals the prize - normally it would make a lot more sense to say you lose in that case. (In fact this is the deep reason why switching works in the original problem - if you switch, then you win if a blind host "would have" revealed the prize, whereas if you don't switch, you lose). The relevant general fact is that if the host is blind, your strategy never makes any difference. > Decrementing the game count or the divisor would be the like crossing out or ignoring decision tree branches. Well, there is no decision to be made if the host revealed the prize - you never get the choice of whether to switch or not. When we ask about the probabilities after a certain choice, at the point where you're making that choice you already know that you've certainly had to make that choice. Otherwise could equally well say that you have to include the probability of getting through to the final round, the probability of getting onto the gameshow in the first place, ...
- furyofantares 5y agoThat's not right, and it's one of the more confusing parts of the problem in my opinion. I can make sense of it by drawing out the probability trees and see that it's 1/2 rather than 2/3 in this case, but it actually sticks with me if I think more like so: My prior is that there's a 1/3 chance I picked the car; that's the world where the host can't reveal anything other than a goat. In the scenario where the host then reveals a goat intentionally, my prior doesn't change. The host can always reveal a goat. This gives me no information. Therefore, it's still 1/3 that I picked the car, so the remaining door must be 2/3, so I switch and get a 2/3 chance. But in the scenario where the host reveals a door at random, and it happens to be a goat, it's time to update my priors. Since he didn't accidentally reveal the prize, the probability that I'm in the world where he couldn't accidentally reveal the prize is increased relative to the probability that I'm in the world where he could have.
- rho4 5y agoSee my simulation code.
- furyofantares 5y agoYeah, you still win 2/3 of the time. Some of those wins come from the host accidentally showing you the prize, which is prior to your decision.