[Numpy-discussion] Right behavior

Johan Fredrik Øhman johanfo at ohman.no
Fri Mar 29 12:03:06 CST 2002


This code generates very non-random numbers, even when the seed value is reinitialized.
Take a look at the first number in each run !

Is this right ?

--
JFØ


#!/usr/local/bin/python2.1

# Python Virtual clock
import RandomArray

print "Seed", RandomArray.get_seed()
for i in range(1000000,10000000,1000000):
        print "Clock at time:" , i/1000000, ":", RandomArray.normal(10,2)


[root at blekkulf /root]# ./t2.py 
Seed (101743, 1951)
Clock at time: 1 : 7.98493051529
Clock at time: 2 : 10.8439420462
Clock at time: 3 : 7.59234881401
Clock at time: 4 : 7.32021093369
Clock at time: 5 : 10.9444898367
Clock at time: 6 : 10.1128772199
Clock at time: 7 : 13.1178274155
Clock at time: 8 : 11.779414773
Clock at time: 9 : 10.7529922128
[root at blekkulf /root]# ./t2.py 
Seed (101743, 1953)
Clock at time: 1 : 7.98525762558
Clock at time: 2 : 9.38142818213
Clock at time: 3 : 7.11979293823
Clock at time: 4 : 10.867649436
Clock at time: 5 : 9.62882992625
Clock at time: 6 : 12.1940765381
Clock at time: 7 : 6.84895467758
Clock at time: 8 : 8.13472533226
Clock at time: 9 : 8.15638375282
[root at blekkulf /root]# ./t2.py 
Seed (101743, 1959)
Clock at time: 1 : 7.98623776436
Clock at time: 2 : 14.5040078163
Clock at time: 3 : 11.3408681154
Clock at time: 4 : 6.32757425308
Clock at time: 5 : 8.94617521763
Clock at time: 6 : 12.1802353859
Clock at time: 7 : 12.0685124397
Clock at time: 8 : 10.5330892205
Clock at time: 9 : 10.9744755626
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20020329/fa9e1247/attachment.html 


More information about the Numpy-discussion mailing list