Message Boards Message Boards

Comparing Benford's Law to File Sizes

Posted 5 years ago

POSTED BY: Jon McLoone
3 Replies
Posted 5 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

POSTED BY: Rohit Namjoshi

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

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!

POSTED BY: EDITORIAL BOARD
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract