A stay strategy keeps the contestant’s initially selected door after the host reveals another door containing a goat. In the standard three-door Monty Hall setup, staying wins with probability one-third, while switching wins with probability two-thirds. The host’s informed choice—not a random elimination—preserves the original one-third versus two-thirds asymmetry. section 6.3.1
Model the strategy as a decision variable connected to the game’s causal workflow:
- The player makes an initial choice. section 6.3.3
- The host selects a losing door that differs from the initial choice. section 6.3.3
- Under stay, the second choice remains the initial door; the outcome is then determined by that choice and the car’s location. section 6.3.3 section 9.2.2
Conditional counterfactual
If a contestant stayed and lost, the initial door could not contain the car. The host therefore opened the only losing alternative available, so switching would have won with probability 100% in that realized case. section 9.2.4
Listing 9.10 Infer the counterfactual distributions
cf_model = do(twin_world_graph, {'Strategy Hyp': 'switch'}) #1
infer = VariableElimination(cf_model) #2
cf_dist1 = infer.query( #3
['Win or Lose Hyp'], #3
evidence={'Strategy': 'stay', 'Win or Lose': 'lose'} #3
)
print(cf_dist1)
cf_dist2 = infer.query( #4
['Win or Lose Hyp'], #4
evidence={'Win or Lose': 'lose'} #4
)
print(cf_dist2)
Inspect the pgmpy query that intervenes on a hypothetical switch strategy while conditioning on observed stay and loss. section 9.2.4
