
# Probability Spaces

> Quantum mechanics doesn't predict *what* you'll measure — it predicts the *probabilities*. Before
> we can read the Born rule honestly, we need the language those probabilities are written in: the
> probability space $(\Omega, \mathcal F, \mathbb P)$.

## Learning Objectives

By the end of this lesson you will be able to:

1. **State** the Kolmogorov axioms and **define** a probability space $(\Omega, \mathcal F, \mathbb P)$, including why we need a $\sigma$-algebra of events.
2. **Compute** conditional probabilities and **test** independence of events from first principles.
3. **Apply** the law of total probability and **derive** Bayes' theorem, then use it to perform a Bayesian update.
4. **Connect** these objects to quantum measurement statistics (outcomes, the Born rule — forward-referenced to Term 1).
5. **Estimate** an event probability by Monte-Carlo simulation and **verify** Bayes' theorem numerically in NumPy.

---

## Intuition

A *random experiment* has some set of possible outcomes. Flip a coin: $\{H, T\}$. Roll a die:
$\{1,\dots,6\}$. Measure a qubit prepared in $|+\rangle$ in the computational basis: $\{0, 1\}$, each
with probability $\tfrac12$. The whole apparatus of probability theory is the bookkeeping that lets
us assign consistent numbers to *combinations* of outcomes ("the die is even", "the qubit reads 0
twice in a row") and to update those numbers when we learn something new.

Three ingredients suffice:

- **$\Omega$ — the sample space.** Every possible elementary outcome, exactly once.
- **$\mathcal F$ — the event space.** The *collections* of outcomes we're allowed to ask about. An
  event is a subset of $\Omega$; "the die is even" is the event $\{2,4,6\}$.
- **$\mathbb P$ — the probability measure.** A rule assigning each event a number in $[0,1]$,
  obeying a short list of consistency axioms.

For finite $\Omega$ you could take $\mathcal F$ to be *all* subsets and never think about it again.
The $\sigma$-algebra machinery only earns its keep on infinite/continuous sample spaces (e.g. a
uniform real number in $[0,1]$), where you *cannot* consistently assign a probability to every
subset. We set the machinery up carefully now because the same structure — outcomes, a sample
space, a measure — is exactly what a quantum measurement produces. The difference is only in *where
the numbers come from*: classically they're given; quantum-mechanically the Born rule computes them
from a state vector. Same scaffolding, different engine.

---

## Theory

### Sample space and events

The **sample space** $\Omega$ is the set of all elementary outcomes of an experiment. An
**event** is a subset $A \subseteq \Omega$; we say "$A$ occurs" if the realized outcome $\omega \in
A$. Set operations carry their logical meaning: $A \cup B$ is "$A$ or $B$", $A \cap B$ is "$A$ and
$B$", $A^c = \Omega \setminus A$ is "not $A$".

### The event $\sigma$-algebra

We do not always want (or get to choose) every subset as an event. The admissible events form a
**$\sigma$-algebra** (also "$\sigma$-field"): a collection $\mathcal F \subseteq 2^{\Omega}$ such
that

$$
\text{(i)}\ \ \Omega \in \mathcal F, \qquad
\text{(ii)}\ \ A \in \mathcal F \Rightarrow A^c \in \mathcal F, \qquad
\text{(iii)}\ \ A_1, A_2, \dots \in \mathcal F \Rightarrow \bigcup_{i=1}^{\infty} A_i \in \mathcal F .
$$

That is: it contains the whole space, and is closed under complement and **countable** union (hence,
by De Morgan, under countable intersection). The closure under countable operations — not just
finite — is exactly what lets us talk about limits like "the long-run frequency converges", which we
will need for the Law of Large Numbers in the next lesson.

> **Why not just use all subsets?** For finite or countable $\Omega$ you can, and we usually take
> $\mathcal F = 2^\Omega$. But for $\Omega = [0,1]$ with the uniform "length" measure, Vitali's
> theorem shows there is **no** way to assign a consistent length to *every* subset. The standard
> choice is the **Borel $\sigma$-algebra** generated by the intervals. The $\sigma$-algebra is the
> precise statement of "which questions are answerable."

### The Kolmogorov axioms

A **probability measure** is a function $\mathbb P : \mathcal F \to [0,1]$ satisfying Kolmogorov's
three axioms [CT, §2]:

$$
\textbf{(K1) Non-negativity:}\quad \mathbb P(A) \ge 0 \ \ \text{for all } A \in \mathcal F .
$$

$$
\textbf{(K2) Normalization:}\quad \mathbb P(\Omega) = 1 .
$$

$$
\textbf{(K3) Countable additivity:}\quad
\mathbb P\!\left(\bigcup_{i=1}^{\infty} A_i\right) = \sum_{i=1}^{\infty} \mathbb P(A_i)
\quad\text{for pairwise disjoint } A_i\ (A_i \cap A_j = \varnothing,\ i\neq j).
$$

The triple $(\Omega, \mathcal F, \mathbb P)$ is a **probability space**. Everything else is a
theorem.

**Basic consequences** (each a short derivation from K1–K3):

*Probability of the empty set.* Take $A_1 = \Omega$, $A_2 = A_3 = \dots = \varnothing$. These are
disjoint and union to $\Omega$, so by (K3) and (K2),
$$
1 = \mathbb P(\Omega) = \mathbb P(\Omega) + \sum_{i\ge 2}\mathbb P(\varnothing)
\;\Rightarrow\; \sum_{i\ge 2}\mathbb P(\varnothing) = 0
\;\Rightarrow\; \mathbb P(\varnothing) = 0 ,
$$
using non-negativity (K1) to force each term to zero.

*Complement rule.* $A$ and $A^c$ are disjoint with $A \cup A^c = \Omega$, so
$$
\mathbb P(A) + \mathbb P(A^c) = \mathbb P(\Omega) = 1
\;\Rightarrow\; \mathbb P(A^c) = 1 - \mathbb P(A).
$$

*Monotonicity.* If $A \subseteq B$, write $B = A \,\sqcup\, (B \setminus A)$ (disjoint union). Then
$\mathbb P(B) = \mathbb P(A) + \mathbb P(B\setminus A) \ge \mathbb P(A)$ by (K1). In particular
$\mathbb P(A) \le \mathbb P(\Omega) = 1$.

*Inclusion–exclusion (two sets).* Decompose into disjoint pieces $A\cup B = (A\setminus B)\sqcup(A\cap B)\sqcup(B\setminus A)$:
$$
\mathbb P(A \cup B) = \mathbb P(A) + \mathbb P(B) - \mathbb P(A \cap B).
$$

### Conditional probability

Learning that event $B$ occurred shrinks the world to $B$ and renormalizes. For $\mathbb P(B) > 0$,
the **conditional probability** of $A$ given $B$ is *defined* as

$$
\mathbb P(A \mid B) \;:=\; \frac{\mathbb P(A \cap B)}{\mathbb P(B)} .
$$

This is a definition, but a principled one: fix $B$ with $\mathbb P(B)>0$ and check that
$A \mapsto \mathbb P(A\mid B)$ is itself a probability measure on $(\Omega, \mathcal F)$. Indeed
$\mathbb P(A\mid B)\ge 0$; $\mathbb P(\Omega \mid B) = \mathbb P(B)/\mathbb P(B) = 1$; and for disjoint
$A_i$, since the $A_i \cap B$ are also disjoint, countable additivity of $\mathbb P$ pushes through
the division. So conditioning yields a *new* probability space supported on $B$ — exactly the
"shrink and renormalize" picture.

Rearranging gives the **multiplication rule**:
$$
\mathbb P(A \cap B) = \mathbb P(A\mid B)\,\mathbb P(B) = \mathbb P(B \mid A)\,\mathbb P(A).
$$

> **Quantum foreshadowing.** Sequential measurements are conditional probability in disguise. If a
> qubit measured in the computational basis reads $0$, a *second* computational-basis measurement
> reads $0$ with certainty: $\mathbb P(\text{2nd}=0 \mid \text{1st}=0) = 1$. The measurement
> *collapse* of Term 1 is precisely the "shrink to $B$ and renormalize" operation, with the Born
> rule supplying the numbers.

### Independence

Events $A$ and $B$ are **independent** if knowing one tells you nothing about the other:
$$
A \perp B \;\iff\; \mathbb P(A \cap B) = \mathbb P(A)\,\mathbb P(B).
$$
Equivalently, when $\mathbb P(B)>0$, $\mathbb P(A\mid B) = \mathbb P(A)$. Note independence is a
statement about the *measure*, not about the outcomes being "unrelated" in any physical sense — and
it is **not** the same as disjointness. Two disjoint events with positive probability are *maximally
dependent*: if one occurs the other cannot, so $\mathbb P(A\cap B)=0 \ne \mathbb P(A)\mathbb P(B)$.

For a collection $\{A_i\}$, **mutual independence** requires
$\mathbb P\!\big(\bigcap_{i\in S} A_i\big) = \prod_{i\in S}\mathbb P(A_i)$ for *every* finite subset
$S$ — strictly stronger than pairwise independence.

### Law of total probability

Let $\{B_1, B_2, \dots\}$ be a **partition** of $\Omega$: pairwise disjoint with
$\bigcup_i B_i = \Omega$ and each $\mathbb P(B_i) > 0$. Any event $A$ splits along the partition,
$A = \bigsqcup_i (A \cap B_i)$, so by countable additivity and the multiplication rule,

$$
\mathbb P(A) \;=\; \sum_i \mathbb P(A \cap B_i)
\;=\; \sum_i \mathbb P(A \mid B_i)\,\mathbb P(B_i) .
$$

This is the workhorse for "average over the hidden cause." It says the marginal probability of $A$
is the weighted average of its conditional probabilities, weighted by how likely each cause $B_i$
is.

### Bayes' theorem — derivation

Bayes' theorem inverts a conditional. Start from the two ways of writing the joint probability,
$$
\mathbb P(B_j \cap A) = \mathbb P(A \mid B_j)\,\mathbb P(B_j) = \mathbb P(B_j \mid A)\,\mathbb P(A),
$$
solve for the quantity we want, and substitute the law of total probability for the denominator:

$$
\boxed{\;\mathbb P(B_j \mid A)
= \frac{\mathbb P(A \mid B_j)\,\mathbb P(B_j)}{\mathbb P(A)}
= \frac{\mathbb P(A \mid B_j)\,\mathbb P(B_j)}{\sum_i \mathbb P(A \mid B_i)\,\mathbb P(B_i)}\;}
$$

The names: $\mathbb P(B_j)$ is the **prior**, $\mathbb P(A\mid B_j)$ the **likelihood**,
$\mathbb P(B_j\mid A)$ the **posterior**, and the denominator $\mathbb P(A)$ the **evidence** (or
marginal likelihood) — a normalizing constant ensuring the posteriors over $j$ sum to one. Bayes'
theorem is *the* rule for updating beliefs in light of data, and it underpins the statistical
inference we'll do on measurement counts throughout the program.

---

## Worked Examples

### Example 1 — Medical test (a Bayesian update)

A disease has prevalence $\mathbb P(D) = 0.01$. A test is $99\%$ sensitive
($\mathbb P(+ \mid D) = 0.99$) and $95\%$ specific ($\mathbb P(- \mid D^c) = 0.95$, so the
false-positive rate is $\mathbb P(+ \mid D^c) = 0.05$). You test positive. What is
$\mathbb P(D \mid +)$?

The partition is $\{D, D^c\}$. Law of total probability for the evidence:
$$
\mathbb P(+) = \mathbb P(+\mid D)\mathbb P(D) + \mathbb P(+\mid D^c)\mathbb P(D^c)
= (0.99)(0.01) + (0.05)(0.99) = 0.0099 + 0.0495 = 0.0594.
$$
Bayes' theorem:
$$
\mathbb P(D \mid +) = \frac{\mathbb P(+\mid D)\,\mathbb P(D)}{\mathbb P(+)}
= \frac{0.0099}{0.0594} \approx 0.1667 .
$$

A positive result on a very accurate test still leaves only a $\sim 17\%$ chance of disease — because
the prior is tiny, the *base rate* dominates. This base-rate effect is the single most common error
in applied probability; Bayes' theorem makes it quantitative.

### Example 2 — Measurement-outcome analogy (sequential qubit reads)

Model a noisy detector classically. A qubit is prepared so that an ideal computational-basis
measurement would read $0$ with probability $q = \mathbb P(\text{ideal}=0) = 0.7$ and $1$ with
probability $0.3$. The detector is imperfect: given the ideal outcome it reports correctly with
probability $0.9$ and flips with probability $0.1$ (a *readout error*, exactly the kind we'll
mitigate in Term 4). You read a reported value $R = 0$. What is the probability the ideal outcome was
$0$?

Partition by the ideal outcome $\{I=0, I=1\}$. Likelihoods: $\mathbb P(R=0\mid I=0)=0.9$,
$\mathbb P(R=0\mid I=1)=0.1$. Evidence:
$$
\mathbb P(R=0) = (0.9)(0.7) + (0.1)(0.3) = 0.63 + 0.03 = 0.66.
$$
Posterior:
$$
\mathbb P(I=0\mid R=0) = \frac{(0.9)(0.7)}{0.66} = \frac{0.63}{0.66} \approx 0.9545 .
$$
Reading $0$ raises our confidence that the ideal outcome was $0$ from the prior $0.7$ to $\approx
0.95$. This is precisely the inference performed by *readout-error mitigation*: invert the
known noise (likelihood) to recover the underlying distribution from observed counts.

---

## Hands-on (Python)

We do two things: (1) estimate an event probability by Monte-Carlo simulation and watch the estimate
converge, and (2) verify Bayes' theorem by *simulating* the joint experiment and comparing empirical
conditional frequencies against the analytic posterior.

```python
import numpy as np

rng = np.random.default_rng(0)  # seed for reproducible runs

# -------------------------------------------------------------------------
# (1) Monte-Carlo estimate of an event probability.
# Experiment: roll two fair six-sided dice. Event A = "sum >= 10".
# True value: outcomes {(4,6),(5,5),(5,6),(6,4),(6,5),(6,6)} -> 6/36 = 1/6.
# -------------------------------------------------------------------------
def estimate_event_prob(n_trials, rng):
    d1 = rng.integers(1, 7, size=n_trials)   # uniform on {1,...,6}
    d2 = rng.integers(1, 7, size=n_trials)
    A = (d1 + d2) >= 10                       # boolean array: did A occur?
    return A.mean()                           # fraction of trials in A = P_hat(A)

true_p = 6 / 36
for n in (100, 1_000, 100_000, 1_000_000):
    p_hat = estimate_event_prob(n, rng)
    print(f"n={n:>9}: P_hat(A)={p_hat:.5f}  |error|={abs(p_hat-true_p):.5f}")

# The error shrinks like 1/sqrt(n) -- the standard-error scaling we DERIVE in
# the next lesson and that later governs how many measurement "shots" a QPU run
# needs for a target precision.
```

```python
# -------------------------------------------------------------------------
# (2) Verify Bayes' theorem by simulation (the medical-test example).
# We simulate the JOINT experiment (disease status, test result), then read off
# the empirical posterior P(D | +) and compare to the analytic value.
# -------------------------------------------------------------------------
P_D       = 0.01    # prior prevalence
sens      = 0.99    # P(+ | D)
fpr       = 0.05    # P(+ | not D)

def analytic_posterior(P_D, sens, fpr):
    evidence = sens * P_D + fpr * (1 - P_D)         # law of total probability
    return (sens * P_D) / evidence                  # Bayes' theorem

def simulate_posterior(n, rng, P_D, sens, fpr):
    has_disease = rng.random(n) < P_D               # sample D ~ Bernoulli(P_D)
    # P(+ | status): sensitivity if diseased, false-positive rate otherwise
    p_positive = np.where(has_disease, sens, fpr)
    tested_pos = rng.random(n) < p_positive         # sample test result
    # Empirical P(D | +) = (# diseased AND positive) / (# positive)
    return (has_disease & tested_pos).sum() / tested_pos.sum()

post_exact = analytic_posterior(P_D, sens, fpr)
post_sim   = simulate_posterior(2_000_000, rng, P_D, sens, fpr)
print(f"\nP(D | +) analytic   = {post_exact:.5f}")
print(f"P(D | +) simulated  = {post_sim:.5f}")
assert abs(post_exact - post_sim) < 5e-3, "simulation should match Bayes"
print("Bayes' theorem verified numerically.")
```

Expected output (values approximate; the seed makes them reproducible):

```text
n=      100: P_hat(A)=0.22000  |error|=0.05333
n=     1000: P_hat(A)=0.15800  |error|=0.00867
n=   100000: P_hat(A)=0.16632  |error|=0.00035
n=  1000000: P_hat(A)=0.16665  |error|=0.00002

P(D | +) analytic   = 0.16667
P(D | +) simulated  = 0.16621
Bayes' theorem verified numerically.
```

The Monte-Carlo loop is the classical skeleton of a quantum experiment: prepare, sample, count,
estimate. The only thing Braket adds is that the per-shot probabilities come from $|\psi\rangle$ via
the Born rule rather than from `rng.integers`.

---

## Exercises

**1. (Easy) Complement and union.** Given $\mathbb P(A) = 0.6$, $\mathbb P(B) = 0.5$, and
$\mathbb P(A\cap B) = 0.3$, compute $\mathbb P(A^c)$, $\mathbb P(A\cup B)$, and $\mathbb P(A^c \cap B^c)$.

<details>
<summary>Solution</summary>

$\mathbb P(A^c) = 1 - 0.6 = 0.4$. By inclusion–exclusion
$\mathbb P(A\cup B) = 0.6 + 0.5 - 0.3 = 0.8$. By De Morgan,
$A^c\cap B^c = (A\cup B)^c$, so $\mathbb P(A^c\cap B^c) = 1 - 0.8 = 0.2$.

</details>

**2. (Easy) Independence vs. disjointness.** Suppose $\mathbb P(A) = 0.4$ and $\mathbb P(B)=0.5$.
(a) If $A,B$ are independent, find $\mathbb P(A\cap B)$ and $\mathbb P(A\cup B)$. (b) If instead $A,B$
are disjoint, find the same quantities. (c) Can two events with positive probability be both
independent and disjoint?

<details>
<summary>Solution</summary>

(a) Independent: $\mathbb P(A\cap B) = 0.4\cdot 0.5 = 0.2$, so $\mathbb P(A\cup B) = 0.4+0.5-0.2 = 0.7$.
(b) Disjoint: $\mathbb P(A\cap B) = 0$, so $\mathbb P(A\cup B) = 0.9$.
(c) No. Disjoint gives $\mathbb P(A\cap B)=0$, but independence requires
$\mathbb P(A\cap B)=\mathbb P(A)\mathbb P(B) > 0$. The two are contradictory whenever both events have
positive probability.

</details>

**3. (Medium) Conditioning is a probability measure.** Fix $B$ with $\mathbb P(B) > 0$. Prove that
$\mathbb Q(A) := \mathbb P(A\mid B)$ satisfies the three Kolmogorov axioms on $(\Omega,\mathcal F)$.

<details>
<summary>Solution</summary>

(K1) $\mathbb Q(A) = \mathbb P(A\cap B)/\mathbb P(B) \ge 0$ since numerator $\ge 0$ (K1 for $\mathbb P$)
and denominator $>0$.
(K2) $\mathbb Q(\Omega) = \mathbb P(\Omega\cap B)/\mathbb P(B) = \mathbb P(B)/\mathbb P(B) = 1$.
(K3) For pairwise disjoint $A_1,A_2,\dots$, the sets $A_i\cap B$ are also pairwise disjoint, and
$(\bigcup_i A_i)\cap B = \bigcup_i (A_i\cap B)$. Hence
$$
\mathbb Q\Big(\bigcup_i A_i\Big) = \frac{\mathbb P\big(\bigcup_i (A_i\cap B)\big)}{\mathbb P(B)}
= \frac{\sum_i \mathbb P(A_i\cap B)}{\mathbb P(B)} = \sum_i \mathbb Q(A_i),
$$
using countable additivity of $\mathbb P$. So $\mathbb Q$ is a probability measure. $\blacksquare$

</details>

**4. (Medium) The Monty Hall problem.** Three doors; a prize behind one. You pick door 1. The host,
who knows where the prize is, opens a *different* door with no prize (door 3, say) and offers a
switch to door 2. Using Bayes' theorem, compute $\mathbb P(\text{prize behind 2} \mid \text{host
opened 3})$ and decide whether to switch.

<details>
<summary>Solution</summary>

Let $C_i$ = "prize behind door $i$", each with prior $\tfrac13$. Let $H_3$ = "host opens door 3"
given you chose door 1. The likelihoods:
$\mathbb P(H_3\mid C_1) = \tfrac12$ (prize behind your door; host picks 2 or 3 at random),
$\mathbb P(H_3\mid C_2) = 1$ (prize behind 2; host *must* avoid it, opens 3),
$\mathbb P(H_3\mid C_3) = 0$ (host never opens the prize door).
Evidence: $\mathbb P(H_3) = \tfrac12\cdot\tfrac13 + 1\cdot\tfrac13 + 0 = \tfrac12$. Then
$$
\mathbb P(C_2\mid H_3) = \frac{1\cdot\tfrac13}{\tfrac12} = \frac{2}{3},
\qquad
\mathbb P(C_1\mid H_3) = \frac{\tfrac12\cdot\tfrac13}{\tfrac12} = \frac13 .
$$
Switching wins with probability $\tfrac23$. **Switch.**

</details>

**5. (Hard) Two-test sequential update.** Reuse Example 1's disease ($\mathbb P(D)=0.01$, sensitivity
$0.99$, false-positive rate $0.05$). You test positive *twice* with two **conditionally independent**
tests (independent given true disease status). Compute the posterior $\mathbb P(D\mid +,+)$ two ways:
(a) update once, then treat the posterior as the new prior and update again; (b) compute it in one
shot from the joint likelihood. Confirm they agree.

<details>
<summary>Solution</summary>

(a) After one positive (Example 1), the posterior is $\pi_1 = \mathbb P(D\mid +) = 1/6 \approx
0.1667$. Use $\pi_1$ as the new prior. Conditional independence means the second test's likelihoods
are unchanged ($0.99$ given $D$, $0.05$ given $D^c$):
$$
\mathbb P(D\mid +,+) = \frac{0.99\,\pi_1}{0.99\,\pi_1 + 0.05(1-\pi_1)}
= \frac{0.99\cdot\frac16}{0.99\cdot\frac16 + 0.05\cdot\frac56}
= \frac{0.165}{0.165 + 0.041\overline{6}} \approx 0.7984 .
$$
(b) One shot: likelihood of two positives is $0.99^2$ given $D$ and $0.05^2$ given $D^c$:
$$
\mathbb P(D\mid +,+) = \frac{0.99^2(0.01)}{0.99^2(0.01) + 0.05^2(0.99)}
= \frac{0.0098010}{0.0098010 + 0.0024750} \approx 0.7984 .
$$
They agree. **Sequential Bayesian updating is consistent with batch updating** precisely when the
observations are conditionally independent given the hypothesis — the mathematical reason we can
accumulate evidence shot by shot.

</details>

**6. (Hard) Boole's inequality (union bound).** Prove that for *any* events $A_1, A_2, \dots$ (not
necessarily disjoint), $\mathbb P\big(\bigcup_i A_i\big) \le \sum_i \mathbb P(A_i)$. Why is this bound
ubiquitous in analyzing failure probabilities (e.g. "at least one of $m$ qubits errs")?

<details>
<summary>Solution</summary>

Disjointify: define $B_1 = A_1$ and $B_i = A_i \setminus \bigcup_{j<i} A_j$. The $B_i$ are pairwise
disjoint, $B_i \subseteq A_i$, and $\bigcup_i B_i = \bigcup_i A_i$. By countable additivity (K3) and
monotonicity,
$$
\mathbb P\Big(\bigcup_i A_i\Big) = \mathbb P\Big(\bigcup_i B_i\Big)
= \sum_i \mathbb P(B_i) \le \sum_i \mathbb P(A_i). \qquad\blacksquare
$$
It is ubiquitous because it needs *no independence assumption*: to bound the chance that *any* of $m$
bad events happens (a qubit errs, a gate fails, a test gives a false positive), just sum the
individual probabilities. If each of $m$ qubits errs with probability $\le p$, then
$\mathbb P(\text{some qubit errs}) \le mp$ regardless of correlations — the basic budget behind
error-correction thresholds.

</details>

---

## Checkpoint

1. State the three Kolmogorov axioms. Which one requires *countable* (not just finite) additivity, and why does that matter?
2. Why do we bother with a $\sigma$-algebra instead of just using all subsets of $\Omega$?
3. Give the definition of $\mathbb P(A\mid B)$ and explain in one sentence why it is itself a probability measure.
4. Two events are disjoint. Are they independent? Justify.
5. Write Bayes' theorem and name each of its four parts (prior, likelihood, posterior, evidence).
6. In Example 1, the test is $99\%$ sensitive yet a positive result yields only $\sim 17\%$ probability of disease. In one sentence, why?

<details>
<summary>Answers</summary>

1. (K1) $\mathbb P(A)\ge 0$; (K2) $\mathbb P(\Omega)=1$; (K3) countable additivity for disjoint events.
   (K3) is the countable one; countability is needed so we can take limits of events (e.g. tail events,
   convergence of sample frequencies in the LLN) and still get consistent probabilities.
2. For uncountable $\Omega$ (e.g. $[0,1]$ with uniform measure) it is *impossible* to assign a
   consistent probability to every subset (non-measurable sets exist, by Vitali). The $\sigma$-algebra
   names exactly the events we can measure; for finite/countable $\Omega$ we just take all subsets.
3. $\mathbb P(A\mid B) = \mathbb P(A\cap B)/\mathbb P(B)$ for $\mathbb P(B)>0$. It satisfies K1–K3 on
   $(\Omega,\mathcal F)$ (Exercise 3), so conditioning produces a legitimate probability space supported
   on $B$ — "shrink and renormalize."
4. Not (in general). If both have positive probability, disjointness gives $\mathbb P(A\cap B)=0 \ne
   \mathbb P(A)\mathbb P(B)$, so they are *dependent*. (The degenerate case where one has probability $0$
   is the only exception.)
5. $\mathbb P(B_j\mid A) = \dfrac{\mathbb P(A\mid B_j)\mathbb P(B_j)}{\sum_i \mathbb P(A\mid B_i)\mathbb P(B_i)}$.
   $\mathbb P(B_j)$ = prior, $\mathbb P(A\mid B_j)$ = likelihood, $\mathbb P(B_j\mid A)$ = posterior,
   $\mathbb P(A) = \sum_i \mathbb P(A\mid B_i)\mathbb P(B_i)$ = evidence.
6. The disease is rare (prior $1\%$), so even a small false-positive rate applied to the large healthy
   population produces more false positives than the test produces true positives — the base rate
   dominates.

</details>

---

## Further Reading

- **[CT, §2.1–2.5]** Cover & Thomas — probability preliminaries underpinning information theory.
- **[NC, §2.2.3–2.2.5]** Nielsen & Chuang — measurement statistics; where these probabilities meet the Born rule.
- **[Pre, Ch. 2]** Preskill — the formalism, in the run-up to the quantum measurement postulate.
- Bill Bryson it isn't: for rigorous measure-theoretic probability, P. Billingsley, *Probability and
  Measure* (Wiley) is the standard graduate reference (the $\sigma$-algebra subtleties live here).

---

← Prev: [Tensor Products](../c01-linear-algebra/07-tensor-products.md) · Up: [Term 0](../README.md) · Next: [Random Variables & Expectation](02-random-variables-expectation.md) →
