
Any number can start a factorial - ColinWright
https://www.johndcook.com/blog/2019/11/02/any-number-can-start-a-factorial/
======
notelonmusk
The article's opening sentence: "Any positive number can be found at the
beginning of a factorial..." is a strong statement but no proof is given.

Missing: "... with high probability, and supported by analysis of the digits
of factorials from 1 to 10,000"

The work by Diaconis mentioned but not cited: [0]
[https://statweb.stanford.edu/~cgates/PERSI/papers/digits.pdf](https://statweb.stanford.edu/~cgates/PERSI/papers/digits.pdf)
\- The distribution of leading digits ad uniform distribution mod 1 - Persi
Diaconis

The sequence: [1] [https://oeis.org/A076219](https://oeis.org/A076219) \-
Smallest positive integer m such that m! begins with n in base 10 :: 1, 2, 9,
8, 7, 3, 6, 14, 96, 27, 22, 5, 15, 42, 25, 89, 69, 76, 63, 16, 87, 113, 54,
...

~~~
SamReidHughes
I'm not sure what you're getting at, but "any positive number can be found at
the beginning of a factorial" is correct. Not with high probability, but with
absolute certainty. I don't know which Diaconis proved, but it's pretty easy
to construct a non-probabilistic, constructive proof.

Edit: The paper you linked does not prove it with high probability, it proves
{n!} is a strong Benford sequence. Edit: Which implies absolute certainty.

~~~
notelonmusk
> I'm not sure what you're getting at

I'm sure what I'm not getting at, which is the proof. I'll think about it.
Processing ...

------
SamReidHughes
The footnote and comments talk about this, but don't exactly mention that what
you want for the probability of the leading digits "2019" is
log10(2.020)-log10(2.019).

------
LeoPanthera
While attempting to verify this, I was surprised to learn that bc has no
built-in factorial function, even in the mathlib.

~~~
therein
While looking into this, TIL bc is very scriptable:

    
    
      $ bc
      define fact_rec (n) { 
        if (n < 0) {
          print "oops";
          halt;
        }
        if (n < 2) return 1;
        return n*fact_rec(n-1);
      }
      fact_rec(5)
      120

------
sillysaurusx
In case anyone else was curious, Bedford's Law is apparently just a fancy name
for the phenomenon where 1's appear much more frequently than 9's in any
random sample of numbers. I think Bernie Madoff got caught faking the books
due to the distributions not being shaped like Bedford's Law.

~~~
eindiran
That's correct, but I think its "Benford's Law" rather than "Bedford's Law".

[https://en.wikipedia.org/wiki/Benford%27s_law](https://en.wikipedia.org/wiki/Benford%27s_law)

~~~
OnlineGladiator
What on Earth‽‽‽ How have I never heard of this before, and much more
importantly - why is it true (I skimmed the wikipedia page and I didn't really
see anything for 'why' but mostly for 'what')?

So it takes the data and draws it on a log scale to visualize it, but doesn't
explain why the data naturally transposes to a log scale (we are talking about
random data sets in nature). If I think of it as a village with 1,000 people
is more likely than a village with 2,000 people is more likely than a village
with 3,000 people (and this continues in both directions), the only real
conclusion I can come to is that nature prefers smaller numbers of things. But
that wouldn't extend to something like accounting books (or at least the jump
is not immediately obvious to me).

EDIT: I guess I chose a bad example (although my point still is useful as a
thought exercise), since this was used as an exception to the rule:

> Benford's law is violated by the populations of all places with population
> at least 2500 from five US states according to the 1960 and 1970 censuses,
> where only 19% began with digit 1 but 20% began with digit 2, for the simple
> reason that the truncation at 2500 introduces statistical bias.

~~~
sillysaurusx
Your shock is warranted. It's actually a very deep question, called the Zipf
mystery:
[https://www.youtube.com/watch?v=fCn8zs912OE](https://www.youtube.com/watch?v=fCn8zs912OE)

No one really knows why it's true. It's also true across physical constants,
not just artificial quantities made up by humans.

The same type of distribution pops up in language, in nature, in numbers,
popularity of opening chess moves, everywhere.

~~~
ColinWright
> _No one really knows why it 's true._

Any distribution of numbers that is "scale free" follows Benford's Law. This
is _extremely_ well understood.

The distribution of the areas of lakes, heights of trees, the proportion of
the answers that start with the digit "1" should be the same no matter what
units you use. You can measure heights in barleycorns, metres, inches, or
cubits, the proportion of answers that start with the digit "1" should remain
constant across those different units. Grind through the sums and Benford's
Law pops out.

And Benford's Law is not Zipf's Law. Zipf's Law is _also_ well-understood when
you look at coding theory, and how we would expect language (and mutable codes
in general) to change so that more frequently used "atoms" are "shorter.

So I don't really know what you're claiming here, but on the surface of it,
with things I've studied, your comment seems mostly wrong.

