From: Tim C. <tc...@op...> - 2002-03-29 22:50:27
|
Johan Fredrik =D8hman wrote: >=20 > The first numbers in each of your three runs are 7.98493051529 , > 7.98525762558 and 7.98623776436. > They look like different numbers to me. >=20 > First, thanks for your answer Time. > I do agree, they are different. But I wouldn't call it random. I didn= 't expect > that the small difference in the initial seed would affect the first nu= mber with so little. > Usually the seed numbers I have experienced other places have much more > dramatic effect on the numbers, if you see what I mean... OK, you need to use Konrad Hinsen's excellent RNG module which comes with Numeric Python: ################################# # Python Virtual clock import RNG dist =3D RNG.NormalDistribution(10, 2) rng =3D RNG.CreateGenerator(0, dist) for i in range(1000000,10000000,1000000): print "Clock at time:" , i/1000000, ":", rng.ranf() ################################## The above code gives 8.46183655136, 7.29889782477 and 5.58243682462 as the first values in three successive runs on my system. Hope this helps, Tim C >=20 > If you want the difference > between initial values to be greater, you need to make the > difference in your seeds greater. For example, if I run your code now, = I > get 8.29225027561, 8.29484963417 and 8.29744851589, but setting the see= d > to (1,2) gives an initial value of 5.69397783279. Remember, these are > only pseudorandom numbers. >=20 > Yes, they are pseudorandom and that is OK. What I just want is some mo= re > initial difference between the runs without setting the seed number man= ually. > But know I know this is not a flaw in the RNG, but "its the way it is s= upposed to be" >=20 > Thanks >=20 > -- > Johan Fredrik Ohman >=20 > _______________________________________________ > Numpy-discussion mailing list > Num...@li... > https://lists.sourceforge.net/lists/listinfo/numpy-discussion |