RANDOM NUMBER GENERATORS
Jeffery A. Cavallaro
jeff at ISI-VAXA.ARPA
Wed Oct 2 07:11:04 AEST 1985
(I have never really worked on an application that required the use of a
random number generator. In addition, I know little about random number
generation theory. Thus, the following questions may seem a little
elementary to some out there...)
Upon playing with (s)random(3), I noticed that the same seed produces the
same sequence. I guess this is what is meant by "pseudo-random". The
following points struck me:
1. What good is a random number generator when you have to generate a
random seed to begin with.
Now, I realize that the seed generation is usually off of system time, or
PIDs, or some such constantly increasing number, but this seems to lead
to a dilemma:
2. Numbers such as PIDs repeat relatively frequently, especially on machines
that tend to reboot. In the case of a "server-type" process, it may
not vary at all.
3. Numbers such as system-time, which theoretically NEVER repeat may
never regenerate the same sequence.
Now, if one wants to try and simulate reality, such as the shuffling of
a card deck, what is one to do. PIDs will repeat to often, whereas system
time may not repeat at all. Not repeating at all may or may not be
appropriate for various physical simulations.
Are (1), (2), and (3) wrong, am I totally out to lunch, do I have a point,
are there any good references???
Jeff
More information about the Comp.unix.wizards
mailing list