关于「同样的五位数出现两次:碰撞、遮蔽与尾数微调」,《直播锁单、流水核销与买手推荐》给出的定量结论是什么?

结论:第三章计算 200 笔同额定金后五码碰撞的机会是 0.1806,被遮蔽的行使 50.3 行模糊。

数据口径:书中的客户、延迟、比率与参数均为示意模型;全部计算由书中程序生成;本书不是法律、财务、银行或个人资料保护方面的建议。 书中以标注框区分已发表的证据、可运行的 Python 计算(16 段程序)、原典与作者的假说。

English version

对照数据表

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

transfersspace DP(some pair)expected pairs
501000000.01220.012
50100000.11550.122
1001000000.04830.050
100100000.39140.495
2001000000.18060.199
200100000.86511.990
4001000000.55030.798
400100000.99977.980
simulation, N = 200, D = 100000: 0.1794
查看完整验算程序
# Chapter 3. p05: Two deposits with the same last five digits. In one
# live session N customers transfer the same deposit for the same bag.
# If the last five digits of their accounts were uniform over 100000
# values, the chance that two share them is 1 - prod(1 - i / 100000),
# the birthday problem. Account numbers are not uniform: if the last
# digit is a check digit, or a bank's numbering leaves few values in
# use, the effective space is smaller. We print the exact chance, the
# expected number of colliding pairs N (N - 1) / (2 D), and a check by
# 20000 simulated sessions for D = 100000 and N = 200. Seed 112.
import math
import random

def p_any(n, d):
    return 1 - math.exp(math.fsum(math.log1p(-i / d) for i in range(n)))

if __name__ == "__main__":
    print("     transfers   space D   P(some pair)   expected pairs")
    for n in (50, 100, 200, 400):
        for d in (100000, 10000):
            print("     {:9d}   {:7d}   {:12.4f}   {:14.3f}".format(
                n, d, p_any(n, d), n * (n - 1) / (2 * d)))
    rng = random.Random(112)
    hits = 0
    for _ in range(20000):
        seen = set()
        for _ in range(200):
            x = rng.randrange(100000)
            if x in seen:
                hits += 1
                break
            seen.add(x)
    print("   simulation, N = 200, D = 100000: {:.4f}".format(hits / 20000))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《海外连线脉冲库存锁、银行流水贝叶斯核销与个性化买手推荐系统》第 3 章「同样的五位数出现两次:碰撞、遮蔽与尾数微调」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-112 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026112,
  author    = {Fan, Yafu},
  title     = {Live-Shopping Flash Inventory Locks, Bayesian Bank-Feed Reconciliation and Personalized Styling CRM},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论