Monte Carlo methods vary, but tend to follow a particular pattern:
- Define a domain of possible inputs
- Generate inputs randomly from a probability distribution over the domain
- Perform a deterministic computation on the inputs
- Replicate the experiment
- Aggregate the results
To better understand how Monte Carlo simulation works we will develop a classic experiment: Finding pi Using Monte Carlo Simulation