Derivation. The computation's output can be wrong only if at least one patch suffers a logical failure in at least one round, or at least one consumed magic state is faulty. By the union bound , applied to the patch-round events of probability and the magic-state events of probability , the failure probability is at most . No independence is needed.
Use. A resource estimate chooses an overall failure target , splits it between the terms (for example half each), and solves for the largest allowed and : and with . The first fixes the code distance; the second fixes the factory design. The number of patch-rounds, not the number of gates, is what the memory term scales with: every idle patch is exposed in every round. Published estimates handle the budget with more refined models (for example Gidney and Ekerå account for repeated attempts of a computation that may fail), but the union bound is the common starting point.
The bound is tight only when the events rarely overlap, which is the regime of interest (). If a computation can be checked cheaply and repeated, as for factoring, a larger is acceptable, and the expected cost becomes the cost of one attempt divided by its success probability.