in reply to Re: random question
in thread random question

Excellent points. I’ll add one more observation:

The call to time() is presumably there to add entropy (randomness). But time returns the number of seconds since the epoch; and for a run of 101 values, the script completes in less than a second, so time() returns at most two different values! This adds almost nothing to the randomness of the result.

I’m no mathematician, but I’d be surprised if the output of the algorithm being tried (when properly debugged) is any more “random” than Perl’s out-of-the-box equivalent:

print int(rand(1e4)), "\n" for 0 .. 100;

(Note that the first call to rand implicitly calls srand here.)

Athanasius <°(((><contra mundum Iustus alius egestas vitae, eros Piratica,

Replies are listed 'Best First'.
Re^3: random question
by perlaintdead (Scribe) on Sep 08, 2013 at 10:59 UTC

    The invocation of time() was just a stand in for something with more entropy. I really wasn't worried about that until i debuged it.