Monte Carlo Crash Course: Sampling
Published on: 2025-04-29 14:54:51
Monte Carlo Crash Course
Sampling
In the previous chapter, we assumed that we can uniformly randomly sample our domain. However, it’s not obvious how to actually do so—in fact, how can a deterministic computer even generate random numbers?
Pseudo-Random Numbers
Fortunately, Monte Carlo methods don’t need truly random numbers. Instead, we can use a pseudo-random number generator (PRNG). A PRNG produces a deterministic stream of numbers that look uniformly random:
By “look uniformly random,” we mean the sequence exhibits certain statistical properties:
Uniformity: samples are evenly distributed.
Independence: previous samples cannot be used to predict future samples.
Aperiodicity: the sequence of samples does not repeat.
Deterministic generators cannot fully achieve these properties, but can get pretty close, in a precise sense. Here, we will use the PCG family of generators, which are performant, small, and statistically robust.
PRNGs give us uniformly random scalars, but we u
... Read full article.