Random Behavior

Like chaos, randomness can mean different things at different times. So, it's probably a good idea to supply formal definitions of several terms used here. These definitions apply to the experiments described in this section.

Deterministic: A system governed by mathematical equations with given initial conditions, whose state at any time can be calculated.

Entropy: In communication theory, a measure of uncertainty or randomness that is related to information. The greater the entropy, the greater the uncertainty, and the greater the amount of information capable of being transmitted. However, once received, information represents a decrease in uncertainty. The flip of a fair coin yields one bit of entropy with 0 or 1 representing heads or tails. A binary bit with equiprobability of a 0 or 1 is random. Also, the higher the probability of an event or a state, the lower the entropy. Back in 1948, Claude Shannon helped established the theoretical basis for the development of information and communication theory with his equation of entropy.

Pseudorandom: Referring to numbers that appear to be random (meaning they will pass numerous tests for randomness) but, sooner or later, will repeat. The longer the period between repeats, the greater the usefulness of the pseudorandom number generator (PRNG) for statistical experiments.

The remarkable Mersenne Twister PRNG has a repeat of (219937 - 1) which means that you can get a lot of very useful, non-repeating random numbers before all the galaxies disappear from view! Even so, the MTPRNG is not suitable for cryptography. However, the Blum-Blum-Shub PRNG is considered satisfactory for that purpose.

Quantum random: Random numbers produced as output from a device exhibiting quantum mechanical processes. For example, the emission intervals between photons produced by an LED is quantum random. Particle emission from decaying radioactive isotopes is also a quantum random phenomenon, as is the thermal noise generated by electronic components under power. QR is as random as random gets.

Random: Occurring non-deterministically with results based strictly on chance. It is virtually synonymous with stochastic.

Random number: A number produced randomly that is completely unpredictable. If the number is part of an output sequence of numbers, both the preceding and the following numbers are also unpredictable.

Random number generator: A physical process (e.g., flipping a coin or collecting data with a scintillation counter) that produces numbers displaying all the properties of true, random numbers. This is distinguished from a pseudorandom number generator that is deterministic. The random numbers obtained from programs and computed by internal calculations alone, no matter how good, are pseudorandom. However, if properly configured software is governed by an external random physical process, then the numbers generated could be truly random.

Random numbers find use in everything from Monte Carlo simulations to the production of cryptographic ciphers, etc. These ciphers, in turn, are vital for securing radio/telephone/Internet transmissions as required for banking, purchasing, and online transactions in general. Interestingly, chaotic phenomena also have been used to produce "random" numbers. Whether or not it's a good idea to use deterministically generated numbers in security applications is open to question.

There are several batteries of tests in use today intended to evaluate random numbers for randomness. These test suites include the very well-known DIEHARD tests developed by George Marsaglia, as well as the NIST test sequence. Many tests include chi-square evaluation of randomness. Another handy tool is called visual recurrence analysis (VRA). This is a fantastic and relatively new way to eyeball data while checking for randomness or chaos! Also, the fast fourier transform can be very useful in ferreting out information hiding in nonlinear dynamics data files. Some of these tests will be used in the experiments to follow.

I performed several computer experiments to look at various types of pseudorandom number generation. In one experiment, I used a very poor PRNG and compared that with a better one. Next, I examined a random number generator that operates by monitoring the true physical entropy generated by the computer on which it is running. Finally, I carried out an experiment using a Geiger counter as a source of quantum random numbers. All the pseudorandom and random numbers produced in these experiments were evaluated in several ways. These same methods will also be applied later on for examining chaotic phenomena. Most of the experiments in this section are qualitative. As such, they were not designed to pass/fail RNGs. They are intended to paint pictures of both randomness and chaos so that confusing the two will be a little less likely. Anyhow, here are my experiments arranged, of course, in random order.

A "good" deterministic pseudorandom number generator

Examples of fairly decent pseudorandom generators are those available from comprehensive mathematics packages that offer built-in, random number functions. In Mathematica, I generated a table of 32,400 random integers, ranging in value from 0 to 255, using the following command:

randomX = Table[Random[Integer, {0, 255}], {32400}];

There are various options in plotting the pseudorandom numbers so that they appear to fill space. In turn, these plots will permit visual inspection for randomness, especially if the plots can be fully rotated. I divided the table of 32,400 numbers into sequential groups of three numbers per grouping. Instead of plotting points, I used small cubes. Also, I generated smaller tables by repeatedly skipping over fixed numbers of triplets in order to create a plot with fewer cubeoids. In this fashion, I could decimate a large space array of values to create a relatively uncluttered plot.

Usually, the triplets are plotted as x, y, z coordinates of a point (or cuboid, in this case) in orthogonal space. However, Clifford Pickover (Computers and the Imagination) discusses a system of converting standard Cartesian coordinates into spherical coordinates to produce a "noise-sphere." Pickover feels that plotting random data in this fashion is capable of sensitively displaying deviations from true randomness. I adopted his method in creating several of the plots seen on this page.

(The programming was in straight Mathematica code, but the animated plots were produced using an add-on package called nVIZ X, which is a visualization tool for dynamic phenomena.)

In addition, I converted a version of the original data to a scale of musical intervals using the following Mathematica command:

randWavOut=Scale[randomXtract, 440, 100] // Show

This code produces a scale with a base of 440 Hz. It assumes that randomXtract is a list of intervals. The number "100" represents the total duration of the scale in seconds. Obtained through trial and error, the duration value is chosen to be long enough to prevent the scale from sounding like jumbled noise.The data so produced was saved as a .wav file. You can listen to it by clicking the control seen beneath the plot. I think you'll agree that aural evaluation can readily detect and reveal different degrees of pseudorandomness. Later on, the sound of nonlinearity will serve as a useful adjunct for helping detect chaos.

(You will need a fairly recent QuickTime plug-in to hear the sound. Even so, it's possible that some browsers, especially the older ones, may not support the method employed for audio playback. I certainly hope it works for the great majority of visitors. Please let me know.)

A "not-so-good" deterministic pseudorandom number generator

An example of a really bad pseudorandom number generator, referred to by Pickover, is easily reproduced by the following Mathematica code:

randomY = Table[Mod[(137x + 187), 256], {x, 0, 32399}];

Later, when rotating plots of periodic attractors are presented, the similarity between the plot seen here and those plots will stand out. Here, not only does the eye unmistakably discern the less-than-random nature of the PRNG, but the ear can easily detect the disparity as well.

Incidentally, when the graph was drawn using an x,y,z Cartesian coordinate system, there were two linear pipe-like structures, and a hint of a third pipe, seen crossing the 3D volume, running parallel to each other. If you would like to see this for yourself, be sure to create a table from the above equation and plot away!

A true random number generator in software

The company (Comscire) that markets the program that produced the random numbers plotted at right claims that its software's output passes all the major test suites. The plot is a composite of the Pickover spherical coordinate technique (displayed as an orange sphere) as well as the Cartesian coordinate technique (seen as a scattering of orange-yellow pixel dust). The program was used to generate a file of 25,000 four-byte numbers. The file was then imported into Mathematica and stored as a list. The read-in numbers were collected into groups of three, as usual, to produce this plot of 8,333 large orange points. If I had generated many more points, the sphere would have been smoother. This smoothness indicates a really good random distribution. Next, the file was replotted using orthogonal axes in a yellowish color in the same region as the sphere.

The program monitors the rms cycle-to-cycle clock jitter associated with the CPU's core clock. It involves the phase lock loop frequency multiplier, which is influenced by thermal and shot noise. (That being so, there undoubtedly is an element of quantum randomness in the numbers generated.) The software makes use of Shannon's entropy equation for the generation of random numbers. (Please check the References section for further information.)

Finally, the original data was used to produce a .wav file for your musical entertainment!

A quantum random number generator

Imagine that you have one microgram of 226Ra sitting on your desk. The sample contains about 2.67 x 1015 atoms of radium with an approximate half-life of 1620 years. Single out any one atom. The probability of decay (the decay constant) for that atom is approximately 1.36 x 10-11 s-1. It's a given that a fair coin can be tossed once or even 10,000 times with absolutely no guarantee that heads (or tails) will appear on the toss. And so it is with the selected radium atom. It may decay (let's call this a success) at the exact moment of selection, or it may not decay for millions of years—if ever. However, over a period of 1620 years, the microgram sample will be pared down to roughly half a microgram. Even with its very low probability of decay, approximately 37,000 radium atoms are disintegrating (forming gaseous radon) each second in the sample, at least for a while. As you would expect, that disintegration rate steadily decreases as the total number of radium atoms diminishes. Statistically speaking, a large population (nearly three quadrillion atoms) coupled with a small probability of success implies that a Poisson distribution may be applicable. Poisson distributions describe the probabilities of random events. Sure enough, when randomly occurring radioactive decay is monitored with a suitable detector, the detected particles exhibit a Poisson distribution.

The standard counting statistics experiment to check this out is to use a Geiger counter and measure the radiation (count the clicks) for a large number of equal intervals (bins). A histogram is produced and is usually compared side-by-side to one produced by solving and plotting the Poisson distribution equation. For very large counts, the histogram closely resembles a normal distribution. However, here I am interested only in the generation of random numbers.

For this experiment, I employed a commercially available computer-controlled Geiger counter along with its controlling software. The software enables one to generate random numbers and to determine time intervals between counts to the nearest microsecond. If the random number feature is selected, a random number is generated whenever an ionizing particle is detected. This decay event triggers an interrupt that forces the software to interrogate the CPU clock counter. The least significant byte of the clock counter value is then converted into a random number.

I used a very small sample of a radium salt to activate the Geiger counter. After each ionizing particle detection, a Geiger counter experiences a dead time during which it will not respond to radiation. Placing the radiation source too close to the counter allows too many alpha and beta particles or gamma rays to enter the GM tube during its dead time (roughly 90 microseconds with the counter I used). This situation, in turn, reduces the total number of events that can be detected. Placing the sample further away reduces the problem but at the cost of prolonging the count time.

So, with detector and source suitably arranged, I ran the Geiger counter and software for several hours until more than 17,400 random numbers were produced and stored on disk. These numbers were then plotted using Cartesian coordinates, and a very good picture of randomness emerged. Finally, using Mathematica, I converted the data obtained from measuring the intervals between ionization events into a .wav file that simulates the random clicking of a Geiger counter.

(You have just heard the sound of radium atoms randomly disintegrating. If you would like to see this, too, please be sure to visit the section on Radioluminescence and the spinthariscope before leaving the Views From Science Web site today.)

Fast Fourier transform (FFT)

Another tool that is useful for examining the data distributions produced in these experiments is the fast Fourier transform. This well-known technique is very handy for visualizing the power spectra of signals and is often called upon by researchers working in image processing and signal analysis. Fortunately, with Mathematica, it is an easy calculation to perform. Here is a typical example of a command used to produce the FFTs that follow:

ListPlot[Abs[Fourier[randomX]], PlotRange -> {{10, 32400}, {0, 10000}}, PlotJoined -> True, Frame->True, PlotStyle -> RGBColor[1, 0, 0]];

I read in the data files created by all of the above generators and produced the following four graphs (displayed in reversed colors):

Bad PRNG

Good PRNG

True RNG in Software

Quantum RNG

The only graph that displays an interesting spectrum is that produced by the bad pseudorandom number generator. But, as interesting as it may be, the spectrum clearly flags the generator as a very poor random number source.The other graphs display noisy or random spectra, reminiscent of the background white noise or hiss produced by audio amplifiers.

Visual recurrence analysis (VRA)

Because VRA is really a tool for seeking out chaos, I will postpone until later an in-depth discussion of this great technique. For now, suffice it to say that critical functions, such as embedding dimensions, correlation dimensions, and lag, can be sought for and used to enable detection of chaos in data files. The commercial software package I used to generate the images (see References) permits the user to magnify the displayed image. This offers a look in greater detail for patterns that are at the heart of the technique. To get a taste of that, just pass the Magic Magnifying Mouse pointer over each of the image captions below.

Bad PRNG

Good PRNG

True RNG in Software

Quantum RNG

Not surprisingly, the only generator that produces a distinct pattern is the bad PRNG. The others display random patterns that are to be expected of good random distributions. The existence of a clearly defined pattern, as shown in that first image, is characteristic of distributions that may contain chaotic data. However, in this case, we are looking at the fingerprint of a limit cycle or periodic attractor. This type of attractor is similar in principle to the periodic, oscillating pendulum described earlier.

After this brief excursion into randomness, it's time for me to get back to work on chaos proper. Of course, there are many other physical processes that could mask, imitate, or affect nonlinear dynamics experiments. Processes, such as the random behavior of colored noise (pink, blue, purple, brown, etc.) or the localization and bunching of random points in space, need further exploration. But this will have to wait.

At the core of chaos reside the attractors. They represent the magnets that draw dynamical systems into equilibrium. The closer you get to them, the stronger the pull. That's up next.

 

Views From Science ©2006-2008
7