Quant Ladder

Monte Carlo Thinking: Simulation as a First-Class Tool

3 min read

When a probability problem resists closed form, the professional move isn't surrender — it's simulation. Monte Carlo is the law of large numbers turned into a tool, and interviews test both directions: could you simulate this, and do you know what the answer's error bars are?

The method and its error bar

Estimate E[X]E[X] by averaging nn independent draws. The estimate is unbiased, and its noise is

SE=σn\text{SE} = \frac{\sigma}{\sqrt{n}}

— the whole theory in one formula. Consequences you should produce instantly:

  • Another digit of precision costs 100× the samples (10×10\times smaller SE needs 10210^2 more draws). Monte Carlo converges slowly; its virtue is that the rate doesn't degrade with dimension — which is exactly why derivative pricing on many underlyings simulates while low-dimensional problems use trees or formulas.
  • Estimating a probability pp: SE =p(1p)/n= \sqrt{p(1-p)/n}. For p0.5p \approx 0.5 and n=10,000n = 10{,}000: SE 0.5%\approx 0.5\% — a useful anchor. Rare events are the killer: estimating p=104p = 10^{-4} to ±10% relative needs n108n \sim 10^8, the motivation for importance sampling.
  • Always report the error bar. "About 0.31 ± 0.01" is an answer; "0.3137" from a simulation is a category error — the trailing digits are noise, the same false-precision sin as in Fermi estimation.

The demo everyone should own: π from darts

Throw uniform points in the unit square; the fraction landing inside the quarter-circle estimates π/4\pi/4. It's the standard "write me a simple simulation" screen: five lines of the Python course's NumPy ((x*x + y*y <= 1).mean() * 4), plus the SE analysis above — with σ0.41\sigma \approx 0.41 per dart, n=106n = 10^6 darts give π to about ±0.0016. Producing both the code and the error bar is the complete answer.

Variance reduction: the craft layer

Same accuracy, fewer samples — the ideas matter more than implementations:

  • Antithetic variates: pair each draw ZZ with Z-Z; errors in symmetric problems partially cancel.
  • Control variates: simulate the difference from something you can price exactly (estimate the Asian option as "the closed-form geometric one, plus a simulated correction") — variance drops by the squared correlation with the control. This is also, structurally, how hedged books work: measure P&L relative to the hedge.
  • Importance sampling: to estimate tail probabilities, sample from the tail and reweight by the likelihood ratio — the only honest way to Monte Carlo a 10410^{-4} event, and the bridge to how risk systems stress-test.

Simulation as a check, not just a solver

The most valuable interview use is verification: you've derived 1/4 for the broken-stick problem — a ten-line simulation confirms or destroys it in seconds. Cultivate the habit of saying "and I'd sanity-check that by simulation" with the sketch of how: what you'd draw, what you'd count, how many runs for the precision you need. It signals the working style quant research actually runs on: derive, simulate, reconcile, and trust nothing that hasn't survived both.

The interview version

"How would you estimate the probability that the sum of 10 dice exceeds 45?" — Exact convolution is feasible but tedious; simulate: draw 10610^6 rounds, count exceedances, SE p(1p)/10000.05%\approx \sqrt{p(1-p)}/1000 \lesssim 0.05\% — and cross-check the ballpark with a normal approximation (mean 35, σ ≈ 5.4, so 45 is ~1.85σ: about 3%). Two independent methods, one consistent answer, error bars on both — that's the fluency being examined.