help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] random number sequence


From: Sergey Mkrtchyan
Subject: Re: [Help-gsl] random number sequence
Date: Tue, 20 May 2008 10:54:04 -0400
User-agent: KMail/1.9.6 (enterprise 20070904.708012)

On Monday 19 May 2008 07:51:22 pm ddneilson wrote:
>  You're over-thinking the problem a tad. Seeding the random number
> generator via the loop counter from your cluster-submit script is just
> as random as anything else that you might come up with; as long as each
> program has a different seed, then they'll each use a different sequence
> of random numbers. seed(rand()) may feel more random, but you still have
> to come up with an initial seed or else you're just going to end up with
> the same random sequence in each program.
>
>  Alternatively, if you don't mind throwing the ability to duplicate your
> results exactly, you can always seed with the results from `date +%N` --
> which will output the number of nanoseconds since the last second. i.e.
> you can make the line that runs your program, in your script, into
> "./myprogram `date +%N`"  (those quotes around the date call are the
> forward quote on the same key as tilde [~]) and seed from the first arg
> of your program.
>
> -Daniel

Yes, indeed, I was thinking of putting something other than just an ordinary 
loop parameter as a seed (indeed, it "feels" more random to put rand() 
there), but I agree it doesn't change anything. 

The idea with microseconds is really nice, but I think being able to reproduce 
data is a very nice thing I haven't thought about :-)

Thanks.

Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]