|
From: Daniel J S. <dan...@ie...> - 2006-05-12 06:59:03
|
Daniel J Sebald wrote: > No, the seed and what the PRNG return are two different things. My > issue is that, yes, the gnuplot PRNG is replacing the state of the PRNG > but then it immediately generates a random number that *can't be used*. > Is that how C64 and IBM BASIC worked? I.e., I just looked up BASIC (if this is different from IBM BASIC, I'm not sure): http://www.leinweb.com/basic/manual/man1/rnd.func.htm http://msdn2.microsoft.com/en-us/library/f7s023d2.aspx Which has the ability to set the seed using randomize: http://www.leinweb.com/basic/manual/man1/randomize.stmt.htm http://msdn2.microsoft.com/en-us/library/8zedbtdt.aspx So BASIC is a case where one can set the seed with randomiz() and not draw a sample immediately. Similar to Octave. Similar to C. But looking closer at the "rnd" routine of BASIC, oddly there is also a way to set the seed using the single argument. (Did this "randomize" come later or something?) So BASIC does this < 0, > 0, = 0 skullduggery as well. But it isn't exactly the same as gnuplot. For < 0, BASIC generates a value from the seed. (But it says nothing about advancing the generator.) For > 0, the result is next pseudo r.n. in sequence. For = 0, the result is the most recently generated value. (Again, it says nothing about advancing the generator.) So what happens in BASIC with rnd(-1) rnd(0) rnd(0) ? Same value for first two uses of rnd(), then a different value for the third use of rnd()? Well, is gnuplot in the tradition of BASIC? Sort of. I'd bow to someone knowledgable in PRNG who could say gnuplot should behave as such and explain why, but I don't see the consistency with most conventional PRNGs on the matter. I don't know. Put me in the unset seed set seed # set seed #,# show seed camp, for what it's worth. Dan |