Interpreting Mersenne Twister for Monte Carlo Simulation
Summary
The document addresses whether Mersenne Twister’s 623-dimensional equidistribution property means that longer Monte Carlo samples lose independence. It clarifies that the property concerns the generator’s coverage of tuples across its very long period, at a stated word precision; it does not impose a maximum sample-vector length of 623. The answer therefore rejects the concern as a misreading, assuming the generator is correctly implemented.
This explanation is about a mathematical property of a pseudorandom generator, not evidence that every implementation or simulation is free of bias. The response briefly mentions that Monte Carlo can sometimes work with nonrandom sequences, but does not explain that approach. A second answer points to Xorshift as an alternative without providing a comparison or supporting detail, so the document offers little basis for choosing between generators.
Key ideas
- The 623-dimensional property describes tuple equidistribution, not a maximum Monte Carlo sample length.
- Mersenne Twister’s stated period is much longer than typical Monte Carlo sequences.
- The reassurance assumes the random number generator is implemented correctly.
- The document mentions Xorshift but gives no evidence for comparing it with Mersenne Twister.
Tags
Full text
# Reliable random number generation for Monte Carlo
# Reliable random number generation for Monte Carlo
Monte Carlo methods typically require us to construct very large vectors of numbers. In doing so it is often of great importance that the generated random numbers are independent.
My question here, as someone who knows next to nothing about random number generators, is: Is there a risk that the shortcomings of some, or all, random number generators influence the end result of the Monte Carlo simulation in a noticeable way with some bias or subtle dependence between the random numbers?
I heard someone say that the commonly used Mersenne twister could only guarantee independence of the elements in up to 623 elements long vectors, which is way smaller than the typical length of a Monte Carlo sample. Don't know if I misunderstood that, but it would be nice if someone could shed some light on the matter.
## Answer by Forgottenscience (score 5)
https://quant.stackexchange.com/a/58939
You have misunderstood the statement in Matsumotos original paper. The original Mersenne twister guarantees, over its period of $2^{19937}-1$ (a number which I am sure you will agree is larger than the length of any Monte Carlo sequence ever devised), that every 623 dimensional uniformly distributed tuple occurs a fixed number of times, with each single uniform number (per dimension) being up to 32 bits in length. That is, the Mersenne twister can (or will, if run long enough) produce every 623-tuple of 32-bit integers. If we reduce that to a single tuple, the Mersenne twister is a uniformly distributed $623 \times 32 = 19936$ bit binary generator.
In other words, no, you do not need to worry - if the RNG is properly implemented that is.
However, sometimes we don't even need properly random numbers to do Monte Carlo, but that is another discussion.
## Answer by rvignolo (score 0)
https://quant.stackexchange.com/a/59630
Check out the Xorshift method, which seems to be a better method than Mersenne Twister. It is also implemented here, documented here.Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.