关于「东西方原典考辨:小司徒的比法与拉普拉斯的出生比」,《布隆过滤器与基数估计》给出的定量结论是什么?

结论:第七章考辨《周礼》小司徒的比法与拉普拉斯的出生比,复算拉普拉斯所需的 771469 人清点规模,并指出同样精度今天只需 24576 字节。

数据口径:示意网络中,各站独立访客相加是真实人数的 2.224 倍。 书中的站点、访客、订单与流量参数均为示意;全部计算由书中程序生成;本书是非个人化经营建议;访客统计只用匿名化、加密钥哈希的标识,不收集个人身份信息,须遵守所在地个人信息保护法规与站点隐私声明,法规只述大意,以上架前人工复核为准。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 24576, 771469

ratio population Laplace n normal-approx n ratio implied z
26.025299417 771469 693018 1.113 3.472
26.525785944 817219 734328 1.113 3.471
relative error target 0.01976 at z3.2905
HLL registers needed 2998332768, 24576 bytes at 6 bits
Laplace's advice: enumerate 1000000 to 1200000 inhabitants
查看完整验算程序
# 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")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《布隆过滤器与超对数对数基数估计、千字节内存统计百站独立访客与去重订单母典》第 7 章「东西方原典考辨:小司徒的比法与拉普拉斯的出生比」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 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}
}

本书其他章节结论