probability-foundations · foundational · 40 min read

Probability & The Union Bound

Kolmogorov axioms, the inequality every multiple-testing and generalization proof leans on, and the ladder from Markov to Hoeffding that turns one event into many.

Abstract. Probability is the first place every machine learning and statistics argument lands. This topic builds the apparatus that almost every such argument uses: a small set of axioms (Kolmogorov), a single combinatorial bound (Boole / the union bound), and a ladder of three increasingly sharp tail inequalities (Markov, Chebyshev, Hoeffding). The union bound is the inequality that turns "one bad event has small probability" into "none of these m bad events happens, with high probability." It is the entire engine behind Bonferroni's family-wise error rate control in multiple testing, behind PAC generalization bounds over a hypothesis class, behind UCB confidence sets in bandit algorithms, and behind the first Borel–Cantelli lemma. We prove every inequality fully, derive Hoeffding's bound from the moment generating function and Markov's inequality, and finish with the "union bound + concentration" pattern that every modern learning-theory result relies on. No measure theory is required — the topic is the on-ramp to the rigorous probability that the Measure & Integration track will provide.

1. Three Puzzles the Union Bound Solves

We open with three apparently unrelated questions. By the end of the topic each will be a one-line application of a single inequality.

Three configurations of three overlapping circles on the unit square: disjoint (bound tight), uniform-overlap (bound moderate), nested (bound very loose). Each panel shows the exact union probability, the sum of marginals, and the tightness ratio.

Puzzle 1 — Why does the Bonferroni correction work? A researcher runs m=100m = 100 hypothesis tests, each at significance level α=0.05\alpha = 0.05. Under the null hypothesis that all 100100 effects are zero, what is the probability that at least one test falsely rejects? If the tests were independent, the answer would be 1(1α)m0.9941 - (1 - \alpha)^{m} \approx 0.994 — almost certain. The Bonferroni correction says: test each hypothesis at level α/m\alpha / m instead. Then no matter what the dependence between the tests is, the family-wise error rate is at most α\alpha. The proof, when we get to it, is one line. It is the union bound.

Puzzle 2 — What does “infinitely often” even mean? Toss a fair coin forever. The event “heads occurs infinitely often” is intuitive but slippery: it is a statement about the entire infinite tail of the sequence, not about any finite prefix. The Borel–Cantelli lemmas give it a precise set-theoretic form and a sharp probabilistic dichotomy: if nP(An)<\sum_n P(A_n) < \infty, then AnA_n occurs infinitely often with probability 00; if nP(An)=\sum_n P(A_n) = \infty and the AnA_n are independent, then AnA_n occurs infinitely often with probability 11. The first half of that dichotomy is — again — a corollary of the union bound.

Puzzle 3 — Why does a learning algorithm generalize? A machine-learning system picks the best hypothesis h^\hat h from a finite class H\mathcal{H} by minimizing the training error R^(h)\hat R(h) over nn samples. We want a bound on the true risk R(h^)R(\hat h) — the error on fresh data. For any single fixed hypothesis hh, Hoeffding’s inequality gives P(R^(h)R(h)>ϵ)2e2nϵ2P(|\hat R(h) - R(h)| > \epsilon) \leq 2 e^{-2 n \epsilon^2}. But h^\hat h is not a single fixed hypothesis — it is whichever member of H\mathcal{H} happens to win the training-error contest. So we need a bound that holds uniformly over H\mathcal{H}. The PAC generalization bound delivers exactly that:

P ⁣(hH:R^(h)R(h)>ϵ)H2e2nϵ2.P\!\left(\exists h \in \mathcal{H} : |\hat R(h) - R(h)| > \epsilon\right) \leq |\mathcal{H}| \cdot 2 e^{-2 n \epsilon^2}.

The inequality on the left is upgraded to one on the right by paying a factor of H|\mathcal{H}| — a price that, on the log scale of the deviation, is only logH\sqrt{\log |\mathcal{H}|}. The mechanism is the union bound, again.

Three puzzles, three subjects, one inequality. The interactive below previews the geometry. Drag the events apart and the union bound becomes tight; drag them together and the gap opens.

Events m =
Preset:
AP = 0.152
BP = 0.151
CP = 0.149
Tightness ratio
1.29×
Gap Σ − exact
0.102
Bonferroni-2 closer?
yes (by 0.114)

The blue bar is the exact P(⋃ Aᵢ). The red bar is the union-bound estimate Σ P(Aᵢ). When the events are disjoint, the two bars coincide (ratio = 1). When the events overlap, Σ P(Aᵢ) overshoots and the gap measures the looseness.

The editorial pivot of this topic. Everything you have done in formalCalculus so far has been about functions on the real line: limits, derivatives, integrals, series of numbers. Probability is about subsets of an abstract sample space, and the operations are union, intersection, and complement instead of addition, multiplication, and composition. The vocabulary is different, but the analytic moves are the same — limits of sequences, convergence of sums, exchange of supremum and limit. In Sigma-Algebras & Measures, the measure-theoretic foundations make this analogy exact. For now we proceed at the elementary level: probabilities are non-negative numbers attached to subsets of a sample space, they sum to one, and the only inequalities we need are short combinatorial arguments.

2. The Kolmogorov Axioms

A probability is a function that takes events (subsets of a sample space) and returns numbers in [0,1][0, 1], subject to three axioms. The axioms are short; their consequences are everything.

📐 Definition 1 (Probability space)

A probability space is a triple (Ω,F,P)(\Omega, \mathcal{F}, P) where:

  • Ω\Omega is a non-empty set, the sample space — the set of all possible outcomes.
  • F\mathcal{F} is a collection of subsets of Ω\Omega, the events — sets to which we are willing to assign a probability. We require ΩF\Omega \in \mathcal{F}, AcFA^c \in \mathcal{F} whenever AFA \in \mathcal{F}, and nAnF\bigcup_n A_n \in \mathcal{F} whenever each AnFA_n \in \mathcal{F} (closure under countable unions).
  • P ⁣:F[0,1]P \colon \mathcal{F} \to [0, 1] is a function satisfying three axioms:
    • (K1) Non-negativity. P(A)0P(A) \geq 0 for every AFA \in \mathcal{F}.
    • (K2) Normalization. P(Ω)=1P(\Omega) = 1.
    • (K3) Countable additivity. For any disjoint sequence (An)n1(A_n)_{n \geq 1} of events, P ⁣(nAn)=nP(An)P\!\left(\bigcup_n A_n\right) = \sum_n P(A_n).

💡 Remark 1 (Events without sigma-algebras)

The closure conditions on F\mathcal{F} make it a sigma-algebra. Why bother — why not let every subset be an event? For finite or countable Ω\Omega, the answer is: we can let every subset be an event, by taking F=2Ω\mathcal{F} = 2^\Omega. The condition is automatically satisfied and the question never arises. For uncountable Ω\Omega — like [0,1][0, 1] with the “length” probability — there exist subsets to which no consistent probability can be assigned, and F\mathcal{F} has to be smaller than 2Ω2^\Omega. That non-trivial story is told in Sigma-Algebras & Measures (forward). For this topic, take F\mathcal{F} to be “the subsets we know how to measure” and proceed.

The axioms are sparse, but they force every standard probability identity. We collect the most-used consequences before moving on.

🔷 Proposition 1 (Immediate consequences of the axioms)

Let (Ω,F,P)(\Omega, \mathcal{F}, P) be a probability space. Then:

  1. P()=0P(\emptyset) = 0.
  2. P(Ac)=1P(A)P(A^c) = 1 - P(A) for every AFA \in \mathcal{F}.
  3. Monotonicity: if ABA \subseteq B, then P(A)P(B)P(A) \leq P(B).
  4. Finite additivity: for disjoint events A1,,AnA_1, \ldots, A_n, P ⁣(i=1nAi)=i=1nP(Ai)P\!\left(\bigcup_{i=1}^n A_i\right) = \sum_{i=1}^n P(A_i).
  5. Continuity from below: if A1A2A_1 \subseteq A_2 \subseteq \cdots is an increasing sequence of events, then P ⁣(nAn)=limnP(An)P\!\left(\bigcup_n A_n\right) = \lim_{n \to \infty} P(A_n).

Proof.

(1) Take An=A_n = \emptyset for all nn in (K3). The events are disjoint, so P()=P ⁣(n)=nP()P(\emptyset) = P\!\left(\bigcup_n \emptyset\right) = \sum_n P(\emptyset). If P()>0P(\emptyset) > 0 then the right-hand side is ++\infty, contradicting P()1P(\emptyset) \leq 1. So P()=0P(\emptyset) = 0.

(2) Ω=AAc\Omega = A \sqcup A^c disjointly, so by (K3) applied to the finite sequence (A,Ac,,,)(A, A^c, \emptyset, \emptyset, \ldots) and (1), 1=P(Ω)=P(A)+P(Ac)1 = P(\Omega) = P(A) + P(A^c).

(3) Write B=A(BA)B = A \sqcup (B \setminus A) disjointly. By (K3) (or by (4) applied to a 2-element disjoint family), P(B)=P(A)+P(BA)P(A)P(B) = P(A) + P(B \setminus A) \geq P(A) since P(BA)0P(B \setminus A) \geq 0 by (K1).

(4) Pad the finite disjoint sequence with empty sets: A1,,An,,,A_1, \ldots, A_n, \emptyset, \emptyset, \ldots. Apply (K3) and use (1) to discard the empty-set terms.

(5) Set B1=A1B_1 = A_1 and Bk=AkAk1B_k = A_k \setminus A_{k-1} for k2k \geq 2. The (Bk)(B_k) are pairwise disjoint, nBn=nAn\bigcup_n B_n = \bigcup_n A_n (since the chain is increasing), and knBk=An\bigcup_{k \leq n} B_k = A_n for every nn. By (K3) and (4):

P ⁣(nAn)=P ⁣(nBn)=k=1P(Bk)=limnk=1nP(Bk)=limnP(An).P\!\left(\bigcup_n A_n\right) = P\!\left(\bigcup_n B_n\right) = \sum_{k=1}^\infty P(B_k) = \lim_{n \to \infty} \sum_{k=1}^n P(B_k) = \lim_{n \to \infty} P(A_n).

The convergence of the limit on the right is automatic — partial sums of a non-negative series are monotone increasing and bounded by 11, so they converge. \blacksquare

Three examples anchor the axioms in concrete computations.

📝 Example 1 (The fair die)

Let Ω={1,2,3,4,5,6}\Omega = \{1, 2, 3, 4, 5, 6\}, F=2Ω\mathcal{F} = 2^\Omega, P({k})=1/6P(\{k\}) = 1/6 for each kk. By finite additivity, the probability of any event is the sum of the per-outcome probabilities of its members. For instance, P(even roll)=P({2,4,6})=3/6=1/2P(\text{even roll}) = P(\{2, 4, 6\}) = 3/6 = 1/2, and P(roll is at most 4)=P({1,2,3,4})=4/6=2/3P(\text{roll is at most 4}) = P(\{1, 2, 3, 4\}) = 4/6 = 2/3. The axioms reduce to “count and divide.”

📝 Example 2 (A countable, non-uniform sample space)

Let Ω={1,2,3,}\Omega = \{1, 2, 3, \ldots\} and define P({k})=2kP(\{k\}) = 2^{-k}. Since k=12k=1\sum_{k=1}^\infty 2^{-k} = 1, this defines a probability measure on Ω\Omega by countable additivity: P(A)=kA2kP(A) = \sum_{k \in A} 2^{-k} for every AΩA \subseteq \Omega. This is the “geometric trials” model — the probability of needing exactly kk trials until the first success, when each trial is a fair coin. The sample space is countably infinite; the axioms still apply unchanged.

📝 Example 3 (Continuous uniform on [0, 1] (informal))

Let Ω=[0,1]\Omega = [0, 1] and define P([a,b])=baP([a, b]) = b - a for 0ab10 \leq a \leq b \leq 1. This is the “uniform random number” model. To say which subsets of [0,1][0, 1] are in F\mathcal{F} in full generality requires the measure-theoretic machinery of Sigma-Algebras & Measures (forward). For this topic, take P([a,b])=baP([a, b]) = b - a on intervals as an oracle and proceed; no construction in the body of this topic depends on which specific subsets of [0,1][0, 1] are measurable.

💡 Remark 2 (Why countable, not finite)

Why does (K3) ask for countable additivity rather than just finite additivity? Because the most important consequences — continuity from below (Proposition 1(v)), the first Borel–Cantelli lemma (Theorem 3), and the convergence of partial-sum probabilities — all require taking limits of an infinite sequence of disjoint events. A theory built on finite additivity alone cannot say “the probability that heads occurs infinitely often is zero” — that statement is about an infinite intersection of unions, and finite additivity gives no access to the limit. The price of countable additivity is the sigma-algebra constraint on F\mathcal{F}; the reward is the entire analytic machinery of the rest of this topic.

3. Conditional Probability and Independence

Conditioning is how probability talks about evidence. The formula is one division.

📐 Definition 2 (Conditional probability)

For events A,BFA, B \in \mathcal{F} with P(B)>0P(B) > 0, the conditional probability of AA given BB is

P(AB)=P(AB)P(B).P(A \mid B) = \frac{P(A \cap B)}{P(B)}.

💡 Remark 3 (What conditioning does)

Conditioning on BB rescales the universe to the part of Ω\Omega where BB occurred. Three things follow immediately: (i) P(ΩB)=P(B)/P(B)=1P(\Omega \mid B) = P(B)/P(B) = 1, so P(B)P(\cdot \mid B) is normalized; (ii) P(AB)0P(A \mid B) \geq 0 for every AA, so it is non-negative; (iii) countable additivity of P(B)P(\cdot \mid B) follows from countable additivity of PP applied to the numerator. So P(B)P(\cdot \mid B) is itself a probability measure on (Ω,F)(\Omega, \mathcal{F}) — a fact we will use without further comment.

🔷 Proposition 2 (Multiplication rule)

For events A1,A2,,AnA_1, A_2, \ldots, A_n with P(A1An1)>0P(A_1 \cap \cdots \cap A_{n-1}) > 0,

P(A1A2An)=P(A1)P(A2A1)P(A3A1A2)P(AnA1An1).P(A_1 \cap A_2 \cap \cdots \cap A_n) = P(A_1) \cdot P(A_2 \mid A_1) \cdot P(A_3 \mid A_1 \cap A_2) \cdots P(A_n \mid A_1 \cap \cdots \cap A_{n-1}).

🔷 Proposition 3 (Law of total probability)

If (Bi)iI(B_i)_{i \in I} is a finite or countable partition of Ω\Omega (the BiB_i are pairwise disjoint and iBi=Ω\bigcup_i B_i = \Omega) with each P(Bi)>0P(B_i) > 0, then for any event AA:

P(A)=iP(ABi)P(Bi).P(A) = \sum_i P(A \mid B_i) \, P(B_i).

🔷 Proposition 4 (Bayes' rule)

For events A,BA, B with P(A),P(B)>0P(A), P(B) > 0:

P(AB)=P(BA)P(A)P(B).P(A \mid B) = \frac{P(B \mid A) \, P(A)}{P(B)}.

Combined with the law of total probability (when the denominator is unknown), for any partition (Aj)(A_j) with P(Aj)>0P(A_j) > 0:

P(AjB)=P(BAj)P(Aj)iP(BAi)P(Ai).P(A_j \mid B) = \frac{P(B \mid A_j) \, P(A_j)}{\sum_i P(B \mid A_i) \, P(A_i)}.

Bayes’ rule is a corollary, not a headline. It says: to invert a conditional, multiply by the marginal of the new conditioner and divide by the marginal of the old. Every proof is the same line — P(AB)=P(AB)P(B)=P(BA)P(A)P(A \cap B) = P(A \mid B) P(B) = P(B \mid A) P(A), divide.

Independence is the structural property that makes joint probabilities factor.

📐 Definition 3 (Independence (pair, family))

  • Events AA and BB are independent if P(AB)=P(A)P(B)P(A \cap B) = P(A) \, P(B).
  • A family (Ai)iI(A_i)_{i \in I} is mutually independent (or simply independent) if for every finite subset JIJ \subseteq I,

P ⁣(iJAi)=iJP(Ai).P\!\left(\bigcap_{i \in J} A_i\right) = \prod_{i \in J} P(A_i).

  • A family is pairwise independent if every pair of events in the family is independent.

Mutual independence is strictly stronger than pairwise independence. The standard counterexample uses three events constructed from two fair coin tosses.

📝 Example 4 (Pairwise but not mutually independent — the 3-coin example)

Take Ω={(0,0,0),(0,1,1),(1,0,1),(1,1,0)}\Omega = \{(0, 0, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0)\} — four outcomes, each with probability 1/41/4. Let AiA_i be the event “the ii-th coordinate equals 11.” Then P(Ai)=1/2P(A_i) = 1/2 for each ii (two of the four outcomes have a 11 in position ii).

For any iji \neq j, exactly one of the four outcomes has 11s in both positions, so P(AiAj)=1/4=P(Ai)P(Aj)P(A_i \cap A_j) = 1/4 = P(A_i) P(A_j). Every pair is independent.

But A1A2A3A_1 \cap A_2 \cap A_3 would require an outcome with 11s in all three positions — and there is no such outcome in Ω\Omega. So P(A1A2A3)=0P(A_1 \cap A_2 \cap A_3) = 0, while P(A1)P(A2)P(A3)=1/8P(A_1) P(A_2) P(A_3) = 1/8. The three events are pairwise independent but not mutually independent.

The structural reason: the third coordinate of each outcome equals the parity (XOR) of the first two. Knowing any one coordinate tells you nothing about another; knowing any two determines the third. Independence is a family-level property, not a sum of pairwise properties.

💡 Remark 4 (Independence is a probability statement, not a logical one)

Two events AA and BB are independent under one probability measure PP and dependent under another, even when the underlying sets A,BΩA, B \subseteq \Omega are the same. Independence is a property of the triple (A,B,P)(A, B, P), not of the events alone. In statistical practice this means independence is an assumption that needs justification, not a logical certainty — two events about completely different physical systems can still be statistically dependent if the data-generating distribution links them.

4. The Union Bound (Boole’s Inequality)

The centerpiece of this topic. The statement is one line; the proof is two; the consequences fill the rest of the curriculum.

🔷 Theorem 1 (Boole's inequality (the union bound))

For any countable sequence of events (An)n1(A_n)_{n \geq 1} in a probability space:

P ⁣(nAn)nP(An).P\!\left(\bigcup_n A_n\right) \leq \sum_n P(A_n).

Equality holds if and only if the events are pairwise disjoint up to a null set — i.e., P(AiAj)=0P(A_i \cap A_j) = 0 for every iji \neq j.

Proof.

Define a disjointified sequence: set B1=A1B_1 = A_1, and for n2n \geq 2 let Bn=Ank<nAkB_n = A_n \setminus \bigcup_{k < n} A_k. Three properties hold by construction.

First, the (Bn)(B_n) are pairwise disjoint: if i<ji < j, then BjAjAiB_j \subseteq A_j \setminus A_i, so BjB_j contains no point of AiBiA_i \supseteq B_i.

Second, BnAnB_n \subseteq A_n for every nn (subtracting a set can only make AnA_n smaller).

Third, nBn=nAn\bigcup_n B_n = \bigcup_n A_n. The \subseteq direction is immediate from BnAnB_n \subseteq A_n. For the \supseteq direction: any ωnAn\omega \in \bigcup_n A_n lies in some AnA_n; let nn be the smallest index with ωAn\omega \in A_n. Then ωAn\omega \in A_n but ωAk\omega \notin A_k for k<nk < n, so ωBn\omega \in B_n.

Now apply countable additivity to (Bn)(B_n) and monotonicity to BnAnB_n \subseteq A_n:

P ⁣(nAn)=P ⁣(nBn)=nP(Bn)nP(An).P\!\left(\bigcup_n A_n\right) = P\!\left(\bigcup_n B_n\right) = \sum_n P(B_n) \leq \sum_n P(A_n).

For the equality case: P(Bn)=P(Ank<nAk)=P(An)P(Ank<nAk)P(B_n) = P(A_n \setminus \bigcup_{k < n} A_k) = P(A_n) - P(A_n \cap \bigcup_{k < n} A_k) by Proposition 1(iv) applied to the disjoint union An=Bn(Ank<nAk)A_n = B_n \sqcup (A_n \cap \bigcup_{k < n} A_k). So nP(Bn)=nP(An)\sum_n P(B_n) = \sum_n P(A_n) forces every P(Ank<nAk)=0P(A_n \cap \bigcup_{k < n} A_k) = 0, which is equivalent to every pairwise intersection P(AiAj)=0P(A_i \cap A_j) = 0 for iji \neq j. \blacksquare

The proof is the bookkeeping of disjointifying a sequence — the entire content is that “the events overlap” subtracts from the total. The next two consequences are the working tools.

🔷 Corollary 1 (Bonferroni's inequality)

For any finite or countable family of events A1,A2,A_1, A_2, \ldots:

P ⁣(iAi)1iP(Aic).P\!\left(\bigcap_i A_i\right) \geq 1 - \sum_i P(A_i^c).

Proof.

By De Morgan, (iAi)c=iAic\left(\bigcap_i A_i\right)^c = \bigcup_i A_i^c. So

P ⁣(iAi)=1P ⁣(iAic)1iP(Aic)P\!\left(\bigcap_i A_i\right) = 1 - P\!\left(\bigcup_i A_i^c\right) \geq 1 - \sum_i P(A_i^c)

where the inequality is Boole applied to the complements. \blacksquare

📝 Example 5 (Bonferroni and multiple testing)

This is the canonical application of Corollary 1, and Puzzle 1 of §1 resolved. Suppose we run mm statistical tests; let AicA_i^c be the event “test ii falsely rejects the null hypothesis.” If each test is run at level α0\alpha_0 — that is, P(Aic)α0P(A_i^c) \leq \alpha_0 under the null — then by Boole on the complements,

P(some test falsely rejects)=P ⁣(iAic)iP(Aic)mα0.P(\text{some test falsely rejects}) = P\!\left(\bigcup_i A_i^c\right) \leq \sum_i P(A_i^c) \leq m \alpha_0.

Choosing α0=α/m\alpha_0 = \alpha / m guarantees the family-wise error rate is at most α\alpha, regardless of the dependence between the tests. The price is power: each individual test is run at a much stricter level than α\alpha, so the test loses sensitivity. This is the trade-off every multiple-testing correction faces, and Bonferroni is the simplest possible solution. See Multiple Testing and False Discovery → formalStatistics for sharper procedures (Holm step-down, Hochberg, Benjamini–Hochberg FDR control) that all begin from this same union-bound observation.

📝 Example 6 (The uniform tail-bound pattern)

This pattern will appear repeatedly. Let X1,,XmX_1, \ldots, X_m be random variables — possibly dependent in complicated ways — and suppose each satisfies the same per-variable tail bound P(Xi>t)δ(t)P(|X_i| > t) \leq \delta(t). Then by Boole,

P ⁣(maxiXi>t)=P ⁣(i{Xi>t})mδ(t).P\!\left(\max_i |X_i| > t\right) = P\!\left(\bigcup_i \{|X_i| > t\}\right) \leq m \, \delta(t).

To control the maximum at confidence 1δ01 - \delta_0, choose tt so that mδ(t)δ0m \, \delta(t) \leq \delta_0 — equivalently, δ(t)δ0/m\delta(t) \leq \delta_0 / m. For the Hoeffding tail δ(t)=2e2nt2\delta(t) = 2 e^{-2 n t^2} that we will prove in §8, this gives t=log(2m/δ0)/(2n)t = \sqrt{\log(2 m / \delta_0) / (2 n)} — the classical logm\sqrt{\log m} price of taking a union over mm events.

The pattern is so general that, in machine-learning practice, “apply a union bound” is almost always shorthand for this single move: per-event exponential tail, mm events, pay a logm\sqrt{\log m} tax in the deviation.

📝 Example 7 (A loose bound is still informative)

Take m=10m = 10 fair, independent coins; let AiA_i be the event “coin ii lands heads.” The exact probability of at least one head is 1(1/2)10=1023/10240.9991 - (1/2)^{10} = 1023 / 1024 \approx 0.999. The union bound gives

P ⁣(iAi)iP(Ai)=1012=5,P\!\left(\bigcup_i A_i\right) \leq \sum_i P(A_i) = 10 \cdot \frac{1}{2} = 5,

which is useless — it exceeds 11, the absolute upper bound on any probability. The union bound is tight when events are nearly disjoint and uninformative when events are highly overlapping. Drag the circles in the flagship visualization together to see the bound’s ratio blow up; drag them apart to see the bound recover to exactness.

Loose bounds are not failures. They are advertisements for a different tool — usually inclusion–exclusion (§5) or a structural argument that exploits the overlap. The union bound’s value is not its sharpness but its generality: it asks nothing about how the events relate.

💡 Remark 5 (Boole vs. Bonferroni vs. inclusion–exclusion)

Three closely-related results live in this chapter. Boole’s inequality (Theorem 1) is a one-sided upper bound on P(Ai)P(\bigcup A_i). Bonferroni’s inequality (Corollary 1) is the lower bound on P(Ai)P(\bigcap A_i) that falls out of Boole on the complements. Inclusion–exclusion (Theorem 2 below) is an exact equality. The reason to reach for Boole instead of inclusion–exclusion in a proof is that Boole needs nothing about pairwise or higher-order intersections — only the marginal P(Ai)P(A_i). This is exactly what makes Boole the workhorse of high-dimensional and distribution-free arguments: in those settings, joint probabilities of mm events are typically unknown or uncomputable, but marginals are not.

5. Inclusion–Exclusion

When the marginals are not enough — when the overlaps are computable and we want an exact probability — inclusion–exclusion is the tool.

🔷 Theorem 2 (Inclusion–exclusion (finite version))

For any finite family of events A1,A2,,AnA_1, A_2, \ldots, A_n:

P ⁣(i=1nAi)=k=1n(1)k+11i1<i2<<iknP(Ai1Ai2Aik).P\!\left(\bigcup_{i=1}^n A_i\right) = \sum_{k=1}^n (-1)^{k+1} \sum_{1 \leq i_1 < i_2 < \cdots < i_k \leq n} P(A_{i_1} \cap A_{i_2} \cap \cdots \cap A_{i_k}).

Proof.

Proof sketch by induction on nn. The base case n=2n = 2 is

P(AB)=P(A)+P(B)P(AB),P(A \cup B) = P(A) + P(B) - P(A \cap B),

which follows from AB=A(BA)A \cup B = A \sqcup (B \setminus A) disjointly and P(B)=P(AB)+P(BA)P(B) = P(A \cap B) + P(B \setminus A).

For the inductive step, suppose the formula holds for n1n - 1 events. Write

i=1nAi=(i=1n1Ai)An,\bigcup_{i=1}^n A_i = \left(\bigcup_{i=1}^{n-1} A_i\right) \cup A_n,

apply the n=2n = 2 case to the two events in1Ai\bigcup_{i \leq n-1} A_i and AnA_n:

P ⁣(i=1nAi)=P ⁣(i=1n1Ai)+P(An)P ⁣(i=1n1(AiAn)).P\!\left(\bigcup_{i=1}^n A_i\right) = P\!\left(\bigcup_{i=1}^{n-1} A_i\right) + P(A_n) - P\!\left(\bigcup_{i=1}^{n-1} (A_i \cap A_n)\right).

The induction hypothesis applies twice — to the first term (an (n1)(n-1)-fold union) and to the third term (the union of the n1n-1 intersections AiAnA_i \cap A_n, also an (n1)(n-1)-fold union of events). Expand both, collect terms by intersection cardinality, and verify that the signs and coefficients combine to give the claimed formula. The algebra is mechanical and is performed in full in the companion notebook. \blacksquare

The 3-event case is worth writing out explicitly — it is the formula most often used by hand.

📝 Example 8 (The 3-event case)

For events A,B,CA, B, C:

P(ABC)=P(A)+P(B)+P(C)P(AB)P(AC)P(BC)+P(ABC).P(A \cup B \cup C) = P(A) + P(B) + P(C) - P(A \cap B) - P(A \cap C) - P(B \cap C) + P(A \cap B \cap C).

Verification on the uniform model over {0,1}3\{0, 1\}^3. Let Ω={0,1}3\Omega = \{0, 1\}^3 with each outcome having probability 1/81/8, and let AiA_i be the event “the ii-th coordinate is 11.” Then P(Ai)=1/2P(A_i) = 1/2, P(AiAj)=1/4P(A_i \cap A_j) = 1/4 for iji \neq j, and P(A1A2A3)=1/8P(A_1 \cap A_2 \cap A_3) = 1/8. The right-hand side is 31/231/4+1/8=12/86/8+1/8=7/83 \cdot 1/2 - 3 \cdot 1/4 + 1/8 = 12/8 - 6/8 + 1/8 = 7/8, which matches P(A1A2A3)=1P(all zero)=11/8=7/8P(A_1 \cup A_2 \cup A_3) = 1 - P(\text{all zero}) = 1 - 1/8 = 7/8. The accompanying notebook reproduces this and the 4-event and 5-event cases for sanity.

Three overlapping circles labeled A, B, C with all seven regions annotated by inclusion-exclusion sign: singletons get +, pairwise intersections get −, and the triple intersection gets +.

📝 Example 9 (Derangements via inclusion–exclusion)

A derangement is a permutation with no fixed points. The probability that a uniformly random permutation π\pi of {1,2,,n}\{1, 2, \ldots, n\} is a derangement equals

Dnn!=k=0n(1)kk!  n  1e0.3679.\frac{D_n}{n!} = \sum_{k=0}^n \frac{(-1)^k}{k!} \;\xrightarrow{n \to \infty}\; \frac{1}{e} \approx 0.3679.

The proof is inclusion–exclusion in three lines. Let Ai={π(i)=i}A_i = \{\pi(i) = i\} be the event ”ii is a fixed point.” Then P(Ai)=(n1)!/n!=1/nP(A_i) = (n-1)!/n! = 1/n — once π(i)=i\pi(i) = i is fixed, the remaining n1n - 1 positions can be permuted in (n1)!(n-1)! ways. More generally, P(Ai1Aik)=(nk)!/n!P(A_{i_1} \cap \cdots \cap A_{i_k}) = (n-k)!/n! for any kk distinct indices, and there are (nk)\binom{n}{k} such kk-subsets. Inclusion–exclusion gives

P ⁣(iAi)=k=1n(1)k+1(nk)(nk)!n!=k=1n(1)k+1k!.P\!\left(\bigcup_i A_i\right) = \sum_{k=1}^n (-1)^{k+1} \binom{n}{k} \frac{(n-k)!}{n!} = \sum_{k=1}^n \frac{(-1)^{k+1}}{k!}.

Subtracting from 11 gives the derangement probability k=0n(1)k/k!\sum_{k=0}^n (-1)^k / k!, which is the partial-sum approximation to e1e^{-1}.

This is a classical combinatorial identity, but it is also a sanity check for the analytic side: by Series Convergence & Tests the alternating series (1)k/k!\sum (-1)^k / k! converges absolutely to e1e^{-1}, and the rate of convergence is faster than geometric — even at n=8n = 8 the derangement probability is correct to four decimal places.

💡 Remark 6 (Bonferroni's inequalities — the full hierarchy)

Boole’s inequality is the first member of a hierarchy. Truncating the inclusion–exclusion alternating sum at an even number of terms gives an upper bound on P(Ai)P(\bigcup A_i); truncating at an odd number gives a lower bound. The first odd truncation — a single term, iP(Ai)\sum_i P(A_i) — is exactly Boole. The next two truncations are

iP(Ai)i<jP(AiAj)P ⁣(iAi)iP(Ai)i<jP(AiAj)+i<j<kP(AiAjAk).\sum_i P(A_i) - \sum_{i < j} P(A_i \cap A_j) \leq P\!\left(\bigcup_i A_i\right) \leq \sum_i P(A_i) - \sum_{i < j} P(A_i \cap A_j) + \sum_{i < j < k} P(A_i \cap A_j \cap A_k).

(The lower bound is the “Bonferroni depth-2” bar in the flagship visualization.) The full hierarchy — Bonferroni’s inequalities — provides arbitrarily tight bounds at the cost of summing (mk)\binom{m}{k} joint probabilities at depth kk. In practice we rarely go past depth 2, because the gain in tightness beyond that is small relative to the explosion of joint terms.

6. The Borel–Cantelli Lemmas

Boole’s inequality is the engine; the Borel–Cantelli lemmas are its first major application. They convert a question about the infinite tail of a sequence of events — does the event AnA_n occur infinitely often? — into a question about a series of probabilities nP(An)\sum_n P(A_n). The two halves of the dichotomy are mirror images of one another: one is union-bound short, the other uses the inequality 1xex1 - x \leq e^{-x} and independence.

📐 Definition 4 (The 'infinitely often' event)

For a sequence of events (An)n1(A_n)_{n \geq 1}, the event ”AnA_n occurs infinitely often” is

{An i.o.}:=lim supnAn=N=1n=NAn.\{A_n \text{ i.o.}\} := \limsup_n A_n = \bigcap_{N = 1}^\infty \bigcup_{n = N}^\infty A_n.

Its complement is the event ”AnA_n occurs only finitely many times”:

{An f.o.}=(lim supnAn)c=lim infnAnc=N=1n=NAnc.\{A_n \text{ f.o.}\} = (\limsup_n A_n)^c = \liminf_n A_n^c = \bigcup_{N = 1}^\infty \bigcap_{n = N}^\infty A_n^c.

💡 Remark 7 (Set-theoretic limsup, revisited)

The definition is the set-theoretic limsup the reader saw in Sequences, Limits & Convergence translated into events. A point ωΩ\omega \in \Omega is in lim supnAn\limsup_n A_n precisely when ω\omega belongs to infinitely many of the AnA_n. The “for every NN there exists nNn \geq N” structure of the definition is exactly the standard NnN\forall N \, \exists n \geq N unwinding of “infinitely often.”

The complementation rule (lim supAn)c=lim infAnc(\limsup A_n)^c = \liminf A_n^c — a countable De Morgan — is used in the proof of the second Borel–Cantelli lemma. Verify by chasing definitions:

(NnNAn)c=NnNAnc.\left(\bigcap_N \bigcup_{n \geq N} A_n\right)^c = \bigcup_N \bigcap_{n \geq N} A_n^c.

🔷 Theorem 3 (First Borel–Cantelli lemma)

If nP(An)<\sum_n P(A_n) < \infty, then

P(An i.o.)=0.P(A_n \text{ i.o.}) = 0.

Proof.

By monotonicity of PP and Boole’s inequality, for every N1N \geq 1:

P ⁣(nNAn)nNP(An).P\!\left(\bigcup_{n \geq N} A_n\right) \leq \sum_{n \geq N} P(A_n).

Since nP(An)<\sum_n P(A_n) < \infty, the tail of the series satisfies nNP(An)0\sum_{n \geq N} P(A_n) \to 0 as NN \to \infty — this is the definition of convergence of a series of non-negative terms (see Series Convergence & Tests).

Now {An i.o.}=NnNAn\{A_n \text{ i.o.}\} = \bigcap_N \bigcup_{n \geq N} A_n is a decreasing intersection: as NN grows, fewer terms are in the union, so nNAn\bigcup_{n \geq N} A_n shrinks. By continuity of probability (Proposition 1(v) applied to complements, or its mirror image for decreasing sequences):

P(An i.o.)=limNP ⁣(nNAn)limNnNP(An)=0.P(A_n \text{ i.o.}) = \lim_{N \to \infty} P\!\left(\bigcup_{n \geq N} A_n\right) \leq \lim_{N \to \infty} \sum_{n \geq N} P(A_n) = 0.

Since probabilities are non-negative, P(An i.o.)=0P(A_n \text{ i.o.}) = 0. \blacksquare

🔷 Theorem 4 (Second Borel–Cantelli lemma)

If the events (An)(A_n) are mutually independent and nP(An)=\sum_n P(A_n) = \infty, then

P(An i.o.)=1.P(A_n \text{ i.o.}) = 1.

Proof.

It suffices to show that P ⁣(nNAnc)=0P\!\left(\bigcap_{n \geq N} A_n^c\right) = 0 for every NN, because then by countable subadditivity (Boole) on the union NnNAnc\bigcup_N \bigcap_{n \geq N} A_n^c, the event {An f.o.}\{A_n \text{ f.o.}\} has probability 00 and its complement {An i.o.}\{A_n \text{ i.o.}\} has probability 11.

Fix NN and any finite truncation MNM \geq N. By mutual independence of the AnA_n‘s, the events ANc,AN+1c,,AMcA_N^c, A_{N+1}^c, \ldots, A_M^c are also mutually independent (the complement of an independent event is independent of the original family). So

P ⁣(n=NMAnc)=n=NMP(Anc)=n=NM(1P(An)).P\!\left(\bigcap_{n = N}^M A_n^c\right) = \prod_{n = N}^M P(A_n^c) = \prod_{n = N}^M (1 - P(A_n)).

Use the inequality 1xex1 - x \leq e^{-x} for x[0,1]x \in [0, 1] on each factor:

n=NM(1P(An))n=NMeP(An)=exp ⁣(n=NMP(An)).\prod_{n = N}^M (1 - P(A_n)) \leq \prod_{n = N}^M e^{-P(A_n)} = \exp\!\left(- \sum_{n = N}^M P(A_n)\right).

Now let MM \to \infty. The partial sum n=NMP(An)\sum_{n = N}^M P(A_n) diverges to ++\infty (because the full series does, and the partial sum from NN onward differs from the full sum by a finite quantity). So the exponential tends to 00:

P ⁣(nNAnc)=limMP ⁣(n=NMAnc)limMexp ⁣(n=NMP(An))=0.P\!\left(\bigcap_{n \geq N} A_n^c\right) = \lim_{M \to \infty} P\!\left(\bigcap_{n = N}^M A_n^c\right) \leq \lim_{M \to \infty} \exp\!\left(- \sum_{n = N}^M P(A_n)\right) = 0.

The first equality uses continuity of probability for decreasing intersections (Proposition 1(v) applied to complements). Since probabilities are non-negative, P(nNAnc)=0P(\bigcap_{n \geq N} A_n^c) = 0. \blacksquare

The two lemmas are not symmetric. The first uses only countable subadditivity and the convergence of a series — no independence. The second requires independence (or some substitute, like pairwise independence with a Kolmogorov-style covariance bound), and the inequality 1xex1 - x \leq e^{-x} does the work that 1xex1 - x \approx e^{-x} would do asymptotically. Two examples make the transition between the two regimes concrete.

📝 Example 10 (The harmonic-versus-quadratic threshold)

Take independent events with P(An)=1/nαP(A_n) = 1/n^\alpha. The series n1/nα\sum_n 1/n^\alpha converges iff α>1\alpha > 1 (the pp-series test from Series Convergence & Tests). So:

  • α>1\alpha > 1: BC-I applies, P(An i.o.)=0P(A_n \text{ i.o.}) = 0. The events stop occurring after some finite point with probability one.
  • α1\alpha \leq 1: BC-II applies, P(An i.o.)=1P(A_n \text{ i.o.}) = 1. The events recur forever.

The threshold is exactly at α=1\alpha = 1 — the harmonic series. The accompanying interactive visualization sweeps α\alpha across the threshold and shows the cumulative-indicator trajectories diverging or stabilizing in real time.

📝 Example 11 (Independence cannot be dropped from BC-II)

Take all events equal: An=A1A_n = A_1 for every nn, with P(A1)=p(0,1)P(A_1) = p \in (0, 1). The events are not independent — they are perfectly dependent — and nP(An)=\sum_n P(A_n) = \infty trivially. But

P(An i.o.)=P(A1)=p,P(A_n \text{ i.o.}) = P(A_1) = p,

which is not 11 in general. Independence is what makes the BC-II conclusion robust: under independence, the divergent sum forces the product (1P(An))\prod (1 - P(A_n)) to 00; without it, the joint probabilities can conspire to keep the all-fail event positive.

There are partial substitutes — pairwise independence plus a Kolmogorov bound on covariances, exchangeability, etc. — but they are downstream of the full machinery of conditional expectation, and we defer them to Sigma-Algebras & Measures (forward) and to formalStatistics’s hypothesis-testing topic.

The viz below lets you toggle between pn=1/np_n = 1/n (BC-II divergent) and pn=1/n2p_n = 1/n^2 (BC-I convergent), and watch the trajectories diverge or stabilize. The power-law slider sweeps α\alpha across the threshold at α=1\alpha = 1.

BC-I regime (∑ p_n < ∞, prob 0)
∑_{k ≤ N} p_k
1.643
mean indicator-sum @ N
1.88
max indicator-sum @ N
4

When ∑ p_n is bounded (BC-I), trajectories stabilize — the indicator-sum stops growing. When ∑ p_n diverges and the events are independent (BC-II), trajectories grow without bound, tracking the partial-sum curve in expectation.

Two-panel snapshot of the Borel-Cantelli dichotomy: left panel shows cumulative occurrences for p_n = 1/n^2 (BC-I, stabilizes at finite count); right panel shows the same for p_n = 1/n (BC-II, diverges, tracks log n).

💡 Remark 8 (Toward Kolmogorov's 0–1 law)

The Borel–Cantelli lemmas are special cases of a deeper structural fact: any tail event of an independent sequence — an event in the σ-algebra generated by {An,An+1,An+2,}\{A_n, A_{n+1}, A_{n+2}, \ldots\} for every NN — has probability 00 or 11. The event {An i.o.}\{A_n \text{ i.o.}\} is a tail event by construction. Kolmogorov’s 0–1 law extends this to any tail event of an independent sequence, including the event “the Strong Law of Large Numbers holds for this sequence” (i.e., Xˉnμ\bar X_n \to \mu). The full statement and proof require the measure-theoretic σ-algebra apparatus of Sigma-Algebras & Measures (forward) and is the entry point to the Strong Law and the law of the iterated logarithm.

7. Markov’s and Chebyshev’s Inequalities

The Borel–Cantelli lemmas convert “probability of an asymptotic event” into “convergence of a series.” We now turn to the other half of the picture: bounding P(Xa)P(X \geq a) — the probability that a single random variable exceeds a threshold — by an expectation. The first two rungs of the concentration ladder are short and useful; both are direct corollaries of the axioms.

🔷 Theorem 5 (Markov's inequality)

Let XX be a non-negative random variable with finite expectation E[X]E[X], and let a>0a > 0. Then

P(Xa)E[X]a.P(X \geq a) \leq \frac{E[X]}{a}.

Proof.

For X0X \geq 0 and a>0a > 0, observe the pointwise inequality

a1{Xa}X.a \cdot \mathbf{1}_{\{X \geq a\}} \leq X.

To see it: on the event {Xa}\{X \geq a\}, the indicator is 11, so the left-hand side is aa, and aXa \leq X by hypothesis; on the complement, the indicator is 00, so the left-hand side is 00, and 0X0 \leq X since X0X \geq 0. Taking expectations of both sides (using linearity and monotonicity of expectation),

aP(Xa)=E[a1{Xa}]E[X].a \, P(X \geq a) = E[a \cdot \mathbf{1}_{\{X \geq a\}}] \leq E[X].

Divide by a>0a > 0. \blacksquare

Markov is a one-line inequality whose strength is its lack of assumptions: no second moment, no boundedness, no independence — just non-negativity and a finite mean. The price is looseness: a bound polynomial in aa rather than exponential. The geometric reading sharpens the intuition.

💡 Remark 9 (Geometric reading of Markov)

For non-negative XX, the tail-integral identity from Improper Integrals & Special Functions

E[X]=0P(X>t)dtE[X] = \int_0^\infty P(X > t) \, dt

says the area under the survival curve tP(X>t)t \mapsto P(X > t) equals the mean. Markov’s inequality says that no rectangle inscribed under the survival curve can have area greater than the total area:

aP(Xa)0P(X>t)dt=E[X].a \cdot P(X \geq a) \leq \int_0^\infty P(X > t) \, dt = E[X].

The rectangle in question has width aa and height P(Xa)P(X \geq a), and it fits under the survival curve because the survival function is non-increasing.

Survival curve P(X > t) for an Exp(1) random variable, with the Markov rectangle of width a and height P(X ≥ a) shaded under the curve. The rectangle's area cannot exceed the total area, which equals E[X].

Chebyshev’s inequality is the next rung. It is not a new technique — it is Markov applied to a particular transformation of XX.

🔷 Theorem 6 (Chebyshev's inequality)

Let XX be a random variable with E[X]=μE[X] = \mu and finite variance σ2=Var(X)<\sigma^2 = \mathrm{Var}(X) < \infty. Then for any ϵ>0\epsilon > 0:

P(Xμϵ)σ2ϵ2.P(|X - \mu| \geq \epsilon) \leq \frac{\sigma^2}{\epsilon^2}.

Proof.

Apply Markov’s inequality to the non-negative random variable Y=(Xμ)2Y = (X - \mu)^2 at the threshold a=ϵ2a = \epsilon^2:

P(Yϵ2)E[Y]ϵ2=Var(X)ϵ2=σ2ϵ2.P(Y \geq \epsilon^2) \leq \frac{E[Y]}{\epsilon^2} = \frac{\mathrm{Var}(X)}{\epsilon^2} = \frac{\sigma^2}{\epsilon^2}.

But {Yϵ2}={(Xμ)2ϵ2}={Xμϵ}\{Y \geq \epsilon^2\} = \{(X - \mu)^2 \geq \epsilon^2\} = \{|X - \mu| \geq \epsilon\}. So P(Xμϵ)σ2/ϵ2P(|X - \mu| \geq \epsilon) \leq \sigma^2 / \epsilon^2. \blacksquare

Chebyshev gives a polynomial tail 1/ϵ21/\epsilon^2 rather than the constant 1/ϵ1/\epsilon of Markov — a strict improvement whenever ϵ\epsilon is large enough that the squaring helps. It is also distribution-free: any random variable with finite variance gets the same bound. The single most important application is the Weak Law of Large Numbers.

📝 Example 12 (Chebyshev gives a 1/n rate (Weak Law of Large Numbers))

Let X1,X2,,XnX_1, X_2, \ldots, X_n be independent and identically distributed with mean μ\mu and finite variance σ2\sigma^2. Let Xˉn=1ni=1nXi\bar X_n = \frac{1}{n} \sum_{i=1}^n X_i be the sample mean. By the linearity of expectation and the variance of an independent sum,

E[Xˉn]=μ,Var(Xˉn)=σ2n.E[\bar X_n] = \mu, \quad \mathrm{Var}(\bar X_n) = \frac{\sigma^2}{n}.

Chebyshev applied to Xˉn\bar X_n gives, for any ϵ>0\epsilon > 0:

P(Xˉnμϵ)σ2nϵ2.P(|\bar X_n - \mu| \geq \epsilon) \leq \frac{\sigma^2}{n \epsilon^2}.

As nn \to \infty, the right-hand side tends to 00, so Xˉnμ\bar X_n \to \mu in probability. This is the Weak Law of Large Numbers, derived from one inequality. The rate is polynomial in nn: doubling nn halves the bound.

Hoeffding’s inequality (Theorem 7 below) replaces this polynomial rate with an exponential one when the XiX_i are bounded — a strict improvement for moderate-to-large deviations.

💡 Remark 10 (Why Chebyshev is loose for sub-Gaussian tails)

For a Gaussian random variable XN(0,1)X \sim N(0, 1), the actual tail is P(Xt)2et2/2P(|X| \geq t) \leq 2 e^{-t^2 / 2} — exponentially decaying. Chebyshev gives only 1/t21/t^2 — polynomial. At t=3t = 3, the Gaussian tail is 0.0027\approx 0.0027, while Chebyshev says 1/90.111\leq 1/9 \approx 0.111 — off by nearly two orders of magnitude.

This gap between polynomial Chebyshev bounds and exponential true tails is what motivates Hoeffding’s inequality: when we know more about the random variable (boundedness, sub-Gaussian moment generating function), we can replace the polynomial decay with an exponential one. The MGF method developed in §8 is the standard route.

8. Hoeffding’s Inequality

The third rung of the concentration ladder. Hoeffding’s inequality replaces Chebyshev’s polynomial 1/n1/n decay with an exponential e2nϵ2e^{-2n\epsilon^2} decay, at the cost of one additional hypothesis: that the random variables are bounded. The proof is the canonical moment-generating-function method of concentration, and it is short.

📐 Definition 5 (Moment generating function)

For a random variable XX, the moment generating function (MGF) is

MX(t)=E[etX],M_X(t) = E[e^{tX}],

defined for those tRt \in \mathbb{R} at which the expectation is finite.

💡 Remark 11 (MGF as a self-contained tool)

This is the only place in the topic where the MGF appears. We use it as a single technical device: XX has a small MGF \Leftrightarrow XX has light tails. Markov’s inequality applied to the non-negative random variable etXe^{tX} converts a bound on the MGF into a bound on P(Xa)P(X \geq a). The rigorous Lebesgue-integral foundations of expectation, conditions for the MGF to exist in a neighborhood of 00, and the Cramér–Chernoff method are developed in The Lebesgue Integral (forward) and in formalML’s Concentration Inequalities → formalML. Here we treat the MGF as a black box that produces the bound.

The technical heart of the proof is the following lemma, which bounds the MGF of a centered bounded random variable by a Gaussian-like envelope.

🔶 Lemma 1 (Hoeffding's lemma)

If XX is a random variable with E[X]=0E[X] = 0 and aXba \leq X \leq b almost surely, then for every tRt \in \mathbb{R}:

E[etX]exp ⁣(t2(ba)28).E[e^{tX}] \leq \exp\!\left(\frac{t^2 (b - a)^2}{8}\right).

Proof.

Proof sketch. The function xetxx \mapsto e^{tx} is convex. For x[a,b]x \in [a, b], convexity gives the chord bound

etxbxbaeta+xabaetb.e^{tx} \leq \frac{b - x}{b - a} e^{ta} + \frac{x - a}{b - a} e^{tb}.

Take expectations on both sides, using E[X]=0E[X] = 0:

E[etX]bbaetaabaetb=:eϕ(t),E[e^{tX}] \leq \frac{b}{b - a} e^{ta} - \frac{a}{b - a} e^{tb} =: e^{\phi(t)},

where ϕ(t)\phi(t) is the logarithm of the right-hand side. Direct calculus shows ϕ(0)=0\phi(0) = 0, ϕ(0)=0\phi'(0) = 0, and ϕ(t)(ba)2/4\phi''(t) \leq (b - a)^2 / 4 uniformly in tt. By Taylor’s theorem (see Taylor Series and Polynomial Approximation),

ϕ(t)t2(ba)28.\phi(t) \leq \frac{t^2 (b - a)^2}{8}.

Exponentiating gives the claim. The full algebra is performed in the companion notebook. \blacksquare

With Hoeffding’s lemma in hand, the proof of Hoeffding’s inequality is a clean application of Markov, independence, and a one-variable optimization.

🔷 Theorem 7 (Hoeffding's inequality)

Let X1,X2,,XnX_1, X_2, \ldots, X_n be independent random variables with aiXibia_i \leq X_i \leq b_i almost surely. Let Sn=i=1nXiS_n = \sum_{i=1}^n X_i. Then for any t>0t > 0:

P(SnE[Sn]t)exp ⁣(2t2i=1n(biai)2).P(S_n - E[S_n] \geq t) \leq \exp\!\left(-\frac{2 t^2}{\sum_{i=1}^n (b_i - a_i)^2}\right).

The symmetric two-sided form follows by union bound on the two one-sided events:

P(SnE[Sn]t)2exp ⁣(2t2i=1n(biai)2).P(|S_n - E[S_n]| \geq t) \leq 2 \exp\!\left(-\frac{2 t^2}{\sum_{i=1}^n (b_i - a_i)^2}\right).

Proof.

Full proof. Without loss of generality assume each E[Xi]=0E[X_i] = 0 (otherwise subtract the means; the bound is unchanged). The proof proceeds in five steps, each rendered as its own display block to keep the KaTeX-renderable structure clean.

Step 1. Apply Markov’s inequality to the non-negative random variable eλSne^{\lambda S_n} at the threshold eλte^{\lambda t} (for any λ>0\lambda > 0):

P(Snt)=P(eλSneλt)eλtE[eλSn].P(S_n \geq t) = P(e^{\lambda S_n} \geq e^{\lambda t}) \leq e^{-\lambda t} \, E[e^{\lambda S_n}].

Step 2. By independence of the XiX_i, the MGF of SnS_n factors:

E[eλSn]=E ⁣[i=1neλXi]=i=1nE[eλXi].E[e^{\lambda S_n}] = E\!\left[\prod_{i=1}^n e^{\lambda X_i}\right] = \prod_{i=1}^n E[e^{\lambda X_i}].

Step 3. Apply Hoeffding’s lemma to each XiX_i (centered, bounded in [ai,bi][a_i, b_i]):

E[eλXi]exp ⁣(λ2(biai)28).E[e^{\lambda X_i}] \leq \exp\!\left(\frac{\lambda^2 (b_i - a_i)^2}{8}\right).

Multiply across ii to obtain E[eλSn]exp ⁣(λ28i(biai)2)E[e^{\lambda S_n}] \leq \exp\!\left(\frac{\lambda^2}{8} \sum_i (b_i - a_i)^2\right).

Step 4. Combine Steps 1 and 3:

P(Snt)exp ⁣(λt+λ28i=1n(biai)2).P(S_n \geq t) \leq \exp\!\left(-\lambda t + \frac{\lambda^2}{8} \sum_{i=1}^n (b_i - a_i)^2\right).

Step 5. The right-hand side is a quadratic in λ\lambda; its minimum over λ>0\lambda > 0 is at λ=4t/i(biai)2\lambda^* = 4t / \sum_i (b_i - a_i)^2. Substituting back:

P(Snt)exp ⁣(2t2i=1n(biai)2).P(S_n \geq t) \leq \exp\!\left(-\frac{2 t^2}{\sum_{i=1}^n (b_i - a_i)^2}\right).

This is the one-sided bound. The two-sided bound follows by applying the same argument to Xi-X_i (which gives P(Snt)exp()P(S_n \leq -t) \leq \exp(\cdots)) and combining the two one-sided events via Boole’s inequality, contributing the factor of 22. \blacksquare

The most common form in practice is the i.i.d. average over [0,1][0, 1]-bounded variables.

🔷 Corollary 2 (Hoeffding for i.i.d. averages on [0, 1])

Let X1,,XnX_1, \ldots, X_n be i.i.d. with Xi[0,1]X_i \in [0, 1], and let Xˉn=1ni=1nXi\bar X_n = \frac{1}{n} \sum_{i=1}^n X_i. Then for any ϵ>0\epsilon > 0:

P(XˉnE[X]ϵ)2exp(2nϵ2).P(|\bar X_n - E[X]| \geq \epsilon) \leq 2 \exp(-2 n \epsilon^2).

Proof.

Apply Theorem 7 to Sn=XiS_n = \sum X_i with ai=0,bi=1a_i = 0, b_i = 1 for every ii and t=nϵt = n \epsilon. The denominator (biai)2=n\sum (b_i - a_i)^2 = n, so the exponent becomes 2(nϵ)2/n=2nϵ2-2 (n \epsilon)^2 / n = -2 n \epsilon^2. \blacksquare

📝 Example 13 (Hoeffding vs. Chebyshev on Bernoulli sums)

Let X1,,XnX_1, \ldots, X_n be i.i.d. Bernoulli(1/2)(1/2), Sn=XiS_n = \sum X_i. The variance of SnS_n is n/4n/4, so by Chebyshev, P(Snn/2nk)1/(4k2)P(|S_n - n/2| \geq \sqrt n \cdot k) \leq 1/(4 k^2). By Hoeffding (Corollary 2 applied to Xˉn\bar X_n with ϵ=k/n\epsilon = k / \sqrt n), the same tail is at most 2exp(2k2)2 \exp(-2 k^2).

At k=3k = 3 standard deviations: Chebyshev gives 1/(49)0.028\leq 1/(4 \cdot 9) \approx 0.028, Hoeffding gives 2e183×108\leq 2 e^{-18} \approx 3 \times 10^{-8}. Hoeffding is six orders of magnitude tighter at three sigmas. At k=5k = 5, the gap is 1016\sim 10^{16}. The accompanying visualization plots all three bounds against the empirical Monte Carlo tail and shows the gap visually.

💡 Remark 12 (Where Hoeffding falls short)

Hoeffding’s inequality only knows the range [ai,bi][a_i, b_i] of each XiX_i, not the variance. For random variables with small variance but large range — say Xi=1000X_i = 1000 with probability 10610^{-6} and 00 otherwise — Hoeffding’s bound is wasteful: it scales with (biai)2=106(b_i - a_i)^2 = 10^6, but the actual variance is σ2103\sigma^2 \approx 10^{-3}. Bernstein’s and Bennett’s inequalities replace the range with the variance and recover exponentially tighter bounds in this regime. These live in formalML’s Concentration Inequalities → formalML and are the natural successors to Hoeffding.

The interactive visualization below overlays the empirical sample-mean tail against Markov, Chebyshev, and Hoeffding for a chosen distribution. On the log scale, Hoeffding shows up as a straight line whose slope steepens with nn; Chebyshev curves more slowly; Markov is approximately constant. The empirical tail tracks Hoeffding closely — much more closely than it tracks Chebyshev.

Five-step proof-flow schematic for Hoeffding's inequality: Markov on e^{λS_n}, independence factorization, Hoeffding's lemma, combine, optimize over λ — leading to exp(-2t²/Σ(b_i - a_i)²).
empirical (Monte Carlo)
Markov on |X| (often vacuous)
Chebyshev σ² / (n ε²)
Hoeffding 2 exp(−2 n ε²)
At ε ≈ 0.10:
empirical
1.75e-3
Markov
1.00e+0
Chebyshev
1.25e-1
Hoeffding
3.66e-2

Click anywhere on the plot to move the dashed vertical probe and read off the four bounds. On the log axis, Hoeffding is a straight line of slope −2n; the empirical tail tracks it; Chebyshev decays polynomially; Markov is approximately constant.

Tail probability P(|X̄_n - μ| ≥ ε) for a Bernoulli(0.5) sample mean with n=100, log y-axis. Empirical Monte Carlo (black dots), Markov on |X| (grey, vacuous), Chebyshev σ²/(nε²) (orange), Hoeffding 2 exp(-2nε²) (red). Hoeffding tracks the empirical tail; Chebyshev is several orders of magnitude looser.

9. The Union Bound + Concentration Pattern

This is the ML synthesis. Hoeffding gives a per-event tail bound. The union bound combines mm per-event bounds into a single uniform bound. The result has the per-event deviation grow only by logm\sqrt{\log m}, regardless of mm — a fact so remarkable that essentially the entire learning-theoretic literature is built on it.

🔷 Theorem 8 (Uniform Hoeffding bound over a finite class)

Let H\mathcal{H} be a finite collection of indices (“hypotheses”). For each hHh \in \mathcal{H}, let X1,h,,Xn,hX_{1, h}, \ldots, X_{n, h} be i.i.d. random variables with Xi,h[0,1]X_{i, h} \in [0, 1] and E[Xi,h]=μhE[X_{i, h}] = \mu_h, and let μ^h=1ni=1nXi,h\hat \mu_h = \frac{1}{n} \sum_{i=1}^n X_{i, h}. Then for any δ(0,1)\delta \in (0, 1):

P ⁣(maxhHμ^hμhlog(2H/δ)2n)δ.P\!\left(\max_{h \in \mathcal{H}} |\hat \mu_h - \mu_h| \geq \sqrt{\frac{\log(2 |\mathcal{H}| / \delta)}{2 n}}\right) \leq \delta.

Proof.

Fix ϵ=log(2H/δ)/(2n)\epsilon = \sqrt{\log(2 |\mathcal{H}| / \delta) / (2 n)}. For each fixed hHh \in \mathcal{H}, Corollary 2 gives

P(μ^hμhϵ)2e2nϵ2.P(|\hat \mu_h - \mu_h| \geq \epsilon) \leq 2 e^{-2 n \epsilon^2}.

Substitute the chosen ϵ\epsilon:

2e2nϵ2=2exp(log(2H/δ))=2δ2H=δH.2 e^{-2 n \epsilon^2} = 2 \exp(-\log(2 |\mathcal{H}| / \delta)) = 2 \cdot \frac{\delta}{2 |\mathcal{H}|} = \frac{\delta}{|\mathcal{H}|}.

Now apply Boole’s inequality across hHh \in \mathcal{H}:

P ⁣(hH{μ^hμhϵ})hHP(μ^hμhϵ)HδH=δ.P\!\left(\bigcup_{h \in \mathcal{H}} \{|\hat \mu_h - \mu_h| \geq \epsilon\}\right) \leq \sum_{h \in \mathcal{H}} P(|\hat \mu_h - \mu_h| \geq \epsilon) \leq |\mathcal{H}| \cdot \frac{\delta}{|\mathcal{H}|} = \delta.

The event {maxhμ^hμhϵ}\{\max_h |\hat \mu_h - \mu_h| \geq \epsilon\} equals the union event on the left, so its probability is at most δ\delta. \blacksquare

💡 Remark 13 (The log m tax)

The takeaway in one sentence: the price of taking a union over mm events with Hoeffding tails is logm\sqrt{\log m} inside the deviation, not m\sqrt{m}. To bound the maximum of mm Hoeffding-tailed sample means at confidence 1δ1 - \delta, we needed per-event deviation ϵ=log(2m/δ)/(2n)\epsilon = \sqrt{\log(2 m / \delta) / (2 n)} — which grows like logm\sqrt{\log m}, an extremely slow function of mm. Doubling mm adds only log20.83\sqrt{\log 2} \approx 0.83 to the logarithm of the deviation; multiplying mm by 10001000 multiplies the deviation by log1000/log23.16\sqrt{\log 1000 / \log 2} \approx 3.16 at fixed δ,n\delta, n.

This is the entire engine of uniform convergence in learning theory: exponentially many bad events, only logarithmically more deviation. Replace finite classes with covering / VC arguments and the same conclusion extends to continuous hypothesis classes — the unifying idea is preserved.

📝 Example 14 (The PAC generalization bound)

Let H\mathcal{H} be a finite hypothesis class, and let R^(h)=1ni=1n1{h(xi)yi}\hat R(h) = \frac{1}{n} \sum_{i=1}^n \mathbf{1}_{\{h(x_i) \neq y_i\}} be the training error of hypothesis hh on nn i.i.d. samples (xi,yi)(x_i, y_i), with true risk R(h)=E[R^(h)]R(h) = E[\hat R(h)]. By Theorem 8 applied to Xi,h=1{h(xi)yi}X_{i,h} = \mathbf{1}_{\{h(x_i) \neq y_i\}}:

With probability at least 1δ1 - \delta, simultaneously for every hHh \in \mathcal{H}:

R^(h)R(h)log(2H/δ)2n.|\hat R(h) - R(h)| \leq \sqrt{\frac{\log(2 |\mathcal{H}| / \delta)}{2 n}}.

Let h^=argminhHR^(h)\hat h = \arg\min_{h \in \mathcal{H}} \hat R(h) be the empirical risk minimizer (ERM), and let h=argminhHR(h)h^* = \arg\min_{h \in \mathcal{H}} R(h) be the best-in-class hypothesis. Then with the same probability,

R(h^)R^(h^)+ϵR^(h)+ϵR(h)+2ϵ,R(\hat h) \leq \hat R(\hat h) + \epsilon \leq \hat R(h^*) + \epsilon \leq R(h^*) + 2 \epsilon,

where ϵ=log(2H/δ)/(2n)\epsilon = \sqrt{\log(2 |\mathcal{H}|/\delta) / (2 n)}. The first inequality uses the uniform bound on h^\hat h; the second uses that h^\hat h minimizes R^\hat R; the third uses the uniform bound on hh^*. So the ERM’s true risk is within 2ϵ2 \epsilon of the best-in-class true risk — and ϵ\epsilon shrinks like 1/n1/\sqrt n while growing only as logH\sqrt{\log |\mathcal{H}|}.

This is the canonical PAC bound for finite hypothesis classes. Forward link: Generalization Bounds → formalML for VC dimension and Rademacher complexity, which replace logH\log|\mathcal{H}| with structural complexity measures for infinite classes.

📝 Example 15 (UCB bandit confidence intervals)

In a KK-armed bandit, pulling arm aa at time tt produces a reward Xa,t[0,1]X_{a, t} \in [0, 1] i.i.d. with unknown mean μa\mu_a. After nan_a pulls of arm aa, the empirical mean is μ^a=1nat:at=aXa,t\hat \mu_a = \frac{1}{n_a} \sum_{t : a_t = a} X_{a, t}. By Hoeffding, for any δ0>0\delta_0 > 0:

P ⁣(μ^aμalog(2/δ0)2na)δ0.P\!\left(|\hat \mu_a - \mu_a| \geq \sqrt{\frac{\log(2 / \delta_0)}{2 n_a}}\right) \leq \delta_0.

The Upper-Confidence-Bound (UCB) algorithm pulls the arm with the largest μ^a+confidence width\hat \mu_a + \text{confidence width}. To guarantee simultaneous validity over all KK arms and TT time steps, set δ0=δ/(KT)\delta_0 = \delta / (K T) and apply Boole over the KTK T arm-time pairs: with probability 1δ1 - \delta, all confidence intervals are simultaneously valid throughout the horizon. The resulting confidence width log(2KT/δ)/(2na)\sqrt{\log(2 K T / \delta) / (2 n_a)} is exactly the UCB exploration bonus.

Forward link: Multi-Armed Bandits → formalML, where the same construction is the core of the algorithm’s regret analysis.

Three-panel PAC bound visualization: (a) per-hypothesis Hoeffding tail at n=1000; (b) union-bound stacking |H|·2exp(-2nε²) for |H|=10, 100, 1000; (c) PAC deviation √(log(2|H|/δ)/(2n)) versus n for four hypothesis-class sizes.

10. Computational Notes

The inequalities of §§4–9 are useful precisely because they are computable. A few pragmatic notes on how the calculations work in practice — and where they fail numerically — follow.

  • Estimating P(A) by simulation. The empirical frequency p^n=1ni=1n1{XiA}\hat p_n = \frac{1}{n} \sum_{i=1}^n \mathbf{1}_{\{X_i \in A\}} is unbiased for P(A)P(A) and has standard error P(A)(1P(A))/n\sqrt{P(A)(1 - P(A))/n}. By Hoeffding (Corollary 2), a distribution-free 1δ1 - \delta confidence interval is p^n±log(2/δ)/(2n)\hat p_n \pm \sqrt{\log(2/\delta)/(2n)}. NumPy idiom: rng = np.random.default_rng(seed); samples = rng.uniform(0, 1, n); phat = np.mean(condition(samples)).

  • Simulating Borel–Cantelli. Independent events with P(An)=pnP(A_n) = p_n are drawn by rng.uniform(0, 1, N) < p_n_array. The cumulative count kN1Ak\sum_{k \leq N} \mathbf{1}_{A_k} stabilizes (BC-I) or diverges (BC-II) — this is the cleanest pedagogical demonstration of the dichotomy and is exactly what the BorelCantelliExplorer viz reproduces.

  • Numerical pitfall: 1(1p)m1 - (1 - p)^m versus 1exp(mp)1 - \exp(-m p). When mpm p is small, both expressions are close — but the naive form 1(1p)m1 - (1-p)^m in floating point can lose all significant digits to subtractive cancellation when p1010p \approx 10^{-10} and mm is moderate. Use -numpy.expm1(-m * p) or the closely related 1 - numpy.exp(-m * p) for the latter form, both of which are numerically stable. The oneMinusOneMinusPToTheM helper in src/components/viz/shared/probability.ts wraps this.

  • scipy.stats tail probabilities. For a scipy.stats.norm random variable, 1 - cdf(t) and the equivalent survival function sf(t) return P(X>t)P(X > t) for the standard Gaussian. The notebook compares these exact tail values against Markov, Chebyshev, and Hoeffding bounds for several distributions — the Hoeffding bound is not applicable to Gaussians (unbounded support), which is why Markov on etXe^{tX} is replaced by sub-Gaussian arguments in formalML.

📝 Example 16 (Monte Carlo verification of the union bound)

A 10-line check on the flagship visualization’s claim. Place m=5m = 5 events as circular regions on the unit square with prescribed pairwise overlaps. Generate N=106N = 10^6 uniform samples on [0,1]2[0, 1]^2. The empirical P(Ai)P(\bigcup A_i) is the fraction of samples falling in at least one circle; the union-bound estimate is the sum of the per-circle areas. Inclusion–exclusion gives the exact analytic value via the closed-form circle-intersection identity. The three quantities should satisfy

empiricalinclusion–exclusion exactunion-bound estimate\text{empirical} \approx \text{inclusion–exclusion exact} \leq \text{union-bound estimate}

with the gap between the last two growing as the overlap grows. The companion notebook computes this for the three flagship presets and reports the ratio of the upper bound to the exact value — values near 11 confirm tightness, values 1\gg 1 confirm looseness.

11. Connections to Statistics

The union bound is the single inequality that does more work in classical and modern statistics than any other.

  • Family-wise error rate control. Bonferroni’s procedure is the cleanest application of the union bound in all of statistics. Holm’s step-down procedure tightens Bonferroni by combining the union bound with a closed-testing principle, and remains a single-page proof. Both procedures control the family-wise error rate (FWER) at level α\alpha regardless of dependence among the mm tests, at the cost of testing each hypothesis at level α/m\alpha / m. Forward link: Multiple Testing and False Discovery → formalStatistics for FDR control (Benjamini–Hochberg), which sacrifices FWER for a softer error guarantee and a much higher discovery rate.

  • Confidence intervals from Hoeffding. For a sample mean of bounded random variables, the Hoeffding CI p^n±log(2/δ)/(2n)\hat p_n \pm \sqrt{\log(2/\delta)/(2 n)} is distribution-free and exact (not asymptotic). This is the textbook “exact” CI used when normal approximations cannot be trusted, e.g., for small nn or when the underlying distribution is unknown. Forward link: Hypothesis Testing → formalStatistics.

  • Multi-arm A/B tests. Running KK simultaneous A/B tests with a shared overall error budget is a union-bound problem. The Bonferroni-corrected interval for the difference in means in each test gives a simultaneous 1α1 - \alpha confidence region for all KK differences. The same Hoeffding-plus-union-bound machinery from §9 underlies the modern always-valid sequential testing literature, where confidence intervals are valid at all stopping times rather than at a fixed sample size.

Family-wise error rate as a function of the number of tests m, for three procedures: no correction (rises from α toward 1 - exp(-α)), Bonferroni (flat at ≈ α), Holm step-down (identical to Bonferroni under independence). The target FWER α = 0.05 is marked.

12. Connections to ML

The union bound is the bridge from probability to learning theory. Four threads, in increasing order of generality.

  • PAC learning and generalization bounds. The combination of Hoeffding (per-hypothesis concentration) and the union bound (over a finite hypothesis class) gives the canonical generalization bound for empirical risk minimization (Example 14). For infinite classes, the union bound is replaced by a covering / VC argument, but the structural idea — “convert per-event tails into uniform tails” — is preserved. Forward link: Generalization Bounds → formalML.

  • Multi-armed bandits. The UCB family of algorithms uses Hoeffding-plus-union-bound to construct simultaneous confidence intervals for arm means; the algorithm’s regret bound is a direct application of this construction (Example 15). Forward link: Multi-Armed Bandits → formalML.

  • Concentration inequalities, full hierarchy. Markov, Chebyshev, and Hoeffding are the foundational rungs of concentration. Sub-Gaussian and sub-exponential random variables (the next rungs) extend the MGF method introduced in §8 to unbounded variables with controlled tails. The Cramér–Chernoff method, Bernstein’s inequality, McDiarmid’s bounded-differences inequality, and Talagrand’s inequality all live downstream. Forward link: Concentration Inequalities → formalML.

  • Importance-sampling diagnostics. The effective sample size neff=(iwi)2/iwi2n_{\text{eff}} = (\sum_i w_i)^2 / \sum_i w_i^2 in importance sampling is monitored against the Hoeffding-style confidence width. When the importance weights are unbounded, Hoeffding breaks (its hypothesis fails) and one falls back to Chebyshev with the variance of the weights — a strictly looser bound. The connection between weight variance and tail control is one of the cleanest illustrations of why the Markov → Chebyshev → Hoeffding ladder matters. Forward link: Radon-Nikodym & Probability Densities (importance sampling section).

  • Sub-Gaussian noise in stochastic optimization. SGD’s convergence guarantees under bounded-noise assumptions reduce to applying Hoeffding to the noise sequence and then a union bound across iterations. The ”logT\log T price of iterating” in SGD convergence theorems is exactly the logm\log m tax from §9. Forward link: Concentration Inequalities → formalML.

Two-armed bandit simulation over 200 pulls: running mean trajectories for arm 1 (true mean 0.6) and arm 2 (true mean 0.5), each surrounded by a Hoeffding-via-union-bound confidence band that shrinks as √(log(2KT/δ)/(2n_a)).

📝 Example 17 (The PAC bound, numerically)

With H=1000|\mathcal{H}| = 1000, n=5000n = 5000, δ=0.05\delta = 0.05, the deviation bound is

ϵ=log(21000/0.05)25000=log(40000)100000.0326.\epsilon = \sqrt{\frac{\log(2 \cdot 1000 / 0.05)}{2 \cdot 5000}} = \sqrt{\frac{\log(40000)}{10000}} \approx 0.0326.

So with probability 95%95\%, the ERM hypothesis h^\hat h satisfies R(h^)R(h)+2ϵR(h)+0.065R(\hat h) \leq R(h^*) + 2\epsilon \approx R(h^*) + 0.065. The cost of “best of 10001000 hypotheses” is a log(40000)10.6\log(40000) \approx 10.6 factor inside the square root — paid as a 10.63.3\sqrt{10.6} \approx 3.3 multiplier on the per-hypothesis deviation. Doubling the class to H=2000|\mathcal{H}| = 2000 adds only log2/log400008%\sqrt{\log 2 / \log 40000} \approx 8\% to the deviation. The ”logm\log m tax” is what makes finite-class PAC learning feasible at all.

Connections & Further Reading

References

  1. book Grimmett & Stirzaker (2020). Probability and Random Processes Chapters 1–2. Standard reference for the axiomatic foundations at the level used here.
  2. book Rosenthal (2006). A First Look at Rigorous Probability Theory Chapters 1–3. The cleanest 'no-measure-theory-yet' treatment of axioms, conditional probability, and Borel–Cantelli.
  3. book Boucheron, Lugosi & Massart (2013). Concentration Inequalities: A Nonasymptotic Theory of Independence Chapters 2–3. The reference for Hoeffding's inequality, the MGF method, and the union-bound + concentration pattern.
  4. book Shalev-Shwartz & Ben-David (2014). Understanding Machine Learning: From Theory to Algorithms Chapter 4. The PAC generalization bound combining Hoeffding and the union bound; the canonical ML application.
  5. paper Hoeffding (1963). “Probability Inequalities for Sums of Bounded Random Variables” The original 1963 paper. The proof in Section 8 follows Hoeffding's argument.