The Time Everyone “Corrected” the World’s Smartest Woman.

Here is a complete decision tree if Monty is ignorant. In this case, blindly switching isn't useful because there's just as many branches where switching wins as there are branches where switching loses.

| Car     | Choice  | Open    | Switch  | Result   |
+---------+---------+---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    B    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Win!   |
|         |    A    |         | p = 1/2 | p = 1/36 |
|         | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    C    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Win!   |
|         |         |         | p = 1/2 | p = 1/36 |
|         +---------+---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    A    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Lose   |
|    A    |    B    |         | p = 1/2 | p = 1/36 |
| p = 1/3 | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Win!   |
|         |         |    C    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Lose   |
|         |         |         | p = 1/2 | p = 1/36 |
|         +---------+---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    A    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Lose   |
|         |    C    |         | p = 1/2 | p = 1/36 |
|         | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Win!   |
|         |         |    B    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Lose   |
|         |         |         | p = 1/2 | p = 1/36 |
+---------+---------+---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    B    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Lose   |
|         |    A    |         | p = 1/2 | p = 1/36 |
|         | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Win!   |
|         |         |    C    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Lose   |
|         |         |         | p = 1/2 | p = 1/36 |
|         +---------+---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    A    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Win!   |
|    B    |    B    |         | p = 1/2 | p = 1/36 |
| p = 1/3 | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    C    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Win!   |
|         |         |         | p = 1/2 | p = 1/36 |
|         +---------+---------+---------+----------+
|         |         |         |   Yes   |   Win!   |
|         |         |    A    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Lose   |
|         |    C    |         | p = 1/2 | p = 1/36 |
|         | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    B    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Lose   |
|         |         |         | p = 1/2 | p = 1/36 |
+---------+---------+---------+---------+----------+
|         |         |         |   Yes   |   Win!   |
|         |         |    B    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Lose   |
|         |    A    |         | p = 1/2 | p = 1/36 |
|         | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    C    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Lose   |
|         |         |         | p = 1/2 | p = 1/36 |
|         +---------+---------+---------+----------+
|         |         |         |   Yes   |   Win!   |
|         |         |    A    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Lose   |
|    C    |    B    |         | p = 1/2 | p = 1/36 |
| p = 1/3 | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    C    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 |---------+----------+
|         |         |         |   No    |   Lose   |
|         |         |         | p = 1/2 | p = 1/36 |
|         +---------+---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    A    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Win!   |
|         |    C    |         | p = 1/2 | p = 1/36 |
|         | p = 1/3 +---------+---------+----------+
|         |         |         |   Yes   |   Lose   |
|         |         |    B    | p = 1/2 | p = 1/36 |
|         |         | p = 1/2 +---------+----------+
|         |         |         |   No    |   Win!   |
|         |         |         | p = 1/2 | p = 1/36 |
+---------+---------+---------+---------+----------+

However, even if Monty is ignorant, the fact that he just revealed a goat means we can trim the tree down. We can eliminate all branches where the door opened has the car. If we remove all branches where the third column (the door opened) matches the first column (the door with the car) then we get this decision tree. So in all cases where you have a chance of winning, switching is better even if Monty is ignorant.

Your code has a bug in it's logic. This is a correct program that demonstrates that switching is better. After we eliminate all cases where you cannot win, two thirds of the remaining games are won by switching.

import random
guarenteed_loss = 0
win_by_switching = 0
win_by_staying = 0
game_count = 1000000

i = 1
while i <= game_count:
    car_location = random.randint(1,3)
    players_choice = random.randint(1,3)
    montys_choice = random.randint(1,3)
    if car_location == montys_choice:
        guarenteed_loss += 1
    elif car_location == players_choice:
        win_by_staying += 1
    else:
        win_by_switching += 1
    i = i+1

print("Monty chose the car:")
print(guarenteed_loss)
print("Games with a chance of winning:")
print(game_count - guarenteed_loss)
print("Switching wins:")
print(win_by_switching)
print("Staying wins:")
print(win_by_staying)      

Here is the output:

Monty chose the car:
333772
Games with a chance of winning:
666228
Switching wins:
444025
Staying wins:
222203
/r/TwoXChromosomes Thread Link - priceonomics.com