News for hackers. Stuff that matters.
Re:Benford's Law by donovanbiela on Sunday November 19, 2017 @04:40AM (#15733087)
Interesting note from the page: "Some well-known infinite integer sequences provably satisfy Benford's Law exactly including Fibonacci numbers, factorials, and the powers of almost any number."
Re:Benford's Law by markc on Monday November 20, 2017 @04:50PM (#15743630)
Had to try it! (Clojure)

     (frequencies
      (take 100
            (map #(first (str (first %)))
     	    (iterate (fn [[x y]] [y (+' x y)]) [0 1]))))
     
     => {\0 1, \1 30, \2 18, \3 12, \4 9, \5 8, \6 6, \7 5, \8 7, \9 4}
     
i.e. Yup, Fibonacci up to 100, 30% start with 1, 18% start with 2.
Re:Benford's Law by tgb on Monday November 20, 2017 @10:35AM (#15740592)
What are the numbers whose powers don't satisfy the law? 0 of course and any power of 10 will have only leading 1's. Any product of just 2's and 5's, probably?
Re:Benford's Law by madcaptenor on Monday November 20, 2017 @10:45AM (#15740689)
Powers of two satisfy Benford's law. In order for powers of an integer k to not satisfy Benford's law, k would have to be a rational power of 10; in fact it would have to be an integer power of 10 because if 10^(m/n) is rational then it's an integer.

But a quick calculation makes it look like powers of two don't satisfy Benford's law, For example the first power of 2 which begins with 7 is 2^46, and the first power of 2 which begins with 9 is 2^53. This takes so long, roughly speaking, because 2^10 = 1024 is so close to a power of ten.

Re:Benford's Law by tgb on Monday November 20, 2017 @11:43AM (#15741187)
That surprised me since I saw the "generalization to digits beyond the first" in the article and it's clear that powers of 2 or 5 clearly don't have a Benford-style distribution of their last digits. However, that was a misunderstanding on my part, since that generalization says something about the first n digits, and any fixed n will eventually not include the last digit of the number.
Re:Benford's Law by madcaptenor on Monday November 20, 2017 @01:03PM (#15741777)
In fact powers of any integer don't have a Benford-style distribution of their last digits, since those digits will repeat periodicially. For example powers of 2 end in 2, 4, 8, 6, 2, 4, 8, 6, ...
Re:Benford's Law by mark-r on Monday November 20, 2017 @12:13PM (#15741421)
Yes they do. Python is a good resource for quick back-of-the-envelope calculations like this, I just tested the first digit of the powers of 2 from 0 to 9999. The percentages were 30.10, 17.61, 12.49, 9.70, 7.91, 6.70, 5.79, 5.12, and 4.58. These agree almost precisely with the Wikipedia numbers. Ditto for powers of 5.
Re:Benford's Law by madcaptenor on Monday November 20, 2017 @01:02PM (#15741770)
I agree. But for powers from 1 to 50 those same percentages are 30, 20, 10, 10, 10, 8, 2, 10, 0. In particular there is only one power of 2 in this range starting in 7 and none that ends in 9. This might make someone doing hand computation suspicious. (But really you can't tell much from such a small sample.)