# Query dependencies under a fixed failure budget

This is an exact teaching construction, not a D-GRAID implementation, a
replication of a paper figure, a device benchmark or an observed failure rate.

## Reproduce

Use Python 3.10 or newer, standard library only, from this directory:

```sh
python3 -B model.py --check
python3 -B test_model.py
python3 -B -O test_model.py
```

To regenerate the JSON, run `python3 -B model.py --write`.
There is no random seed: enumeration and rational arithmetic are deterministic.

## Population and event

There are n labeled disks and exactly f unavailable disks. All C(n,f)
failure subsets have equal probability. A fixed execution plan requires objects
whose copies are confined to the listed disk IDs. Repeated IDs denote the same
failure domain, not independent requirements. Success means every required disk
survives. Unlisted metadata, logs and services are assumed available.

If u distinct disks are required, successful failure subsets choose all f
failures from the other n-u disks. Therefore:

```text
P(success | exactly f failures, uniform subsets) = C(n-u,f) / C(n,f)
```

The numerator is zero if f > n-u. An empty requirement set succeeds by convention.
The code rejects booleans, nonintegral parameters and out-of-range member IDs.

For n=16 and f=4, the denominator is 1,820 subsets. One, two and three
required disks yield 1,365, 1,001 and 715 successful subsets respectively.
The exact fractions are 3/4, 11/20 and 11/28. No sampling confidence interval
applies: all states of the invented population are counted. The real-world
failure law is unknown and is not estimated here.

With two distinct required disks, multiplying 3/4 by 3/4 gives 9/16,
not 11/20. That multiplication describes independent member survival, a
different law in which the failure count varies. Under the fixed-count law,
after one required disk survives, the other survives with probability 11/15.
The discrepancy is 1/80, or 1.25 percentage points.

For a fixed workload, a weighted average of these per-plan probabilities gives
the expected successful query fraction. Linearity does not require queries
to succeed independently. It does not give the variance or the distribution
of the successful fraction in one realized outage.

## Limits and interpretation

This construction includes no replicas, parity reconstruction, repairs, time,
load, silent corruption, version inconsistency or alternative execution plans.
A covering index or a fallback scan can change the actual dependency set.
Capacity and scan parallelism may make collocation undesirable or impossible.

The three rows are alternative hypothetical dependency layouts, not three
measured products and not three alternatives known to have equal cost. The
result is a conditional accessibility calculation, not an annual availability,
data-loss probability, latency guarantee or recommendation to disable redundancy.

## Provenance

Hesela's derivation above is original instructional arithmetic motivated by
the distinction between file availability and query dependencies.
The literature context is Sivathanu, Bairavasundaram, A. C. Arpaci-Dusseau and
R. H. Arpaci-Dusseau, *Database-Aware Semantically-Smart Storage*, FAST 2005,
pp. 239-252, especially sections 3.2 and 4:
https://www.usenix.org/legacy/event/fast05/tech/full_papers/sivathanu_db/sivathanu_db.pdf

Source checked 2026-12-02 (Europe/Warsaw). No DOI asserted.
The paper supplies context, not these exact fractions or our failure law.
No original figure, hardware trace or implementation code is redistributed.
