Using the Monte Carlo method to solve the Monty Hall problem
MontyHall is an example of solving a probability puzzle (The Monty Hall Problem) using repeated random sampling (The Monte Carlo Method) in R.
From Parade magazine in 1990 (as quoted on wikipedia):
Suppose you’re on a game show, and you’re given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what’s behind the doors, opens another door, say No. 3, which has a goat. He then says to you, “Do you want to pick door No. 2?” Is it to your advantage to switch your choice?
You can view the rmarkdown html at https://tjconstant.github.io/montyhall/Monty-Hall.html