Re: Universal 64-bit random number generator



On 2007-01-29 10:51:18 -0400, "Chris Theis" <christian.theis@xxxxxxxxxxxxxx> said:

Hello,

I'm currently looking into a code which uses the Universal 64-bit random
number generator which was suggested by George Marsaglia and Wai Wan Tsang
("The 64-bit universal RNG", (2004){\it Statistics and Probability Letters},
{\bf 66}, no. 2, 183-187,)

An example in their publication suggests to use two 10 digit integers (e.g.
123456789 and 987654321) to fill an array of seeds which are then used and
combined to produce random numbers. This seems to be a very nice and
straight-forward way to producing good-quality random numbers. However, the
code I got does some tweaking which seems to be questionable to me and I
would like to hear your opinion on that.

By default it uses two integers with 5 digits instead of 10 (12345 and
98765) and IMO this reduces the numbers of possible outcomes, which cannot
be greater than the number of seeds, significantly (10^10 instead of 10^20).
This self-restriction is not really what worries me, but there is another
thing that IMO is more problematic.

If each experiment were to use 10^15 random numbers then you would want a
cycle length considerable longer than that, particularly if you use the
random numbers in batches. The internal state of such a Pseudo Random
Number Generator would be able to represent each point on the cycle.
The seed is only a choice of some starting point along the cycle. So
a small number of seeds would mean a limited number of starting points.
This also means that the random number package would have to have a rule
for turning a restricted seed into an internal state. If you wanted to
break an experiment into two peices by continuing (exactly) after stopping
in the middle such a limited seed would not do the job as it would not be
able to represent the internal state (except in a few cases). If the cycle
length were 10^10 and you used 10^15 random numbers then it would not matter
if there were 10^3 or 10^6 convenince seeds as you would be reusing the
whole cylce repeatedly, with all experiments being essentially the same.

The number of seeds and the cycle lengths are different things. As a
convenience many packeages have a method of using simplified seeds as
many users consider supplying a 6000 word (or whatever) seed an excessive
burdern.

The user has the possibility to provide the second seed, while the first is
fixed. The user supplied seed has the limitation that it must not exceed 9E8
but internally the code uses not the user input but rather the number modulo
100000. Thus, all values which are equal in the last 5 digits (e.g.
123456789 and 888856789) will internally produce the same seed even though
the user presumably put in a different number. Therefore, IMHO the resulting
sequence of random numbers will be identical because internally the same
seed will be used, even though the user put in a presumably safe different
seed.

I would be very interested to hear your opinion on that!

Don't use the convenience feature. Instead set the internal state and
make sure that you meet any technical requirements on the internal state.
Suddenly the convenience feature will look more attractive.

The real issue is the quality of the random number generator. A secondary
issue is the ability to save and restore the internal state as well as
any convenience methods for doing so. In the past the internal state was
relatively small but now the internal state has become much larger on the
very long cycle pseudo random number generators. Convenience has become
an issue as users complain about the large internal state. So now the
convenience seed is there and it does not coincide with the internal state.
In the past the seed and the internal state were often the same but cycle
lengths were short by current standards.

Best regards
Chris


.



Relevant Pages

  • Re: random numbers in fortran
    ... I make sure that I have a generator capabable of producing any of the ... I understand also that with a short cycle, ... Generally in practice then, could I not compensate for a short cycle by ... The sample driver here prompts for N and 3 seeds. ...
    (comp.lang.fortran)
  • Re: random numbers in fortran
    ... extremely many possible outcomes. ... I make sure that I have a generator capabable of producing any of the ... I understand also that with a short cycle, ... The sample driver here prompts for N and 3 seeds. ...
    (comp.lang.fortran)
  • Re: random numbers in fortran
    ... particular random number generator, it is possible to know that the ... from the true distribution, it really does not matter whether any other ... possible seeds there are. ... could I not compensate for a short cycle by ...
    (comp.lang.fortran)
  • Re: How to set the seed as a 128 binary string of psudo random number
    ... You will have to implement your own random number generator, as that is not possible in Matlab. ... Matlab random number generators can be initialized with a 32 bit positive integer, or they can be initialized with an exact copy of their internal state, where their internal state is a cell array which varies with the generator but often has components that are more than ... it gives me> the same output for totally different 128 bits seeds. ...
    (comp.soft-sys.matlab)
  • Re: Card dealing and random repetition
    ... No, the length can be no more than the number of seeds; this amount is,) however, greater than the number of available returned values. ... 'internal state' were synonymous. ... We still have only as many distinct sequences as seeds, and only as many distinct deals as values of the internal state. ...
    (comp.programming)