Message Boards Message Boards


Comparing Benford's Law to File Sizes

Posted 2 years ago
3 Replies
16 Total Likes

3 Replies

enter image description here - Congratulations! This post is now featured in our Staff Pick column as distinguished by a badge on your profile of a Featured Contributor!

Very neat! Thank you for sharing that with us Jon.

Posted 2 years ago

Nice post Jon.

Similar analysis for the leading digit of the magnitude (no unit conversion) of physical constants available in WL. In 1938 Benford did this analysis on 104 physical constants. WL has data on 282 constants. Leading digit 6 seems like a significant anomaly. I wonder why?

mantissa = 
 EntityClass["PhysicalConstant", All]["Value"] // QuantityMagnitude //
     N // MantissaExponent // Map[First];

counts = mantissa * 10 // RealDigits // Map[First /* First] // Counts // KeyDrop[0];

frequencies = counts / Total[counts];

Show[ListLinePlot[Legended[predictions, "Benford`s\nPrediction"], 
  PlotStyle -> LightBlue, MeshStyle -> Blue, Mesh -> All, 
  AxesLabel -> {"Lead digit", "Frequency"}, 
  PlotLabel -> "Benford's Law Prediction of Physical Constants", 
  Ticks -> {Range[9], Table[{i, PercentForm[i]}, {i, 0.05, 0.4, 0.05}]}], 

 ListLinePlot[Legended[KeySort[frequencies], "Actual"], 
  PlotStyle -> Lighter[Green, 0.7], MeshStyle -> Darker[Green], 
  Mesh -> All], ImageSize -> 500, PlotRange -> All]

enter image description here

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract