Skip to content

Instantly share code, notes, and snippets.

ExplodingCabbage /
Last active January 5, 2020 19:37
Monty Hall Problem Monte Carlo simulation
# A simulation to settle a Twitter argument:
import random
random.seed(42) # For reproducible results
# We have four possible scenarios we can simulate, based on these two bools.
# The first determines whether it's permissible for the host to reveal the car
# on the first door-opening. The second determines whether the contestant is
# using an "always swap" strategy or an "always stick" strategy.