random number generator followup

random number generator followup

Post by Mike Matthe » Sun, 30 Dec 1990 11:24:21

Wow!  Talk about fast NetService!

The answer was, of course, obvious.  Dave Fetrow suggested I use the pid of

a gettimefday call (which I haven't gotten to work yet, but it's a neato idea).

I have the crontab.local file run my script every minute now, and I haven't
heard a repeat yet.  It isn't truly random, with only using the pid as the
seed; it's a series, sort of -- the numbers increment by five in this case,
wrapping around of course.  This is fine with me, since the total number of
sounds I have for this cause (ahem) is not a multiple of five.

If any NeXT user is interested in the stuff, I'll Email the code to them.

I'm sure my office mates will kill me, too... :->



1. Random Number generator not Random *****


        I am using random()&01 to get a binary random
number. Turns out if I generate more than 50 numbers,
the last 30 or more are all 1s or 0s, i.e., my random
number generator is not random!

        Worse, if I generate 500 numbers, 497 are 1s.
The fraction of consistent numbers increases as the number
of trials increases.

        Any clues? Anybody got a pointer to an FAQ where
I can get a random number generator that is random?

Thanks in advance,


2. BSD-UNIX to DOS port

3. Random Number Generator

4. Merging Files

5. Random Number generator..

6. Automated mail handling - how to do it

7. Random Number Generators

8. Runlevels

9. Random number generator

10. Parallel Random Number Generator

11. random number generator

12. Help with Random Number Generator

13. random number generator