"매 random sampling 의 deterministic answer 추정". Stanislaw Ulam (Manhattan Project, 1946)이 neutron diffusion 위해 고안. 매 closed-form solution 없는 high-dim integral, optimization, risk modeling 의 해법 — 매 large-N law of large numbers 의 convergence.
매 핵심
매 4단계
Define domain of possible inputs (probability distribution).
Sample randomly from domain (PRNG).
Compute deterministically for each sample.
Aggregate results (mean, variance, percentiles).
매 수학 기반
Law of Large Numbers: sample mean → expected value as N → ∞.
Convergence rate: O(1/√N) — 매 4× samples 의 2× accuracy.
Curse of dimensionality 의 escape: deterministic methods (grid) 매 d²/d³, MC 매 dimension-independent.
매 응용
금융: VaR, option pricing (Black-Scholes 외 path-dependent).
물리: particle transport, lattice QCD.
AI: Monte Carlo Tree Search (AlphaGo, MuZero).
Engineering: reliability analysis, sensitivity.
3D rendering: path tracing (Blender Cycles, Pixar RenderMan).
importnumpyasnpdefmc_call_antithetic(S0=100,K=105,r=0.05,sigma=0.2,T=1.0,n=500_000):Z=np.random.standard_normal(n)ST_plus=S0*np.exp((r-0.5*sigma**2)*T+sigma*np.sqrt(T)*Z)ST_minus=S0*np.exp((r-0.5*sigma**2)*T-sigma*np.sqrt(T)*Z)payoff=(np.maximum(ST_plus-K,0)+np.maximum(ST_minus-K,0))/2returnnp.exp(-r*T)*payoff.mean()# 매 same N 의 ~2× variance reduction
언제: high-dim integral, risk metrics, option pricing, game AI, sensitivity analysis.
언제 X: 매 closed-form 존재 매 (Black-Scholes European), low-dim quadrature 효율적인 case, deterministic answer 필요 매 (use seed).
❌ 안티패턴
Too few samples: O(1/√N) 매 slow — 매 1% accuracy 의 N=10000+.
No seed in production: non-reproducible bugs.
Bad PRNG: random.random() 매 OK, Math.random() (JS) 매 not crypto-safe — but fine 매 simulation.
No variance reduction: antithetic / control variates 매 free 2-10× speedup.
MC 의 deterministic 문제: 매 closed form 존재 의 use that.
🧪 검증 / 중복
Verified (Metropolis & Ulam 1949 original, Glasserman "Monte Carlo Methods in Financial Engineering" 2003, Kalos & Whitlock 2008).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — full content with π/option/VaR/MCTS patterns