
Peculiar pattern found in 'random' prime numbers - Amorymeltzer
http://www.nature.com/news/peculiar-pattern-found-in-random-prime-numbers-1.19550
======
DoubleMalt
It's even worse if you represent the primary numbers in binary notation. Every
prime number greater than 10 ends with the digit 1 ;) [edit typos]

~~~
fredley
Which leads to the interesting question: if this happens in base 10, but not
(trivially) in base 2, what other bases does it happen or not happen in?

~~~
ghurtado
I think you may have missed the joke.

~~~
allemagne
He got the joke, but was also taking it seriously as a phenomenon that could
have interesting implications. This finding obviously doesn't hold base 2
(more accurately, isn't an applicable concept), and apparently becomes more
pronounced in base 3.

------
kba
I was curious, so I wrote a small program to check it:

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](https://gist.github.com/kbadk/71bbb57c9be0d66de156)

~~~
redblacktree
FTA:

> “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

------
CarolineW
Primary discussion:
[https://news.ycombinator.com/item?id=11282480](https://news.ycombinator.com/item?id=11282480)

~~~
pc86
> Primary

------
mchahn
Finding patterns in primes is old news.

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.

~~~
tripzilch
This is true, they're called Ulam spirals. But the reasons for these patterns
appearing are afaik pretty well understood (I forget exactly how but it wasn't
hard to get a grasp of why they are there).

Though these patterns are pretty noisy still.

[https://en.wikipedia.org/wiki/Ulam_spiral](https://en.wikipedia.org/wiki/Ulam_spiral)

------
amai
Could this be related to
[https://en.wikipedia.org/wiki/Benford%27s_law](https://en.wikipedia.org/wiki/Benford%27s_law)
?

------
JustSomeNobody
Why is random in quotes? Random numbers can have patterns, too.

~~~
radarsat1
Can they? Genuine question.

~~~
mturmon
It's actually a very good question. Even up to the Renaissance, we had no real
conception of "probability" \-- even though there were games of chance that
depended on it. The Greeks had notions of impossible/possible/likely, but no
way to link the notions to the world.

It 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...](http://www.jstor.org/stable/2184357?seq=1#page_scan_tab_contents.))

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.

~~~
radarsat1
Thank you, that is a very good answer. So "random" is how you look at a
sequence. It's more a model (context in which to interpret a sequence) than an
observable fact. Is that a fair interpretation?

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?

~~~
mturmon
For almost all purposes, "stochastic" is literally a synonym for "random". But
sometimes the usage favors one and not the other.

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? ;-)

~~~
radarsat1
Thank you!

------
MoonZ
just tested it against the 10000 first prime numbers in Sublime Text : 2462
prime numbers have a direct neighbour with the same last digit. That's nearly
a quarter of them... Edit: by taking into account sequences with 3 identical
digits (110 occurrences), it's even more.

