News for hackers. Stuff that matters.
Re:Your iPhone just got less secure. Blame the FBI by ghshephard on Wednesday March 30, 2016 @12:05PM (#11390266)
This is incorrect.

Flipping a coin to "to chose the second door and sometimes show the prize." has no impact on the probabilities. The parent is correct - there is a 2/3 chance the prize exists under one of the other two doors, and if one of them is shown not to have the prize (through random flipping, deliberate selection, whatever) - then the final door now has a 2/3 chance to have the prize.

Re:Your iPhone just got less secure. Blame the FBI by function_seven on Wednesday March 30, 2016 @12:21PM (#11390418)
If one of the doors is shown to not have the prize, the odds are now 1/2 when the choice of reveal door is made randomly. That's because 1/3 of the time, you're not even offered the chance to switch, since it's pointless.

I'll run the trials here. Assume the first two doors have the goat, and the third door has the car.

   Pick  Reveal  Switch?  Outcome
   ----  ------  -------  -------
     1      2      Y 3    Car
     2      1      Y 3    Car
     3      1      N 3    Car
     3      2      N 3    Car

     1      2      N 1    Goat
     2      1      N 2    Goat  
     3      1      Y 2    Goat
     3      2      Y 1    Goat

     1      3       -     No chance to switch      
     1      3       -     No chance to switch
     2      3       -     No chance to switch
     2      3       -     No chance to switch
Meaning, given that you've made it to the point that an offer to switch doors is presented, there is no advantage to do so (or not do so).
Re:Your iPhone just got less secure. Blame the FBI by carleverett on Wednesday March 30, 2016 @12:43PM (#11390632)
But in the actual game, you are always given the chance to switch. Here are the possible outcomes of the game, with the third column being what the contestant should do to win:

   You Pick  Car   Switch?
   -------  -----  ------
       1      1      N    
       2      1      Y   
       3      1      Y
 
       1      2      Y
       2      2      N  
       3      2      Y

       1      3      Y     
       2      3      Y     
       3      3      N   
Without knowing anything else, switching means that you win 2/3 of the time.
Re:Your iPhone just got less secure. Blame the FBI by Retric on Wednesday March 30, 2016 @12:56PM (#11390799)
I changed to rules so in "3, 1, Y" he might open door 3 and show you a car. At that point switching is a meaningless choice.
Re:Your iPhone just got less secure. Blame the FBI by function_seven on Wednesday March 30, 2016 @12:46PM (#11390677)
Your comment (EDIT: Sorry, not yours, but parent) was talking about a random flip of coin determining which door Monty shows. That's not the actual game. If Monty is randomly showing a door without regard to goat/car, then you have to also consider the scenarios where he reveals a car and you lose early.
Re:Your iPhone just got less secure. Blame the FBI by ghshephard on Thursday March 31, 2016 @09:51AM (#11397117)
If, while randomly flipping a coin, he reveals the car then you have a 0% chance of winning. If he doesn't reveal a car then you have a 2/3 chance of winning if you switch doors.
Re:Your iPhone just got less secure. Blame the FBI by function_seven on Thursday March 31, 2016 @12:14PM (#11398245)
In this scenario, Monty's door choice and your door choice are completely independent actions. Because of this, you gain no new information from the door he reveals. In the classic version of this puzzle (where Monty always reveals a goat), you do gain information, because most of the time Monty's forced to choose the only other goat, and therefore avoid the car.

http://c2.com/cgi/wiki?NotTheMontyHallProblem

The switching strategy is effective because it relies on Monty's avoidance of the car. When Monty isn't trying to avoid the car, his revelation doesn't help you out at all. It just tells you that you either (A) now have a slightly better chance (50%), or (2) you've already lost. (0%).

EDIT: Also see the table on this wikipedia article. It lists probabilities for all the different variants of the MHP. Your scenario is referred to as the Monty Fall or Ignorant Monty variant.

https://en.wikipedia.org/wiki/Monty_Hall_problem#Other_host_...

    "Monty Fall" or "Ignorant Monty": The host does not know
    what lies behind the doors, and opens one at random that
    happens not to reveal the car
    (Granberg and Brown, 1995:712) (Rosenthal, 2005a) (Rosenthal, 2005b).
    Switching wins the car half of the time.
Re:Your iPhone just got less secure. Blame the FBI by ghshephard on Friday April 01, 2016 @11:18AM (#11405401)
When you originally pick a door - there are three. (We all agree on this). Because you are picking at random, and the prize is only behind one door, there is a 1/3 chance that you have picked the right door. (likewise, We can all agree on that.) Therefore, I think we can all agree that there is a 2/3 chance that the prize exists behind one of the other two doors.

Let us take your approach, and have Monty flip a coin, revealing ANY door at random.

If he flips your door, and you have the prize - You have a 100% chance of winning. If he flips your door, and you have the goat, 0% chance of winning. Those two scenarios are easy, and we can ignore them.

Likewise, if he flips the coin, and shows one of the other two doors, and they have the prize - then, once again - easy - 0% chance of winning. We can ignore these scenarios.

I think up to this point, we can agree on all of the above scenarios. (They are win/lose)

Where it gets complex, he flips a coin, selects one of the doors you aren't on, and reveals a goat.

Given that you had a 1/3 chance originally of winning, and a 2/3 chance of not winning, and given that Monty has now revealed that one of the other two doors (By chance) does not have the car, your 2/3 chance of not winning is still the same, but now it applies to only a single door - I.E. You have a 66% chance of winning by selecting that other door - and the fact that Monty selected that door by chance, is irrelevant.

Unfortunately, despite my (flawed) apparently logical argument - I'm completely wrong, and you are correct.

   from random import *
   def putPrizeInDoor():
       doors=[0,0,0]
       door_winner=randint(0,2)
       doors[door_winner]=1
       return doors

   trials=100000
   testCount=0
   win=lose=0
   for x in range(trials):
       doors=putPrizeInDoor()
       userSelects=randint(0,2)
       montyReveals=randint(0,2)
       if montyReveals==userSelects: # Monty reveals the door user is on
           pass
       else:
           if doors[montyReveals]==1: # Monty Revealed the prize.
               pass
           else: # this is where it's interesting - Monty reveals, at random, door not winning that user not on.
               revealedDoors=set([montyReveals,userSelects])
               newUserChoice=list(set([0,1,2])-revealedDoors)[0]
               testCount+=1
               if doors[newUserChoice]==1:
                   win+=1
               else:
                   lose+=1
        
            
   print ("Tested: {}  Wins: {}  Lost: {}  Percentage: {:.2f}".format(testCount,win,lose,win/testCount))
 

Tested: 44484 Wins: 22220 Lost: 22264 Percentage: 0.50

It's interesting that the deliberate selection by Monty of the goat, increases my chance from 33% to 66% if I switch, but the random selection by Monty of the goat, only increases my chance from 33% to 50% if I switch. I'm not really sure where the argument I made breaks down, but, empirically, it's clearly broken. I'll have to meditate on it a bit to see where I've gone awry.

Re:Your iPhone just got less secure. Blame the FBI by Retric on Friday April 01, 2016 @11:41AM (#11405629)
I must say this is one of the best comments I have seen on HN. I don't know if this helps you meditate on the game or not, but this is how I walk though the logic.

1/3 of the time you picked correct: 100% of those worlds he shows a goat. 1/3 of the time you picked wrong and he shows a goat. 1/3 of the time you picked wrong and he shows a car.

So your overall odds are 1/3 of winning if you don't change AND 1/3 of the time you don't get the chance to change.

Thus, your overall chances of winning in this case is 1/3. But, if he shows you a goat your odds are bumped to 1/3: 1/3 or 50/50.

Re:Your iPhone just got less secure. Blame the FBI by function_seven on Friday April 01, 2016 @12:23PM (#11406032)
Thanks for this comment! I thought this thread was dead.

I was searching for online simulators that let me tweak the rules of the game, but I could only find those that follow the original rules of the puzzle.

In thinking more about the Ignorant Monty scenario, I realized it's equivalent to having 3 contestants pick doors:

    Me
    Montgomery
    Switchy McSwitcherson
First I pick a door. Then Montgomery picks a door. Finally Switchy McSwitcherson gets the remaining door. Once all the picking is done, Montgomery opens his door first, and is saddened to see a goat. At this point, who is more likely to win? Me or Switchy McSwitcherson? Since we both had 1/3 initial odds, there's symmetry there, and one of us can't reap all the odds-boosting.

But the classic puzzle is more like a 2-contestant game, where I pick a door, the host selects a goat to reveal (and reveals it), then Switchy McSwitcherson is assigned the remaining door. In that scenario, I'm mad that they made me pick first before the host eliminated a door for Switchy. Switchy enjoys all the odds boosting.