What does Live Locks, Bank Matching and Styling CRM conclude, in numbers, about “The Same Five Digits Twice: Collisions, Masks and Offsets”?

Answer: Chapter 3 computes that 200 transfers of the same deposit share their last five digits somewhere with chance 0.1806, and that masked rows leave 50.3 rows ambiguous.

Scope of the numbers: Its customers, delays, rates and parameters are illustrative models; all calculations are generated by its programs; the book is not legal, financial, banking or data-protection advice. Marked boxes separate published evidence, runnable Python calculations (16 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.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
Show the full program
# 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))

Single source and citation

Fan, Y. (2026). Live-Shopping Flash Inventory Locks, Bayesian Bank-Feed Reconciliation and Personalized Styling CRM (Version 1.0.0), Chapter 3: The Same Five Digits Twice: Collisions, Masks and Offsets. 5D Library. DOI pending

DOI pending · monograph page goes live after publication · 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}
}

Other chapter answers in this book