More on the Random Number Generator

You may question the need for random numbers. True random numbers are useful for data encryption (cryptography), statistical mechanics, probability, gaming, neural networks and disorder systems, to name a few.

Random numbers generate by a computer are notoriously random in an exact defined- pattern. So much so that they are many times referred to as pseudo-random numbers. The random numbers generated by the random number generator are truly random.

The way the random number generator operates is simple to understand. However, it’s fundamental function is best describe using an mechanical analogy. Imagine a sequence of numbers is painted on the outer edge of a revolving wheel. There is a pointer on the outside of the wheel that points to the number at the top of the wheel. The wheel is set into motion, spinning very rapidly. Then at any given “random” moment in time the wheel is instantly stopped, and the number under the pointer becomes our random number. Once read, the wheel is set back into motion.

The electronics follow pretty close to the mechanically analog. The microcontroller spins the sequence of numbers internally. The random point in time when the sequence of numbers is instantly stopped is generated by the detection of a radioactive particle by the geiger counter. Background radiation is an ideal quantum mechanical random time-delay generator because it is impossible to predict with any accuracy the exact moment a radioactive particle will be detected. When a particle is detected a positive pulse is sent to the TTL output. This positive pulse generates an interrupt in the microcontroller that stops the numbers from spinning. The number is read, displayed and sent out serially on the TTL port.

Robotic Arm Interface

We determine how many numbers are painted on the wheel by setting the jumpers on the front of the PC board, see figure 11. You have the option of generating random numbers in the range of: 1-2, 1-10, 1-255 and 1-65535. The display of the random number generator is shown in figure 14.

Robotic Arm Interface

The random number generated that is displayed on the LCD as shown in figure 14, is also sent out serially on the TTL output on the back on the pcb. Serial communication specifications are: 9600 baud, 8N1 . The output consists of two bytes, low byte first then high byte. See figure 12 for the TTL output.

Robotic Arm Interface

The Random Number Generator will generate approximately 30 random numbers per minute depending upon the natural background radiation in your locality. There are a number of web sites that contain information on random numbers, you can search Yahoo or Google engines. One site I found has a test program that will read a file of random numbers and analyze the randomness of the numbers in the file. See: http://www.fourmilab.ch/random/

I have not placed the numbers generated into a file and used this program, however there is a simple test one may perform. If you add all the random numbers that are generate (let’s call this number N) and divide by that number of samples you added together (Let’s call this number S) the answer should be approximately 50% of your number range (Lets call this number R).

For example using a range of 1 – 10, so R = 10. The number of random number samples, is 100, so S = 100. We add those 100 random numbers together, that equals N. So N/S = .5 R In this case the number N when divided by S (100) should equal approximately 5. This would show an even distribution of random numbers though out the range of 1 - 10.

Next Page