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
| transfers | space D | P(some pair) | expected pairs |
|---|---|---|---|
| 50 | 100000 | 0.0122 | 0.012 |
| 50 | 10000 | 0.1155 | 0.122 |
| 100 | 100000 | 0.0483 | 0.050 |
| 100 | 10000 | 0.3914 | 0.495 |
| 200 | 100000 | 0.1806 | 0.199 |
| 200 | 10000 | 0.8651 | 1.990 |
| 400 | 100000 | 0.5503 | 0.798 |
| 400 | 10000 | 0.9997 | 7.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
- Chapter 1 · Locks on a Live Shelf: How Long to Hold a Piece
- Chapter 2 · The Cascade in Closed Form, and Who Goes First
- Chapter 4 · Matching Rows to Orders: Likelihoods and the Hungarian Method
- Chapter 5 · A Hybrid Recommender: Taste in Shapes and Colours People Name
- Chapter 6 · Waking the Pool: Blasts, Targets and the Right Day
- Chapter 7 · Permits, Secret Codes and Record Linkage
- Chapter 8 · Practice: One Year of Live Sessions and One Test Protocol