# Rack affinity: exact illustrative arithmetic

Run with Python 3 (standard library only):
```sh
python3 model.py
python3 model.py --check results.json
python3 -B -m unittest discover -s . -p test_model.py
```

Two fictional racks have two distinct nodes each. Every two-node subset is
equally likely under this reference distribution. Enumeration uses node indices,
not equally weighted rack-count partitions. Four of six subsets span racks;
two select one whole rack. Half of the probability mass at a tied score enters
the affinity. The result is a mid-distribution rank, not a posterior cause
probability. Its complement differs from the inclusive upper tail.

The [3, 1] capacity control holds total nodes and burst size fixed but changes
the topology: same-rack affinity becomes 3/4 instead of 5/6. Singleton bursts,
whole-cell bursts and one-rack topologies have degenerate score distributions
with affinity 1/2. This is not a classifier guaranteeing causes or independence.

The generated whole-cell control selects all four nodes in the [2, 2] cell.
Its only subset has score 2, affinity 1/2 and inclusive upper-tail probability 1.
A shared outage can therefore coexist with a neutral conditional rank. This
does not determine permanent data loss or outage duration; report the affected
population and service impact separately. This is a derived boundary, not a
measured Google event.

This small enumerator caps total nodes at 16 and candidate subsets at 10000.
It does not implement the paper's scalable dynamic program. No random seed is
needed. Results use exact fractions; no Google logs or measured rates are used.
The published numeric results in the existing article are unchanged.

Source: Ford et al., Availability in Globally Distributed Storage Systems,
OSDI 2010, section 4.3, printed pages 6-7.
Canonical: https://www.usenix.org/legacy/event/osdi10/tech/full_papers/Ford.pdf
Read full paper via: https://www.cs.albany.edu/~jhh/courses/readings/ford10.osdi10.availability.pdf
Accessed 2026-11-09. The paper defines the score, half-tie metric and null mean,
and explicitly cautions about partial-rack events, component batches and
software changes. The tiny topology examples and tail comparison are Hesela
derivations, not results reported by Ford. The third-party PDF is not redistributed.
