What does Bloom Filters and HyperLogLog for Many Sites conclude, in numbers, about “Classical Sources East and West: the Registration Rule of the Minor Minister and Laplace's Ratio of Births”?
Answer: Chapter 7 examines the registration rule of the Minor Minister in the Zhou li and Laplace's ratio of births, recomputes Laplace's required count of 771469 people, and notes that the same precision needs only 24576 bytes today.
Scope of the numbers: In an illustrative network, per-site unique visitors add up to 2.224 times the true number of people. Marked boxes separate published evidence, 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: 24576, 771469
| ratio population Laplace n normal-approx n ratio implied z | |
| 26.0 | 25299417 771469 693018 1.113 3.472 |
| 26.5 | 25785944 817219 734328 1.113 3.471 |
| relative error target 0.01976 at z | 3.2905 |
| HLL registers needed 29983 | 32768, 24576 bytes at 6 bits |
| Laplace's advice: enumerate 1000000 to 1200000 inhabitants |
Show the full program
# Chapter 7. p71: Laplace's population count from births, recomputed.
# Figures from Laplace's memoir on births in Paris and France (Mem.
# Acad. R. Sci. Paris for 1783, pp. 693 to 702): mean annual births of
# 1781 and 1782 = 973054.5; ratio of population to births about 26 (or
# 26.5); sample enumerations of 771469 (or 817219) inhabitants for odds
# of a thousand to one against an error of half a million.
# Modern check: in a sample of n inhabitants births are Binomial(n, 1/R),
# so the ratio estimate has relative variance about (R - 1) / n; for
# odds 1000:1 two-sided, z = 3.2905. The last lines size a HyperLogLog
# sketch for the same relative error at the same odds (SE 1.04/sqrt m).
import math
BIRTHS = 973054.5
Z = 3.2905
print("ratio population Laplace n normal-approx n ratio implied z")
for r, lap_n in ((26.0, 771469), (26.5, 817219)):
pop = BIRTHS * r
d = 500000 / pop
n = Z * Z * (r - 1) / (d * d)
z_imp = d * math.sqrt(lap_n / (r - 1))
print("%5.1f %11.0f %11d %17.0f %6.3f %10.3f"
% (r, pop, lap_n, n, lap_n / n, z_imp))
d = 500000 / (BIRTHS * 26)
m = (Z * 1.04 / d) ** 2
m2 = 1 << math.ceil(math.log2(m))
print("relative error target %.5f at z = %.4f" % (d, Z))
print("HLL registers needed %.0f -> %d, %d bytes at 6 bits"
% (m, m2, m2 * 6 // 8))
print("Laplace's advice: enumerate 1000000 to 1200000 inhabitants")Single source and citation
Fan, Y. (2026). Bloom Filters and HyperLogLog Cardinality Estimation: Counting Unique Visitors and Deduplicating Orders across a Hundred Sites in Kilobytes (Version 1.0.0), Chapter 7: Classical Sources East and West: the Registration Rule of the Minor Minister and Laplace's Ratio of Births. 5D Library. DOI pending
DOI pending · monograph page goes live after publication · 5DL-B-294 · v1.0.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026294,
author = {Fan, Yafu},
title = {Bloom Filters and HyperLogLog Cardinality Estimation: Counting Unique Visitors and Deduplicating Orders across a Hundred Sites in Kilobytes},
year = {2026},
publisher = {5D Library},
edition = {1.0.0},
note = {DOI pending}
}Other chapter answers in this book
- Chapter 1 · The Memory Bill of Exact Deduplication: Why Unique Visitors Do Not Add Up
- Chapter 2 · HyperLogLog: the First 1-Bit, the Harmonic Mean and 1.04/√m
- Chapter 3 · Corrections at Both Ends: Linear Counting, Switch-Point Bias and Hash Width
- Chapter 4 · The Bloom Filter: the False-Positive Formula, the Optimal Probe Count and 1.44 Times the Space
- Chapter 5 · Order Deduplication: Filters Route but Never Reject, Windows Rotate by Generation, Counters Delete
- Chapter 6 · Merging a Hundred Sites, the Intersection Trap and the Privacy of Registers
- Chapter 8 · Closing the Loop: Registers-Only Weekly Reports for Tollbooth and Direct-Answer Pages, and a Pre-Registered Audit