Sunday, June 8, 2008

Chaos in Prime Numbers

About a year ago I sat in on a seminar by Dr. Boris Kupershmidt on the topic of prime numbers. I'm not a mathematician and therefore most of what he said went right over my head. He did say something, however, that caught my attention: "The distribution of prime numbers is chaotic." If I remember right he was referring to "small" prime numbers. Of course in number theory 10^16 is "small." I had previously taken a course in nonlinear systems and had studied chaos. Mathematical chaos has a very interesting and subtle structure; there is order in chaos. My post entitled A Mathematical Perspective of Global Warming talked about chaos in the weather. Anyway, I am enthralled with chaos to the point that I see strange attractors everywhere. Every time I see a flag blowing in the wind I see a strange attractor. My work in hydrodynamic instability deals with turbulence and turbulence is very closely related to chaos so I get a personal satisfaction of coupling my work with my perspective of nature. I digress. I decided to see for myself if by "chaotic" he meant chaotic in the mathematical sense or chaotic in the nonmathematical vernacular.

I read a book by James Gleick called Chaos: Making a New ScienceISBN 0-140-09250-1. In it he discussed a group from the University of California at Santa Cruz called the Dynamical Systems Collective. They devised an experiment to find attractors in water dripping from a faucet. They saw that in general, the water dripped at a steady rate. If the faucet was disturbed they could force the drips to fall in groups. In order to visualize the attractor they plotted the time between one drip verses the time for the next. The plots showed "blobs" centered around two points for pairs of drips, three points for 3 drips and so forth. I got the idea to plot prime numbers in the same way: the "distance" on a number line between one appearance of a prime and the next. Low and behold some very interesting patterns emerged!

The first plot shows the result for the first 100000 primes. Many points actually plot on top of each other. The more points you plot the more complete the graph becomes and the farther it extends in both the x and y directions. However, this is extremely slow since so many plot directly on top of each other.

My next idea was to take the second difference and plotting it against the first difference

I took the 3rd difference and plotted it against the 2nd difference

Beyond that, the pattern wasn't much different and the shape of the envelope only changed slightly.

As far as predicting prime numbers, I can't really comment on these results other than they seem to give an envelope in which many primes clearly fall and inside the envelope comes organized patterns so that one would not (so) blindly test for primes. As far as theory goes, I'm not worthy enough to even try. The most recent developments in Riemann's Conjecture and computational experiments in prime numbers suggest that this is likely to have been an exercise in futility. That's why I figured it was safe to post this to a blog rather than somewhere in the mathematical community. Either way, if somebody does find this important, I would appreciate some credit!

And now a deep thought…

Is our definition of mathematics universal?

2 comments:

jbatters said...

There's been some confusion as to how I actually plotted the data. Here's a couple bits of code to explain.

pnum is an array of prime numbers

diff is the matlab command to create an array of the difference between consecutive numbers

d1=diff(pnum);
d2=diff(d1);
d3=diff(d2);

scatter plots two vectors as X,Y coordinates

scatter(d1(1:n-2),d1(2:n-1),'.r')
scatter(d1(1:n-2),d2,'.b')
scatter(d2(1:n-3),d3,'.g')

Unknown said...

I don't know if you still update this blog but I was wondering if the pattern continued as an obtuse triangle and if you could post more graphs.