Short Note on Monte Carlo Simulation

Monte Carlo simulation is one of the most foundational numerical paradigms in modern science, quantitative finance, and engineering. At its core, it tackles problems involving high-dimensional parameter spaces or stochastic dynamics where direct, analytical formulas (like middle-school algebra) are impossible to derive.
What is Monte Carlo Simulation?
In classical deterministic physics, we can often estimate simple trajectories with closed-form equations—such as estimating travel distance via $\text{distance} = \text{velocity} \times \text{time}$. However, real-world systems are rarely that neat. Whether dealing with financial markets, quantum defect dynamics, or molecular configurations, physical and computational systems are frequently chaotic or governed by dozens of coupled variables with inherent uncertainty.
When no perfect analytical equation exists, Monte Carlo methods turn the problem on its head: instead of attempting to solve the system deterministically, we use computational power to simulate repeated random trials millions of times, observing the emergent probability distribution.
The 3-Step Methodology
Regardless of the problem's complexity, almost every Monte Carlo workflow follows three fundamental steps:
- Define the Domain:
Explicitly specify the input parameter space, the allowable boundaries, and the probability distributions governing the variables. - Execute the Main Calculation:
- Random Sampling: Generate random inputs across the defined domain according to their probability distributions.
- Deterministic Computation: Feed the sampled values into the system model and evaluate the result deterministically.
- Record Trial Outcome: Capture a single numerical outcome for that specific iteration.
- Aggregate & Average:
- Repeat the calculation loop over a large number of trials ($N$).
- Aggregate the individual outcomes to construct the statistical distribution, calculate expected values, and determine confidence intervals.
Classic Example: Estimating $\pi$ via Geometric Sampling
A canonical demonstration of Monte Carlo simulation is the estimation of $\pi$ using random darts on a Cartesian plane.
1. Define the Domain
Consider a circle of radius $r$ inscribed within a square of side length $2r$. The ratio of their areas is strictly geometric:
$ \frac{\text{Area}{\text{circle}}}{\text{Area}{\text{square}}} = \frac{\pi r^2}{(2r)^2} = \frac{\pi}{4}$
If we place the center of the circle at the origin $(0, 0)$ with $r = 1$, our sampling domain becomes the unit square on the $x\text{-}y$ plane:
$$x, y \in [-1, 1]$$
2. Main Calculation
We repeatedly generate uniform random coordinate pairs $(x, y)$ in $[-1, 1] \times [-1, 1]$. For each trial, we test whether the point falls inside the inscribed circle using the Euclidean condition:
$$x^2 + y^2 \le 1$$
3. Aggregate & Average
Because the points are uniformly distributed, the probability of any point landing inside the circle is proportional to the area ratio. Thus, after $N_{\text{total}}$ trials:
$ \frac{N_{\text{inside}}}{N_{\text{total}}} \approx \frac{\text{Area}{\text{circle}}}{\text{Area}{\text{square}}} = \frac{\pi}{4} \implies \pi \approx 4 \times \frac{N_{\text{inside}}}{N_{\text{total}}} $
Python Implementation
The entire 3-step process can be expressed in just a few lines of vectorized NumPy code:
1 | import numpy as np |
Below is the resulting visualization from running 5,000 random throws:

Strengths: Where Monte Carlo Excels
- Taming the Curse of Dimensionality: Deterministic numerical integration (such as trapezoidal or Simpson's rules on a grid) suffers exponentially as the number of dimensions $d$ increases ($\mathcal{O}(K^d)$ grid points). Monte Carlo's convergence rate is completely independent of the problem's dimensionality, making it the primary viable method for high-dimensional path integrals.
- Natural Risk & Uncertainty Quantification: Rather than outputting a brittle single point estimate, Monte Carlo yields a full probability distribution, making confidence intervals, tail-risk metrics (e.g., Value at Risk), and variance analysis straightforward.
- Embarrassingly Parallel: Because each sample trial is completely independent of every other trial, the workload can be trivially partitioned across multi-core processors, compute clusters, or GPUs with near-linear scaling.
Caveats: Inherent Limitations
- Garbage In, Garbage Out (GIGO): Monte Carlo simulation does not generate new empirical truth; it merely evaluates and amplifies the assumptions embedded in your model. If the underlying probability distributions or parameter interactions are flawed, the simulation will simply yield high-precision nonsense.
- Slow Convergence Rate ($\mathcal{O}(1/\sqrt{N})$): The standard error converges at a rate of $\mathcal{O}(1/\sqrt{N})$, which is significantly slower than standard low-dimensional quadrature methods. This gives rise to the Rule of $4\times$: to halve the estimation error, one must quadruple the sample size:
$ \text{Error} \propto \frac{1}{\sqrt{N}} \implies \text{Error}{\text{new}} = \frac{1}{2}\text{Error}{\text{old}} \implies N_{\text{new}} = 4 N_{\text{old}} $
- PRNG Quality & Periodicity: The reliability of the output hinges on the quality of the pseudo-random number generator (PRNG). Low-entropy generators or hidden correlations can introduce subtle systematic biases into the resulting distribution.
Personal Reflection: Why We Still Write and Think in the AI Era
When working daily alongside advanced AI tools that can effortlessly synthesize explanations, code, and summaries, a fundamental question occasionally arises: Is it still worth maintaining a personal blog and writing notes down by hand?
From my perspective, writing things down in our own words remains indispensable. Writing is not merely the passive transcription of existing thoughts; it is the cognitive forge where ideas are actively organized, stress-tested, and synthesized. When we force ourselves to articulate a concept from scratch, the output mirrors the true depth and coherence of our mental model.
Furthermore, AI models can simulate linguistic patterns, but they cannot replicate lived human experience—the tangible friction of debugging an experiment, the intuitive realization during late-night analysis, or the nuanced trade-offs made in real engineering. Whether from entry-level learners or seasoned experts, authentic human reflections create unique value that cannot be substituted by statistical text generators. In the end, the ultimate ceiling of any AI tool is determined by the clarity of thought and taste of the human directing it.