# Birthday collision populations

Source review and deterministic mathematical illustration, 2026-11-20.
No hashes are searched, no device is measured and no reliability rate is inferred.

## Reproduce

Python 3.11 or newer, standard library only:

```sh
python3 -B model.py
python3 -B -m unittest discover -s . -p test_model.py
```

The generator emits the published JSON. Four chosen populations are hypothetical,
not an empirical sample. There is no seed or fitted parameter.

## Events and assumptions

Model a random function whose outputs on distinct byte strings are independent
and uniform among m = 2**b values. The input strings need not themselves be
random. Repeating the same input is not another independent draw.

One specified distinct pair matches with probability 1/m.
For n fresh distinct inputs and one fixed target digest, the hit probability is
1 - (1 - 1/m)**n. This target is separate from the n fresh inputs.

For any collision among n distinct inputs, the exact probability is
1 - product(1 - i/m, i=0,...,n-1), for n <= m. Above m it is one.
Let lambda = n*(n-1)/(2*m). The exponential approximation is
1 - exp(-lambda); it is also a lower bound for n <= m. The union bound is
min(1, lambda). Lambda is the expected number of colliding unordered pairs,
not the probability of at least one pair. The bounds are mathematical, not
sampling confidence intervals. Near saturation the union bound is uninformative.

The exact routine uses rational arithmetic, capped at 1000 inputs to bound cost.
The large examples use 220-digit Decimal arithmetic to avoid subtracting a
rounded one from one. Output has more digits than the approximation's accuracy;
the article displays only six significant digits and labels it approximate.
The supported domain is integer b in [1,256], n in [0,10**18].
The exact small-space result enumerates all 256 assignments for four inputs
and four outputs: 232 assignments collide, so the probability is 29/32.
Tests independently enumerate spaces with 2, 4 and 8 outputs and 0-5 inputs.

## Source interpretation

Henson (HotOS IX 2003), section 3, prints the fixed-target-shaped expression
as a population collision formula. Black (USENIX ATC 2006), appendix A,
explicitly corrects it. This is an existing published correction, not a new
Hesela discovery. Black sections 2-3 also distinguish selected comparisons,
random-function assumptions and adversaries. Historical SHA-1 recommendations
are not adopted here: see NIST's current hash-function security table.

Venti (FAST 2002), sections 3.1-3.2, provides historical context for using
content digests as block addresses and verifying on read. It is not a benchmark
we reproduced. None of these sources supplies a current hardware-error rate
for comparison with the hypothetical probabilities.

## Engineering interpretation

Count distinct byte strings within the actual comparison namespace and horizon.
A fixed list of corresponding pairs is not all-pairs archive deduplication.
If namespaces never compare across boundaries, count pairs within each namespace.
Byte verification on a digest match changes the equality decision, but adds reads
and relies on a correct implementation; this model measures neither cost nor bugs.
Equal content also does not establish the intended object, version or backup recipe.

Raw source PDFs are retained privately for audit and are not redistributed.
Source metadata is in sources.json. All prose, model and tests here are original
Hesela work; no figure or extended passage was copied.
