85 points · by Amorymeltzer · 10y ago · 37 comments
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?
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.
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.
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.