Text
Simulate the Monty Hall problem with a -sided die: doors , , ; use three die outcomes for the position of the prize (– = door , – = door , – = door ). Play at least trials and compare the winning frequency of the «switch» and «stay» strategies with the theory.
Solution
Set-up. Fix a strategy (for example «always switch»). For each trial: roll the die to place the prize, choose an initial door, the host opens a door with the goat among the two remaining, then apply the strategy. Record win/loss. The theoretical prediction is obtained with Bayes’ theorem / counting the cases: by switching you win with probability , by staying with probability . After trials the experimental frequency of winning «by switching» should approach wins out of . Discuss the deviations as an effect of the finite sample.
Links
Topics: Probabilita
Concepts: Paradosso di monty hall · Teorema di bayes
Methods: Bayes
Skills: Calcolo probabilita · Ragionare per casi
Exercise type: Problema probabilita