A PRNG turns a seed into reproducible simulated inputs. A complete toy cycle shows why a flat histogram and a long period do not establish independence.
Pseudo-random number generator
A pseudo-random number generator (PRNG) is a deterministic algorithm that updates an internal state and produces a sequence designed to behave like random draws for a specified use. A random seed initialises that state. Given the same initial state and the same operations, the algorithm follows the same sequence again.
That repeatability is valuable in Monte Carlo simulation. When an option valuation changes after a code revision, replaying the same simulated shocks helps distinguish a change in the calculation from a change in the inputs. But reproducibility answers “Can I replay this experiment?”, not “Are these suitable random inputs?” A poor generator is reproducible too.
A generator small enough to inspect completely
Consider a toy linear congruential generator, or LCG:
xn+1=(5xn+1)mod16,un+1=16xn+1,x0=1.
The modulo operation keeps the remainder after division by 16. The first step gives x1=6 and u1=6/16=0.375. The next gives x2=31mod16=15 and u2=0.9375. Following the recurrence produces this complete cycle of output states:
The next state is 6 again. All 16 possible states appear before the sequence repeats, so its period is 16. This is an exact arithmetic example, not a simulated sample or a production generator recommendation.
Dividing by 16 puts the outputs on the grid {0,1/16,…,15/16} inside [0,1). A full cycle visits each grid point once. It does not produce draws from an exact continuous uniform distribution: there are only 16 possible values, zero is included, and one is excluded.
The histogram passes; the pairs fail
The cycle has eight even states and eight odd states. Yet every transition switches parity: multiplying by the odd number 5 preserves parity, adding 1 changes it, and reducing modulo the even number 16 preserves the result.
Consequently, among the 16 consecutive pairs around the complete cycle, including its closing transition, there are eight even-to-odd pairs, eight odd-to-even pairs and no same-parity pairs. If two draws were independent and each assigned probability 1/2 to an even state, their even-to-even probability would instead be
P(first even, next even)=21⋅21=41.
Exact toy LCG with seed 1 visits every integer state from 0 to 15 once in a period of 16. Its full-cycle transition counts are 8 even-to-odd, 8 odd-to-even and 0 for both same-parity pairs.
Original exact toy example. The state histogram is balanced, while the adjacent-pair table exposes complete parity dependence. Counts include the transition closing the cycle; no empirical market data or stochastic simulation.
This is why a flat histogram and a long period do not establish independence. A path simulation uses vectors of successive inputs, not just their individual frequencies. Generator assessment needs theoretical structure and statistical testing appropriate to those joint inputs. Passing a finite collection of tests cannot prove genuine randomness.
For the recurrence and higher-dimensional lattice failures, see §§1.1–1.2 of Random Number Generation, available in full with membership, with a public preview. Its LCG examples extend the toy mechanism into failures that can matter for numerical integration.
A deterministic generator with finitely many states must eventually revisit a state and repeat the subsequent cycle. There can be an initial transient before that cycle. Our toy has no transient: it returns to its seed after visiting all states. Also, starting this same toy at seed 6 simply starts one position farther along the same cycle; different seed labels do not by themselves create separate streams.
What to record for a simulation you can replay
A production simulation normally uses a maintained library generator rather than a home-built recurrence. The generator's state evolution and the transformation into a desired distribution are separate parts of the calculation. Uniform-like outputs may feed inverse-transform sampling or a Box–Muller transform; a library's normal sampler may use a different algorithm. Endpoint conventions matter when a transformation takes a logarithm or an inverse CDF.
Record the generator algorithm, seed or saved state, library version, distribution-sampling method and order of calls. Saving state allows continuation from a checkpoint; restarting from the seed replays from the beginning. Reinitialising with the same seed inside every path repeats the same shocks instead of supplying fresh paths. NumPy's compatibility policy specifies strict conditions for reproducing a stream, including the same build, environment, machine and sequence of calls. A seed alone is not a complete cross-environment replay record.
For parallel work, give workers streams through a documented splitting or spawning mechanism, and retain their assignment. Copying one initialised generator into every worker duplicates its future stream. NumPy's parallel-generation documentation describes SeedSequence spawning and states its independence assurance probabilistically, rather than as an absolute guarantee.
As checked on 25 October 2026, NumPy's default_rng constructs a Generator using PCG64 by default. Naming the API and algorithm is more useful than recording only “NumPy random”. The practical target is a suitable, tested source of simulated inputs whose construction you can explain and reproduce; fixing a seed does not remove Monte Carlo standard error or validate the financial model.
Sources
Paul Glasserman, Monte Carlo Methods in Financial Engineering, first edition, Springer, 2003, §§2.1.1–2.1.4 — deterministic generation, reproducibility, mixed LCGs, stream splitting and lattice structure. Publisher record.
NumPy: Random Generator — separation of bit generation from distribution sampling, seeding and the documented PCG64 default.