
From:  Paul Kienzle 
Subject:  Re: [OctDev] random numbers for distributed computations 
Date:  Mon, 11 Apr 2005 08:29:04 0400 
On Apr 11, 2005, at 6:42 AM, Michael Creel wrote:
On Monday 11 April 2005 11:57, Francesco Potorti` wrote:I have a question about this. If a RNG has a period of X, that means thatthere are X unique values that are generated, and then the sequence repeats.No, it means that the sequence repeats after X values are produced. The period length says nothing about the space of values. However, for goodgeneral purpose generators, the size of the space of values is much smaller than the period.OK, you're saying that a generator with period 5 could produce values like1 2 2 1 2 *** 1 2 2 1 2 *** 1 2 2 1 2 so the set of unique values is smaller than the period, correct?This may be, but for the moment my main question is whether the set of unique values that is generated depends upon the initial seed, or whether it's just the starting point in the sequence that depends on the initial seed. Couldthe unique values be 3 and 4, say, or will they always be 1 and 2?
You are correct that the generator is entirely deterministic and the numbers
will occur in the same order. As David says elsewhere, however, if thesequence is very long and you start each processor at a different part of the sequence then you should be okay (e.g., by including processor # in the
seed value).A better approach is to use independent sequences on each processor, which you can do by choosing different constants in your random number generator. There is some concern that any RNG which is simple enough that you can do
this will not have good statistical properties. You could try the parallel Mersenne Twister program (available from the main Mersenne Twister site): http://www.math.sci.hiroshimau.ac.jp/~mmat/MT/emt.html or the SPRNG scalable parallel random number generator: http://sprng.cs.fsu.edu/ I haven't tried either of these. Hope that helps,  Paul  Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html 
[Prev in Thread]  Current Thread  [Next in Thread] 