What do you think is incorrect about the code here which produces 1/2 if Monty randomly chooses? https://news.ycombinator.com/item?id=39515082
Switching only wins when Monty avoids opening the car door. If Monty opens a random door, then switching makes no difference.
The flaw in my logic above for the random case is that it's 1/3 chance orig pick was right, 1/3 chance unopened door, plus 1/3 chance that Monty opened the door with the car behind meaning you never even got a choice to switch.