What does Benford's Law and Ledger Audits conclude, in numbers, about “Chinese and European Sources Weighed: the Four-Pillar Settlement, Newcomb's Logarithm Tables and Pacioli's Trial Balance”?

Answer: Chapter 7 weighs the four-pillar settlement, Newcomb's note of 1881 and Pacioli's double entry of 1494.

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 only

cells total identity chain count neither
196 96 0 0 0
2992 848 112 8 24
34608 4608 0 0 0
412160 10504 1500 24 132
silent alterations by family (prime = the following month):
gross-up, only X and K move68, e.g. +K +X
carried, S and J' move too88, e.g. +K -S -J' +X'
Show the full program
# Chapter 7. p71: what the four-pillar identity can and cannot catch.
# A year of 12 monthly four-pillar statements.  Fields per month:
#   J old balance (jiu guan), X new receipts (xin shou),
#   K disbursements (kai chu), S actual balance (shi zai).
# Checks: identity J + X - K - S = 0 in every month; the chain
# J(m+1) = S(m) between consecutive months; and a cash count that
# anchors the opening J of month 1 and the closing S of month 12.
# An alteration adds +d or -d to between 1 and 4 cells inside two
# consecutive months; we enumerate every such alteration once and
# classify it by the first check that sees it.  Exact enumeration.
import itertools

FIELDS = "JXKS"
COEF = {"J": 1, "X": 1, "K": -1, "S": -1}
MONTHS = 12


def caught(vec):
    by_month = {}
    for (m, f), c in vec:
        by_month.setdefault(m, []).append(COEF[f] * c)
    for m, parts in by_month.items():
        tot = 0
        for p in parts:
            tot += p
        if tot != 0:
            return "identity"
    cells = dict(vec)
    for m in range(MONTHS - 1):
        if cells.get((m + 1, "J"), 0) != cells.get((m, "S"), 0):
            return "chain"
    if cells.get((0, "J"), 0) or cells.get((MONTHS - 1, "S"), 0):
        return "count"
    return "neither"


seen = set()
table = {}
silent = {}
for m in range(MONTHS - 1):
    cells = [(mm, f) for mm in (m, m + 1) for f in FIELDS]
    for size in (1, 2, 3, 4):
        for support in itertools.combinations(cells, size):
            for signs in itertools.product((1, -1), repeat=size):
                vec = tuple(sorted(zip(support, signs)))
                if vec in seen:
                    continue
                seen.add(vec)
                verdict = caught(vec)
                table[(size, verdict)] = table.get((size, verdict), 0) + 1
                if verdict == "neither":
                    moved = [f for (mm, f), c in vec]
                    carry = "J" in moved or "S" in moved
                    fam = "carry" if carry else "gross"
                    silent.setdefault(fam, []).append(vec)

VERDICTS = ("identity", "chain", "count", "neither")
print("%5s %8s %8s %8s %8s %8s" % (("cells", "total") + VERDICTS))
for size in (1, 2, 3, 4):
    row = [table.get((size, v), 0) for v in VERDICTS]
    tot = 0
    for r in row:
        tot += r
    print("%5d %8d %8d %8d %8d %8d" % tuple([size, tot] + row))


def show(vec):
    first = vec[0][0][0]
    return " ".join("%s%s%s" % ("+" if c > 0 else "-", f,
                                "'" if mm > first else "")
                    for (mm, f), c in vec)


print("silent alterations by family (prime = the following month):")
print("  gross-up, only X and K move: %d, e.g. %s"
      % (len(silent["gross"]), show(silent["gross"][0])))
print("  carried, S and J' move too:  %d, e.g. %s"
      % (len(silent["carry"]),
         [show(v) for v in silent["carry"]
          if show(v).startswith("+K -S")][0]))

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 7: Chinese and European Sources Weighed: the Four-Pillar Settlement, Newcomb's Logarithm Tables and Pacioli's Trial Balance. 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