Monte Carlo Simulation
Monte Carlo Simulation
Introduction: Calculating Pi () with Darts
Imagine you draw a square on the wall and a circle inside it. You are terrible at darts, so you throw them randomly. After throwing 1,000 darts:
- Total throws: 1,000
- Hits inside circle: 785
- Ratio:
Since the Area of Circle / Area of Square = , we can say . You just calculated Pi using random luck. This is the Monte Carlo Method.
What Problem does it solve?
- Input: A system with uncertain variables or equations too complex to solve analytically.
- Output: An approximate result based on many random simulations.
- The Promise: Can solve problems (like high-dimensional integrals) that traditional math cannot.
Core Idea (Intuition)
“Law of Large Numbers” If you repeat an experiment enough times, the average of the results will converge to the true expected value. Instead of trying to calculate the exact probability of winning a poker hand (which involves massive combinatorics), just simulate playing the hand 1 million times and count the wins.
Typical Business Scenarios
- ✅ Finance (Risk Analysis): “What are the chances my portfolio loses 20% value next year?” Simulating 10,000 possible stock market futures.
- ✅ Ray Tracing (Graphics): Simulating millions of light photons bouncing randomly to create realistic lighting and shadows.
- ✅ AI (AlphaGo): Monte Carlo Tree Search (MCTS) simulates thousands of random future chess/Go moves to decide the best current move.
- ✅ Engineering: Testing the reliability of a bridge by simulating wind loads with random variations.
Performance & Complexity
- Accuracy: Improves with (where is the number of samples). To double the precision, you need 4x the samples.
- Speed: Highly parallelizable (you can run simulations on 1,000 GPUs at once).
Summary
“Monte Carlo is the ‘Brute Force of Probability’. When an equation is too hard to solve, just simulate it a million times. The aggregate of randomness often reveals the truth.”
