Chronology Current Month Current Thread Current Date
[Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

Re: [Phys-L] From a Math Prof (physics BS major) at my institution ( math challenge)



That is an excellent question. In general the answer is, “No, absolutely not.”

The measures of quality for pRNGs, which you suggest, look for things like correlations between consecutive numbers, and correlations between every N numbers. You would need to perform those same tests on the random numbers generated by pairs selected by the different pRNGs. While by themselves you can measure a pRNG to be very random, the sum of two different pRNGs might not be random. In effect, you’ve created a new pRNG which is a hybrid of two other pRNGs. The result of doing this is not known or tested. Don’t cross the streams! (A little homage to Harold Ramis, there.)

For your simulation, it might be very interesting to study whether switching random number generators changes your result in any significant way.

It is also good to start with different random seeds which are very far apart in the period of the pRNG. Don’t re-use any part of a sequence of random numbers for a comparison analysis. They are absolutely NOT random if you re-use them. They are very likely to give you the same result.

We had this discussion on the TWIST experiment where it was believed that our pRNG had a period of 10^9. Each simulation run used about this number of random numbers. 10^5 events were simulated with each requiring about 10^4 random numbers (if I’m remembering correctly). Someone proposed solving this problem by incrementing the seed by one step and generating up to 10^4 different simulation runs. The trouble here is that the number of random numbers is not fixed for each event. Each time an event started there was a 1 in 10^4 chance of starting on one of the same random seeds that was used in a previous run. From that point on, every event would be identical. When you start events 10^5 times, there is a good chance that you will hit a previous starting point. One can imagine strange attractors in the string of random numbers which would draw events to the same place (e.g. a string of zeros in the sequence which, if used for particle energies, would cause the current event to terminate in just a few steps.) Strange repellers might exist too. But in either case, one cannot say that the two sets of random numbers are uncorrelated. For TWIST, it turned out that we misunderstood the documentation on the pRNG. Someone had provided a list of “known good seeds” which were tested to 10^9 entries. I think that the pRNG was Mersenne Twister with its astronomical period. But it was a good point of discussion for this high statistics experiment.

Paul



On Feb 26, 2014, at 5:08 PM, Craig Wiegert <wiegert@physast.uga.edu> wrote:

This raises a question. In a simulation code, I might need to generate
random numbers for energies, particle displacements, and branch
conditions, all intermingled. Do I go to the same pRNG well for all of
my random number needs, or is it prudent to use different pRNGs (perhaps
the same algorithm but with different seeds) for each type of quantity?

- Craig