In this post we continue to look at the gaps between primes, and introduce the idea of using probabilistic models for primes.
The video for this topic is here (youtube), and accompanying slides are here (pdf).
Probabilistic models of primes, despite being built on rather broad simplifications, can match numerical evidence fairly well. Predictions from some of these models can become worthy conjectures about the primes.
Here we build a particularly simple probabilistic model, and use it to predict the distribution of prime gaps.
Probability of a Prime
The Prime Number Theorem tells us the density of primes around
Prime Gaps
A prime gap at
For
We can generalise this to prime gaps of size
Prime Gap Counts
Now we know the probability of a gap of size
Using another approximation that for most n between 1 and
We can take the logarithm of this count to give us a linear function of the gap size
Plotting a graph of the logarithm of the counts for each prime gap
The following plot shows this probabilistic model works surprisingly well given the simplifications we made.
Improved Model
Our simple model has many imperfections, and a significant one is that it doesn't take into account that every other number in a given range, the even numbers, are never prime.
If we want to assert that the probability of an odd number being prime is zero, but also preserve the density of primes being
The probability of a prime gap of size
The following plot shows that for smaller gaps this model is indeed an improvement. Modelling the behaviour of larger gaps requires more sophisticated models.
What Have We Learned?
It is useful to compare any probabilistic model with a naive one. Here we can compare our probabilistic primes model to coin tosses. The following compares the predicted prime gaps amongst the first
A linear log-count of sequences isn't unique, in fact it is common for chains of independent events.What we can say is:
- the correct order of magnitude for predicted prime gaps suggests the
probability is about right. - the primes appear fairly randomly as if they were independent events.
You can explore this graph yourself online (link).
Animated Prime Gaps
As a fun aside, the following animates the prime gaps as
Further Reading
Harald Cramér, in the 1930s, developed his probabilistic model for primes and used it to develop conjectures about the primes. His 1936 paper is considered to have kicked off the field: