I am developing an intentionally simple probabilistic model of primes with the aim of modelling experimentally measured prime gaps.
Question: My simple model has the right shape, and broadly has the right magnitudes - my questions is, how can it be improved? Is there a flaw in my logic?
Note: I have been inspired by an answer to this question (but I didn't understand it totally): Distribution of prime gaps - is it an unsolved problem?
Step 1
The Prime Number Theorem (PNT) tell us that primes occur with a density of $1/\log(x)$ in the neighbourhood of $x$, and this is increasingly true for larger $x$. We can interpret this as a probability of $n$ being prime.
$$P(n) = \frac{1}{\log(n)}$$
The probability that a number is not prime is:
$$P'(n) = \left ( 1 - \frac{1}{\log(n)} \right )$$
Step 2
A prime gap of length 2 means we have a sequence (prime, not prime, prime). Similarly a prime gap of length 4 means a sequence (prime, not prime, not prime, not prime, prime). A prime gap of length $g$ at $n$ would require a sequence (prime, g-1 not primes, prime) and so a probability:
$$ P_{gap}(g) = P(n) \cdot P'(n+1)\cdot P'(n+1) \ldots P'(n+g-2) \cdot P'(n+g-1) \cdot P(n+g) $$
Step 3
For large $x$, we can approximate $\ln(x+g) \approx \ln(x)$, because most $g$ will be much smaller than $x$. This simplifies the probability of a prime gap to
$$ \begin{align} P_{gap}(g) &\approx \frac{1}{\log(n)} \cdot \left (1-\frac{1}{\log(n)} \right )^{g-1} \cdot \frac{1}{\log(n)} \\ \\ &= \left (1-\frac{1}{\log(n)} \right )^{g-1} \cdot \frac{1}{\log^2(n)} \end{align}$$
Step 4
Again, being approximate, the number of gaps of size $g$ in a number range of length $N$ is $N\cdot P_{gap}(g)$.
Taking logs we have:
$$ \ln\left( N\cdot P_{gap}(g) \right) = (g-1) \cdot \ln \left (1-\frac{1}{\ln(n)} \right ) + \ln ( \frac{1}{\ln^2(n)}) +\ln(N)) $$
This is a linear function of $g$ of the form $Ag+B$. with a negative gradient because $(1-\frac{1}{\ln(n)} )$ is less than 1, so its logarithm is less than 0.
The following compares this function with $n=500,000,000$ with experimentally determined counts of prime gaps in the range 1 to 500,000,000.
The simple model is linear, and has a negative gradient - this is good. The simple model has the right order of magnitude - good. But how can the discrepancy be improved.
Notes
I have intentionally avoided the refinements which adjust the simple model to take into account that even numbers are never prime. I don't feel it makes a difference over larger scales. Am I wrong?
I am aware that some model try to correct for the assumption that selecting a series of numbers, their probability of being prime is not independent. Would this make a difference? How would I do it?
I would appreciate replies suitable for an audience not trained to university level mathematics.