

Random numbers need not be uniform - RiderOfGiraffes
http://en.wikipedia.org/wiki/Benford%27s_law

======
fhars
Of course not. There are whole books on the subject:
<http://cg.scs.carleton.ca/~luc/rnbookindex.html>

~~~
fhars
For what it is worth: here is an example of a non-uniform random variate:

    
    
      a = [0,0,0,0,0,0,0,0,0,0]
      1000.times do
        a[5 *(rand + rand)] += 1
      end
    

results in (actual numbers may vary randomly):

    
    
      irb(main):020:0> a
      => [28, 60, 96, 151, 171, 168, 146, 96, 63, 21]

------
snippyhollow
I am disappointed, I thought you were about to link something stating that "it
is not correct to always consider unknown random variables to be uniformly
distributed" (take 1/X for instance of why this is wrong). Instead, Benford's
law...

------
jgrahamc
The phrase "Random numbers need not be uniform" is a really bad title for
this. Random numbers are by definition uniformly distributed.

What you are referring to here is Benford's Law. Why not simply say that in
the title?

~~~
ajuc
This is really a bad title, but random numbers indeed need not be uniformly
distributed - for example Gauss distributed numbers aren't distributed
uniformly (from definition:).

~~~
jgrahamc
I don't understand in what sense numbers drawn from a Gaussian distribution
would be considered random.

~~~
ajuc
If the random variable that we measure has Gaussian distribution - the numbers
we read will have Gaussian distrubuition, and will be random.

Other example - rolling dice with 5 sides signed "6" and one side signed "1" -
results will be random, but the resulting distribution won't be uniform.

Uniform distribution is special case of random distribution.

~~~
jgrahamc
Ah. Fair enough. That's a rather interesting case, and what I assume is not
what people think of when you say random number. I assume that people think of
a uniform distribution (i.e equally likely numbers).

~~~
omaranto
You're probably right that people who haven't taken a course in probability
are likely to use "random" to mean "uniformly at random". And of course, most
people haven't taken a course in probability.

------
p3ll0n
Benford's Law is a special case of Zipf's Law
(<http://en.wikipedia.org/wiki/Zipfs_law>) as they both originate from the
same scale invariant functional relation from stat mech.

------
pohl
Sweet...a wikipedia page that reliably causes an "Aw, snap" in Chrome
(5.0.375.70 on MacOS X). Is it just mine?

(In case anybody is wondering whether I've done the right thing and reported
the problem: yes, I have.)

~~~
scott_s
Strange. Loads fine for me. Same version of Chrome on 10.5.8.

~~~
pohl
Interesting. I'm on 10.6.3. I'm also using the 64-bit kernel, which isn't the
default. I wonder if one or both of these variables accounts for the
difference.

~~~
mturmon
I get "snap" reliably from Chrome 5.0.375.70. I get crashes from Safari 4. OS
X 10.6.3.

------
jellicle
People are going to be confused by this, because the definition of "random"
used by mathematicians and that used by programmers is different.

"Random" to mathematicians means the outcome of a probability experiment. If
you flip a two-headed coin or roll a one-sided die, and record the results,
the results are "random" - random within the set of possible outcomes,
according to the function that generates them. So you dutifully record
"heads", "heads", "heads" and "1", "1", "1" for your results. It's random!

"Random" for mathematicians inherently means "predictable". There's a known
probability distribution.

The word "random" for programmers means something very different. It
inherently means "unpredictable". The probability distribution must be flat
across the space of possible outcomes. If we are operating in a base-10
system, the chance of any of the next digits occurring must be exactly 1/10.

My prediction is most of the discussion here will be people talking past each
other, using different definitions of the word "random".

~~~
ajuc
I'm programmer - for me random string is a string, that is shorter than any
programm that generates it (random string has Kolmogorov complexity greater or
equal its length).

I think this is the definition for mathematicians as well.

It's just that "random" is a common shortcut for - string comming out of
probability experiment - it is very likely that it is random according to
Kolmogorov complexity, because most strings are random, and space is very very
big.

~~~
omaranto
While I think that while most mathematicians are aware of Kolmogorov/Chaitin
complexity theory, the first thing that comes to mind when they hear "random"
is the theory of probability. In probability a random variable is, roughly
speaking, an experiment that has a set of possible outcomes each occuring with
a certain probability. The probabilities are not necessarily the same.

I think most mathematicians would agree that Probability is a much larger and
important branch of mathematics than Kolmogorov-Chaitin complexity, and
usually use "random" in its probabilistic meaning.

~~~
ajuc
I was always confused by lack of definition of randomness in
statistic/probabilistic meaning, so I've somewhat mixed these 2 branches of
math.

Thanks for clearing this up.

