I've recently been interested in Monte Carlo simulations and their uses, unfortunately most of the examples I find are difficult to understand for a beginner. What are some simple examples of using Monte Carlo simulations used to solve math problems? Bonus points for showing a simple example and using it to understand a more complex one.

One should, BTW, distinguish between Monte Carlo algorithms, which can only compute approximations, and Las Vegas algorithms which, even with the "random" component of the algorithm, gives an exact answer.
–
Ｊ. Ｍ.Aug 16 '10 at 22:25

4 Answers
4

Monte Carlo methods are very useful in numerically evaluating high-dimensional integrals. With traditional integration methods, the number of integrand evaluations required to maintain accuracy grows quickly as dimension increases. With Monte Carlo integration, the number of integrand evaluations needed is independent of dimension. For many high-dimensional integrals, Monte Carlo methods are the only practical choice.

True. I was implicitly including quasi-Monte Carlo with Monte Carlo. An interesting variation is randomized QMC, randomly shifting QMC sequences to get more accuracy on some problems than either MC or QMC separately.
–
John D. CookAug 17 '10 at 16:01

Indeed, all different variations of sampling n-space as sparsely as one can get while still getting usable answers.
–
Ｊ. Ｍ.Aug 17 '10 at 16:36

Monte Carlo methods are used extensively in financial mathematics for the pricing of complex or "exotic" financial derivatives. With equity options, for example, the value of the stocks in the option contract is simulated using a stochastic process and parameters that can be observed or derived from other financial instruments. This process is computationally very intensive resulting in many investment banks having server farms of tens of thousands of machines dedicated to the pricing and risk management of derivatives.

Tangential to John D. Cook's reply, and also somewhat related: Monte Carlo also finds application in the solution of (partial, stochastic) differential equations, of which cubature (nobody ever uses MC in the one-dimensional case practically ;) ) is but a specialized case. As already mentioned by John, the pain dealt by the "curse of dimensionality" stings less with Monte Carlo.

You could use montecarlo method to approximate pi.
You basically define a square of side length 2 and inscribe a circle of radius 1 in it. Let the center of the circle be at the origin.
Use a random number generator to pick an x-coordinate between 0 and 1 and a y-coordinate between 0 and 1.

number of pts in the circle / number of pts in square ~ pi/4

This is the simplest example of a monte carlo code I know and I think it is probably the standard example.