 # Why XORWOW algorithm in CURAND?

There used to be a CUDA sample source that uses the Mersenne Twister(MT) algorithm, but this algorithm seems to be replaced by XORWOW algorithm in CURAND library.
I wonder why this replacement took place.
To my understanding, MT has much longer period than XORWOW as shown below.

[Periods]
XORWOW : 2^192 - 2^32
MT : 2^19937 - 1

In addition, does anybody know the period of SOBOL32 algorithm, which is included in CURAND as well.

Thank you,

(Disclaimer: I have nothing to do with CURAND development.)

Period is not the only measure of a pseudorandom number generation quality. MT requires a very large state (624 words), which makes it incredibly unwieldy if you want a random number sequence for each thread in something like CUDA where you have tens of thousands of threads. From the looks of the referenced paper on XORWOW, the 2^192 variant requires only 5 words of state. XORWOW also requires a lot fewer operations, which is also good for performance, and yet still passes standard tests of RNG quality.

If you are asking this question, you don’t want to use SOBOL32. Quasi-random number generators are not the same as psuedo-random number generators and have different applications. You should read:

http://en.wikipedia.org/wiki/Low-discrepancy_sequence

for more information. All the quasi-random sequences I’ve used have infinite period (i.e., they never repeat).

OK, just to be pedantic with myself, the period is not infinite (since there are a finite number of floating point values), but for most algorithms you hit a point where the finite precision of floating point starts to impact the behavior of the sequence, or your counter variable rolls over. It’s not quite the same thing as periodicity in a pseudo-random number generator.

Hello seibert,

OK, I got it.
Thank you,

Hello Tooney & Seibert,

Yes, you are almost correct,

The Sobol number (Low-discrepancy_sequence) fills the gaps that left over, as it will take infinite time to fill 100 percent of gaps between given limits, in theory it has infinite sequence of numbers, and in practical it does not have any periodicity. The Mersenne Twister(MT) has huge periodicity that is 4 followed by 6000 zeros!

However, in calculations you may need 10,000 iterations to reach convergence of result, and Sobol is the best when your have dimension d (i.e., number of random numbers required per iteration) d < 3.

I will be adding a video about random numbers in my site: http://www.numericalsolution.co.uk/blog/

Thanks!