[Numpy-discussion] random number generation in python compared to gsl
Thu Nov 6 13:25:58 CST 2008
indeed, this is the difference ! Thanks ! Seeding numpy with 4357
gives identical sequences...
On 05 Nov 2008, at 19:01, Robert Kern wrote:
> On Wed, Nov 5, 2008 at 08:05, Giovanni Samaey
> <firstname.lastname@example.org> wrote:
>>> how about other seed values ? I thought seed=0, is (often) used to
>>> mean a "random", i.e. current time or alike, seed value ... !?
>> Not in this case: I always get the same sequence with seed=0
>> (different for both implementation, but the same each time I run it.)
>> I got around it by installing pygsl and taking random numbers from
>> there instead of from numpy.
>> But I still find it strange to get two different sequences from two
>> implementation that claim to be the same algorithm...
> GSL has this bit of code:
> if (s == 0)
> s = 4357; /* the default seed is 4357 */
> We don't. Otherwise, I believe the two seeding algorithms are
> Robert Kern
> "I have come to believe that the whole world is an enigma, a harmless
> enigma that is made terrible by our own mad attempt to interpret it as
> though it had an underlying truth."
> -- Umberto Eco
> Numpy-discussion mailing list
More information about the Numpy-discussion