What does Benford's Law and Ledger Audits conclude, in numbers, about “The Precondition: How Many Decades, Fixed Prices and the Mixing of Price Points”?

Answer: Chapter 5 turns the precondition into a measurable gate: a worst-case MAD below 0.015 needs a span of 1.57 decades, and no single amount may take a tenth of the rows.

Scope of the numbers: Its parameters are illustrative; all calculations are generated by its programs; the book is not legal advice and not personalised business advice, and test results are only signals for review. Marked boxes separate published evidence, runnable Python calculations (20 programs), classical sources and the author's hypotheses.

中文版

Data table

The numbers below are printed verbatim by the chapter's Python program and can be reproduced by running it. standard-library Python onlyprinted values that match the answer: 0.015, 1.57

honest shapespanMADworst
lognormal s=0.30.610.09610.1056
lognormal s=0.51.010.04600.0559
lognormal s=0.71.410.01870.0228
lognormal s=0.91.820.00570.0069
lognormal s=1.02.020.00280.0034
lognormal s=1.22.420.00050.0007
lognormal s=1.53.030.00000.0000
uniform 15 to 800.710.0763-
uniform 100 to 10000.960.0597-
uniform 1 to 100001.990.0597-
meals, cap 2000.520.1142-
worst-case MAD below 0.015 needs s >= 0.776, span 1.57 decades
worst-case MAD below 0.006 needs s >= 0.921, span 1.86 decades
Show the full program
# Chapter 5. p51: the precondition, measured as spread over decades.
# Exact first-digit shares (no sampling) for honest data of known shape:
# lognormal with log-sd s (median 260; worst case over the median also
# shown), uniform ranges, and a capped lognormal.  Span = log10(P99/P1),
# the number of decades holding the central 98 percent of amounts.
# MAD here is the population value: what an infinitely long honest
# ledger of that shape would show.  Shapes are illustrative.
import math

P1 = [math.log10(1 + 1 / d) for d in range(1, 10)]
Z99 = 2.3263478740


def phi(z):
    return 0.5 * (1 + math.erf(z / math.sqrt(2)))


def lognormal_cdf(x, mu, s):
    return phi((math.log(x) - mu) / s) if x > 0 else 0.0


def digits_from_cdf(cdf):
    return [math.fsum(cdf((d + 1) * 10 ** k) - cdf(d * 10 ** k)
                      for k in range(-6, 12)) for d in range(1, 10)]


def mad(q):
    return math.fsum(abs(a - b) for a, b in zip(q, P1)) / 9


def worst_mad(s):
    return max(mad(digits_from_cdf(
        lambda x, m=math.log(100) + i * math.log(10) / 50:
        lognormal_cdf(x, m, s))) for i in range(50))


print("%-22s %7s %8s %8s" % ("honest shape", "span", "MAD", "worst"))
for s in (0.3, 0.5, 0.7, 0.9, 1.0, 1.2, 1.5):
    q = digits_from_cdf(lambda x: lognormal_cdf(x, math.log(260), s))
    span = 2 * Z99 * s / math.log(10)
    print("%-22s %7.2f %8.4f %8.4f" % (
        "lognormal s=%.1f" % s, span, mad(q), worst_mad(s)))
for lo, hi in ((15, 80), (100, 1000), (1, 10000)):
    q = digits_from_cdf(lambda x: min(max((x - lo) / (hi - lo), 0.0), 1.0))
    span = math.log10((lo + 0.99 * (hi - lo)) / (lo + 0.01 * (hi - lo)))
    print("%-22s %7.2f %8.4f %8s" % (
        "uniform %d to %d" % (lo, hi), span, mad(q), "-"))
mu, s, cap = math.log(120), 0.3, 200.0
q = digits_from_cdf(
    lambda x: 1.0 if x >= cap else lognormal_cdf(x, mu, s))
p01 = math.exp(mu - Z99 * s)
p99 = min(cap, math.exp(mu + Z99 * s))
print("%-22s %7.2f %8.4f %8s" % (
    "meals, cap 200", math.log10(p99 / p01), mad(q), "-"))
for target in (0.015, 0.006):
    lo, hi = 0.3, 2.0
    for _ in range(60):
        mid = (lo + hi) / 2
        if worst_mad(mid) > target:
            lo = mid
        else:
            hi = mid
    print("worst-case MAD below %.3f needs s >= %.3f, span %.2f decades"
          % (target, hi, 2 * Z99 * hi / math.log(10)))

Single source and citation

Fan, Y. (2026). Benford's First-Digit Law, Ledger Fraud Detection and Chi-Square Audits of Buying-Agent Cash Flows and Expense Claims (Version 1.0.0), Chapter 5: The Precondition: How Many Decades, Fixed Prices and the Mixing of Price Points. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 5DL-B-216 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026216,
  author    = {Fan, Yafu},
  title     = {Benford's First-Digit Law, Ledger Fraud Detection and Chi-Square Audits of Buying-Agent Cash Flows and Expense Claims},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

Other chapter answers in this book