Peculiar pattern found in 'random' prime numbers
nature.com
nature.com
The normal distribution is
1: 24.9940%
3: 25.0128%
7: 25.0100%
9: 24.9832%
The distribution following a prime ending in 1: 1: 17.0448%
3: 31.0789%
7: 32.1018%
9: 19.7745%
Source: https://gist.github.com/kbadk/71bbb57c9be0d66de156> “Every single person we’ve told this ends up writing their own computer program to check it for themselves,” says Kannan Soundararajan, a mathematician at Stanford University in California, who reported the discovery with his colleague Robert Lemke Oliver
In the 60's Scientific American had an interesting article about a curious pattern in primes. If you start on a grid and fill in the integers in a spiral there are obvious patterns of connected primes. I had to try it of course, on grid paper by hand up to a couple of hundred.
Though these patterns are pretty noisy still.
More discussion at https://news.ycombinator.com/item?id=11282480
https://en.m.wikipedia.org/wiki/Algorithmically_random_seque...
$ wc -c primes.coffee
110 primes.coffee
$ cat primes.coffee
ps=[n=2]
until ps.join(',').length>110
n++
ps.push n unless ps.some (p)->not(n%p)
console.log ps.join ','
$ coffee primes.coffee | wc -c
115
$ coffee primes.coffee
2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151It was finally in the correspondence of Pascal and Fermat in 1654 that a mathematics for probability started to emerge. With the emergence of the laws of large numbers, this mathematics could be linked to observable real-world occurrence rates. (Ian Hacking's book "The Emergence of Probability" is a standard reference, http://www.jstor.org/stable/2184357?seq=1#page_scan_tab_cont...)
Suppose you were confronted with a stream of random numbers, and no intellectual or mathematical framework for quantifying them. Just coming up with a notion of a frequency curve (i.e., a density), and statistical independence of "unlinked" events would be a huge leap.
I used to TA an undergrad probability class, and in the first weeks, I'd ask the students to quantify some random variable, and they'd sometimes blankly look back and say, "it's just random" -- what we taught them is how you break that down in terms of the familiar quantities (densities, independence, correlations) and operations (multiplying for independence, integrating for expectation, integrating and renormalizing for conditioning).
So to get back to your original question, even a deterministic sequence, like
0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, ...
could be regarded as random, and given a density and all the other folderol. And a "completely random" sequence of 0/1 equiprobable bits also has a density, etc. And so does everything in between.By saying "this is a random sequence," you enable a statistical view of the problem. Even for purely deterministic sequences, this can be useful.
Last question, something I've never been perfectly clear on, what is the difference between "random" and "stochastic"? My understanding is that a stochastic model is a model featuring stochastic variables, which are variables that draw from some random distribution. Is the terminology I am using correct?
You would talk of a "random variable" (loosely, a quantity that exhibits random behavior, although there is a technical definition that is more precise and has a different flavor), not a "stochastic variable".
Sometimes, you would talk about a "stochastic matrix" (which is actually deterministic, an example of a namespace clash), because a "random matrix" would indeed be random be filled with "random variables".
But, you would often talk about a "stochastic process" like Brownian motion. Although you can also say "random process", and that's the same thing.
You would not talk about a "random distribution", that sounds like you mean "arbitrary distribution" (as in, "I picked out some random socks today"). But you don't mean arbitrary, you mean a "statistical distribution" or "probability distribution".
To get all this right, you have to live in that world, you can't just visit. If an outsider could just speak the language using clear rules, there would be no point in all those advanced classes, right? ;-)
The possibility, however remote, exists that you will randomly select a sequence with patterns and order. In cryptography, we define the term 'pseudorandom' in order to discuss a class of functions that look random. Pseudorandom sequences are sequences where, given the first n bytes of the sequence, an adversary cannot guess the n+1th byte with probability significantly higher than 1/2. Basically, it's important to distinguish between blindly selecting a sequence out of all possible sequences, and finding a particular sequence with no discernible internal order.
A "random number" in the lay sense is a "random number from a uniform probability distribution"; a uniform distribution being one where each element is equally likely.
You might note there are still patterns in uniform distributions. e.g. Uniformly random integers are never not integers, and they also fit within a particular range: we have no way to pick random numbers uniformly between -infinity and infinity.
I thought a sort of general definition of patterns was the existence of correlation from one state to another, while the definition of randomness was the lack of the same correlation. So I'm wondering how random numbers can have patterns? It's possible my view of "random numbers" and "patterns" is not sufficiently nuanced.
I have no idea what your comment means in this context.
Of course you know that random numbers will have a distribution. I think this is an example of that. Most people would have expected a uniform distribution here but it isn't the case.
By "probability density", I mean that the probability of a number around n being prime are about 1/ln(n) -- see the Prime Number Theorem[1] for more -- but of course any given integer is either prime or not.