# 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.

• The reason that rw dim numbers are used in montecarlo simulations is not because they are random, but instead because they span the n dimensional simulation space relatively uniformly, and 5his uniformity is conserved across all possible sub dimensions. There is no requirement that the numbers are actuslly random, and in fact there are many such sets of numbers for simulation which are not random which converge significantly faster. – will Oct 26 '20 at 22:03

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.
• @JesperTidblom: The problem is that for some problems to get a reasonably low variance (certainty that your number is close to the true value), you might need a lot of Monte Carlo samples. So there are tricks to reduce the variance without increasing the number of samples. One way that is directly associted with the random numbers themselves, is to do quasi-random numbers as suggested here. Intuitively if you draw samples from uniform(0,1), you would draw them so that they are "evenly spaced", e.g drawing two qasi samples would be $x_1 = 1/3$ and $x_2=2/3$ – Pontus Hultkrantz Dec 1 '20 at 12:59