[Numpy-discussion] random number generation in python compared to gsl
Giovanni Samaey
giovanni.samaey@cs.kuleuven...
Thu Nov 6 13:25:58 CST 2008
Dear Robert,
indeed, this is the difference ! Thanks ! Seeding numpy with 4357
gives identical sequences...
Giovanni
On 05 Nov 2008, at 19:01, Robert Kern wrote:
> On Wed, Nov 5, 2008 at 08:05, Giovanni Samaey
> <giovanni.samaey@cs.kuleuven.be> wrote:
>>>
>>> Hi,
>>> 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
> identical.
>
> --
> 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
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
More information about the Numpy-discussion
mailing list