DPRG
DPRG List  



DPRG: Sbasic , gambling , and probability

Subject: DPRG: Sbasic , gambling , and probability
From: Kevin Ross kevinro at nwlink.com
Date: Sun Jan 11 23:28:09 CST 1998

>For truly random numbers (as opposed to psudo-random numbers that a
>computer can generate,) you could have an antenna or a microphone and an
>op-amp amplifying the signal and a D/A measuring the white noise, and
>use the number as your random number or as part of the seed to your
>random number generator. (Assuming you sample randomly and there are no
>strong signals nearby.)


Gather white noise seems like a great idea, except it doesn't work very well
in most digital circuits. You have to be extremely careful to shield regular
electrical pulses, like the CPU clock, the rotation of the motors, the
frequency of shaft encoders, and a host of others. Because of the nature of
what is hanging off a robot (all sorts of things with mechanical
revolutions, digital clocks, modulated IR frequencies), the white noise
sampling is prone to not be very random. You will also find that your
computer monitor is an excellent source of regularly timed pulses.

Even using random sound can be a problem on a robot, because its own
movement will cause a regular interval of sound. You also might find that
when the robot moves, people start to talk, cheer, and applaud, causing your
random number generator to fail miserably.

These techniques could be useful for generating the initial seed value for a
rand() function. You also might find that just having a button you have to
push on the robot before the generator is seeded would work well also.
Capture the time of the manual user input. You should get a pretty random
seed to start with.

Kevin

------------------------------

More information about the DPRG mailing list