[Numpy-discussion] Numarray: question on RandomArray2.seed(x=0, y=0) system clock default and possible bug

Chris Barker Chris.Barker at noaa.gov
Wed Jul 24 10:01:06 CDT 2002


Just to add my $.02:

I disagree with Eric about what the default behaviour should be. Every
programming language/environment I have ever used uses some kind of
"random" seed by default. When I want reproducible results (which I
often do for testing) I can specify a seed. I find the the most useful
behaviour. As Eric points out, it is not trivial to generate a "random"
seed (from the time, or whatever), so it doesn't make sense to burdon
the nieve user with this chore.

Therefore, I strongly support keeping the default behaviour of a
"random" seed.

Eric Maryniak wrote:
> then I'd urge at least to use a better initial seed.
> In certain applications, e.g. generating session id's in crypto programs,
> non-predictability of initial seeds is crucial. But if you have a look
> at GPG's or OpenSSL's source for a PRNG (especially for Windows), it looks
> like an art in itself. So perhaps RNG's 'clock code' should replace
> RandomArray2's: it uses microseconds (in gettimeofday), too, and thus will
> not have the 1-second problem.

This I agree with: a better default initial seed would be great. As
someone said, "show me the code!". I don't imagine anyone would object
to improving this.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Numpy-discussion mailing list