Math for Causal Inference

Day 1. Probability Axioms & Set Theory

Sample spaces, events and Kolmogorov's three axioms, and the rules that follow from them.

Video coming soon
Learning outcomes
  • ●Write the sample space and events for a treatment-assignment experiment.
  • ●State Kolmogorov's three axioms and derive the complement, monotonicity and inclusion–exclusion rules from them.
  • ●Bound an unknown joint probability using only the marginals (Boole and Fréchet bounds).
  • ●Count the assignments in a completely randomised experiment.
2-HOUR SESSION PLAN
Theory 25′Warm-up (1–5) 20′Proofs (6–10) 35′Applied (11–15) 25′Python & Lab 15′
Colab notebook (.ipynb) Jump to the simulator

Theory

Why start here?

The fundamental problem of causal inference is that we never see the same unit both treated and untreated. Every causal estimate is therefore a statement about populations, and populations are described with probability. Before we can define an average treatment effect we need to be exact about what "probability" means.

Sample space, events and set operations

  • The sample space Ω\Omega is the set of all possible outcomes of a random experiment.
  • An event AA is a subset of Ω\Omega. The collection of events we are allowed to measure is written F\mathcal{F}.
  • For events AA and BB:
    • union A∪BA \cup B: "AA or BB (or both)"
    • intersection A∩BA \cap B: "both AA and BB"
    • complement Ac=Ω∖AA^c = \Omega \setminus A: "not AA"
    • AA and BB are mutually exclusive (disjoint) if A∩B=∅A \cap B = \emptyset.
  • De Morgan's laws: (A∪B)c=Ac∩Bc(A \cup B)^c = A^c \cap B^c and (A∩B)c=Ac∪Bc(A \cap B)^c = A^c \cup B^c.

Kolmogorov's axioms

A probability measure PP assigns a number to each event so that:

  1. Non-negativity: P(A)≥0P(A) \ge 0 for every event AA.
  2. Normalisation: P(Ω)=1P(\Omega) = 1.
  3. Countable additivity: if A1,A2,…A_1, A_2, \dots are pairwise disjoint, then
P(⋃i=1∞Ai)=∑i=1∞P(Ai).P\left(\bigcup_{i=1}^{\infty} A_i\right) = \sum_{i=1}^{\infty} P(A_i).

Everything else in probability is derived from these three lines. Today you will derive the most useful consequences yourself:

RuleStatement
Empty setP(∅)=0P(\emptyset) = 0
ComplementP(Ac)=1−P(A)P(A^c) = 1 - P(A)
MonotonicityA⊆B⇒P(A)≤P(B)A \subseteq B \Rightarrow P(A) \le P(B)
Inclusion–exclusionP(A∪B)=P(A)+P(B)−P(A∩B)P(A \cup B) = P(A) + P(B) - P(A \cap B)
Boole's inequalityP(A∪B)≤P(A)+P(B)P(A \cup B) \le P(A) + P(B)
Fréchet boundsmax⁡{0, P(A)+P(B)−1}≤P(A∩B)≤min⁡{P(A),P(B)}\max\{0,\, P(A)+P(B)-1\} \le P(A \cap B) \le \min\{P(A), P(B)\}

Equally likely outcomes and counting

When Ω\Omega is finite and every outcome is equally likely, P(A)=∣A∣/∣Ω∣P(A) = |A| / |\Omega|. In a completely randomised experiment with nn units of which exactly n1n_1 are treated, every one of the (nn1)\binom{n}{n_1} possible assignments has the same probability. This is the probability space behind Fisher's randomisation test (Phase 3).

Causal link. The Fréchet bounds are your first taste of partial identification: when the data pin down only the marginals, the joint is known only up to an interval. Manski's bounds on treatment effects (Phase 6) use exactly this logic.

Part 1 · Warm-up

Exercise 1 · Defining the sample space

An environmental regulation gives each firm three mutually exclusive options: adopt clean technology (CC), pay a carbon tax (TT), or exit the market (EE). Write the sample space Ω\Omega.

Show solution

The sample space lists every basic outcome:

Ω={C,T,E}.\Omega = \{C, T, E\}.

Exercise 2 · Identifying an event

Using Exercise 1, write the event AA = "the firm stays in the market", and its complement.

Show solution

Step 1. The firm stays in the market if it adopts clean technology or pays the tax:

A={C,T}.A = \{C, T\}.

Step 2. The complement collects every other outcome in Ω\Omega:

Ac=Ω∖A={E}.A^c = \Omega \setminus A = \{E\}.

Answer: A={C,T}A = \{C, T\} and Ac={E}A^c = \{E\} (the firm exits).

Exercise 3 · Normalisation

If P(C)=0.4P(C) = 0.4 and P(E)=0.1P(E) = 0.1, what is P(T)P(T)?

Show solution

The three outcomes are disjoint and exhaustive, so by Axioms 2 and 3:

P(C)+P(T)+P(E)=1  ⇒  P(T)=1−0.4−0.1=0.5.P(C) + P(T) + P(E) = 1 \;\Rightarrow\; P(T) = 1 - 0.4 - 0.1 = 0.5.

Exercise 4 · A tiny randomised trial

Two patients are each assigned to treatment (TT) or control (CC) by independent fair coin flips. Write Ω\Omega, the event "exactly one patient is treated", and its probability.

Show solution

Writing patient 1's arm first: Ω={TT,TC,CT,CC}\Omega = \{TT, TC, CT, CC\}, four equally likely outcomes.

"Exactly one treated" is {TC,CT}\{TC, CT\}, so its probability is 2/4=0.52/4 = 0.5.

Exercise 5 · Additivity

Trial participants have no side effects (S0S_0), mild (S1S_1) or severe (S2S_2) side effects. If P(S1)=0.20P(S_1) = 0.20 and P(S2)=0.05P(S_2) = 0.05, what is the probability of any side effect? Of none?

Show solution

S1S_1 and S2S_2 are disjoint, so by Axiom 3:

P(S1∪S2)=0.20+0.05=0.25.P(S_1 \cup S_2) = 0.20 + 0.05 = 0.25.

"No side effect" is the complement: P(S0)=1−0.25=0.75P(S_0) = 1 - 0.25 = 0.75.

Part 2 · Proofs

Exercise 6 · The empty set

Using only the axioms, prove P(∅)=0P(\emptyset) = 0.

Show solution
  1. Ω\Omega and ∅\emptyset are disjoint, and Ω∪∅=Ω\Omega \cup \emptyset = \Omega.
  2. By Axiom 3, P(Ω)=P(Ω∪∅)=P(Ω)+P(∅)P(\Omega) = P(\Omega \cup \emptyset) = P(\Omega) + P(\emptyset).
  3. Subtract P(Ω)P(\Omega) (which is finite, equal to 1) from both sides: P(∅)=0P(\emptyset) = 0.

Exercise 7 · The complement rule

Prove that P(Ac)=1−P(A)P(A^c) = 1 - P(A).

Show solution
  1. A∩Ac=∅A \cap A^c = \emptyset and A∪Ac=ΩA \cup A^c = \Omega.
  2. Axiom 3 gives P(A)+P(Ac)=P(Ω)P(A) + P(A^c) = P(\Omega).
  3. Axiom 2 gives P(Ω)=1P(\Omega) = 1, so P(Ac)=1−P(A)P(A^c) = 1 - P(A).

A corollary: since P(Ac)≥0P(A^c) \ge 0 (Axiom 1), P(A)≤1P(A) \le 1.

Exercise 8 · Monotonicity

Prove that if A⊆BA \subseteq B, then P(A)≤P(B)P(A) \le P(B).

Show solution
  1. Write B=A∪(B∩Ac)B = A \cup (B \cap A^c). The two pieces are disjoint.
  2. By Axiom 3, P(B)=P(A)+P(B∩Ac)P(B) = P(A) + P(B \cap A^c).
  3. By Axiom 1, P(B∩Ac)≥0P(B \cap A^c) \ge 0, so P(B)≥P(A)P(B) \ge P(A).

Exercise 9 · Inclusion–exclusion

Prove P(A∪B)=P(A)+P(B)−P(A∩B)P(A \cup B) = P(A) + P(B) - P(A \cap B).

Show solution
  1. Split the union into disjoint pieces: A∪B=A∪(B∩Ac)A \cup B = A \cup (B \cap A^c), so P(A∪B)=P(A)+P(B∩Ac)P(A \cup B) = P(A) + P(B \cap A^c).
  2. Split BB into disjoint pieces: B=(B∩A)∪(B∩Ac)B = (B \cap A) \cup (B \cap A^c), so P(B∩Ac)=P(B)−P(A∩B)P(B \cap A^c) = P(B) - P(A \cap B).
  3. Substitute step 2 into step 1:
P(A∪B)=P(A)+P(B)−P(A∩B).P(A \cup B) = P(A) + P(B) - P(A \cap B).

Boole's inequality follows immediately, because P(A∩B)≥0P(A \cap B) \ge 0.

Exercise 10 · The Fréchet lower bound

Prove that P(A∩B)≥P(A)+P(B)−1P(A \cap B) \ge P(A) + P(B) - 1 (Bonferroni's inequality).

Show solution
  1. Rearrange inclusion–exclusion: P(A∩B)=P(A)+P(B)−P(A∪B)P(A \cap B) = P(A) + P(B) - P(A \cup B).
  2. P(A∪B)≤1P(A \cup B) \le 1 (Exercise 7's corollary).
  3. So P(A∩B)≥P(A)+P(B)−1P(A \cap B) \ge P(A) + P(B) - 1. Combined with P(A∩B)≥0P(A \cap B) \ge 0 this gives the lower Fréchet bound max⁡{0,P(A)+P(B)−1}\max\{0, P(A)+P(B)-1\}. The upper bound min⁡{P(A),P(B)}\min\{P(A), P(B)\} follows from monotonicity, since A∩B⊆AA \cap B \subseteq A and A∩B⊆BA \cap B \subseteq B.

Part 3 · Applied

Exercise 11 · Randomised assignment

A diet study recruits 1,000 people and assigns 450 to treatment. What is the probability that a randomly chosen participant is in the control group?

Show solution

Step 1. Share assigned to treatment:

P(T)=4501000=0.45.P(T) = \frac{450}{1000} = 0.45.

Step 2. Every participant is in exactly one arm, so control is the complement of treatment:

P(Tc)=1−P(T)=1−0.45=0.55.P(T^c) = 1 - P(T) = 1 - 0.45 = 0.55.

Answer: 0.55.

Exercise 12 · Training and promotion

In a labour dataset, P(trained)=0.30P(\text{trained}) = 0.30, P(promoted)=0.20P(\text{promoted}) = 0.20 and P(trained and promoted)=0.10P(\text{trained and promoted}) = 0.10. Find the probability that a worker was trained or promoted, and the probability of neither.

Show solution

Let AA = trained and BB = promoted.

Step 1. Inclusion–exclusion (Exercise 9):

P(A∪B)=P(A)+P(B)−P(A∩B)=0.30+0.20−0.10=0.40.P(A \cup B) = P(A) + P(B) - P(A \cap B) = 0.30 + 0.20 - 0.10 = 0.40.

Step 2. "Neither" means not trained and not promoted. By De Morgan, Ac∩Bc=(A∪B)cA^c \cap B^c = (A \cup B)^c, so

P(Ac∩Bc)=1−P(A∪B)=1−0.40=0.60.P(A^c \cap B^c) = 1 - P(A \cup B) = 1 - 0.40 = 0.60.

Answer: 40% were trained or promoted; 60% were neither.

Exercise 13 · What the marginals can tell you

Administrative data show that 70% of households are eligible for a subsidy and 50% applied. The two files cannot be linked. What can you say about the share that are both eligible and applied?

Show solution

Let AA = eligible (P(A)=0.70P(A) = 0.70) and BB = applied (P(B)=0.50P(B) = 0.50).

Step 1. Lower Fréchet bound (Exercise 10):

P(A∩B)≥max⁡{0,  0.70+0.50−1}=0.20.P(A \cap B) \ge \max\{0,\; 0.70 + 0.50 - 1\} = 0.20.

Step 2. Upper Fréchet bound (monotonicity, since A∩BA \cap B sits inside both events):

P(A∩B)≤min⁡{0.70,  0.50}=0.50.P(A \cap B) \le \min\{0.70,\; 0.50\} = 0.50.

Step 3. For comparison, if eligibility and application were independent: 0.70×0.50=0.350.70 \times 0.50 = 0.35.

Answer: between 20% and 50%. Without linked records the share is only partially identified; the 35% figure needs an independence assumption the data cannot check.

Exercise 14 · Two interventions that might fail

A city runs two traffic interventions. Intervention 1 fails with probability 0.05 and intervention 2 with probability 0.08.

(a) Without knowing how the failures are related, what is the largest and smallest possible probability that at least one fails? (b) What is it if failures are independent?

Show solution

Let F1F_1 and F2F_2 be the failure events.

(a) No information about the overlap

Step 1. Largest value, from Boole's inequality (reached when the two failures never happen together):

P(F1∪F2)≤P(F1)+P(F2)=0.05+0.08=0.13.P(F_1 \cup F_2) \le P(F_1) + P(F_2) = 0.05 + 0.08 = 0.13.

Step 2. Smallest value, from monotonicity (reached when F1⊆F2F_1 \subseteq F_2, i.e. whenever intervention 1 fails, 2 fails too):

P(F1∪F2)≥max⁡{0.05,  0.08}=0.08.P(F_1 \cup F_2) \ge \max\{0.05,\; 0.08\} = 0.08.

(b) Independent failures

Step 3. Under independence, P(F1∩F2)=0.05×0.08=0.004P(F_1 \cap F_2) = 0.05 \times 0.08 = 0.004.

Step 4. Inclusion–exclusion:

P(F1∪F2)=0.05+0.08−0.004=0.126.P(F_1 \cup F_2) = 0.05 + 0.08 - 0.004 = 0.126.

Check via the complement: 1−P(both succeed)=1−(0.95)(0.92)=0.1261 - P(\text{both succeed}) = 1 - (0.95)(0.92) = 0.126.

Answer: (a) between 0.08 and 0.13; (b) 0.126.

Exercise 15 · Counting assignments

An experiment has 6 villages; exactly 3 are treated, chosen completely at random.

(a) How many assignments are possible? (b) What is the probability that village 1 is treated? (c) What is the probability that villages 1 and 2 are both treated?

Show solution

(a) Number of assignments

Step 1. Choose which 3 of the 6 villages are treated:

(63)=6!3! 3!=20.\binom{6}{3} = \frac{6!}{3!\,3!} = 20.

(b) Village 1 treated

Step 2. Fix village 1 as treated; the other 2 treated villages come from the remaining 5: (52)=10\binom{5}{2} = 10 assignments.

Step 3. All 20 assignments are equally likely, so P=10/20=0.5P = 10/20 = 0.5.

(c) Villages 1 and 2 both treated

Step 4. Fix both as treated; the last treated village comes from the remaining 4: (41)=4\binom{4}{1} = 4 assignments.

Step 5. P=4/20=0.2P = 4/20 = 0.2.

Answer: 20 assignments; 0.5; 0.2. Note that 0.2 is not 0.5×0.5=0.250.5 \times 0.5 = 0.25: under complete randomisation, treating one village leaves fewer treated slots for the others, so assignments are slightly negatively dependent.

Verify in Python

import itertools
import numpy as np
from math import comb

# Exercise 15: enumerate every complete-randomisation assignment
assignments = list(itertools.combinations(range(6), 3))
print("number of assignments:", len(assignments), "=", comb(6, 3))
p1 = np.mean([0 in a for a in assignments])
p12 = np.mean([(0 in a) and (1 in a) for a in assignments])
print(f"P(village 1 treated) = {p1:.2f}; P(villages 1 and 2 treated) = {p12:.2f}")

# Exercises 12-14: inclusion-exclusion and bounds checked by simulation
rng = np.random.default_rng(1)
n = 1_000_000
f1 = rng.random(n) < 0.05
f2 = rng.random(n) < 0.08          # independent of f1
print(f"P(at least one fails), independent: {np.mean(f1 | f2):.4f}  (theory 0.126)")

# Frechet bounds for Exercise 13
pa, pb = 0.70, 0.50
print("Frechet bounds:", round(max(0, pa + pb - 1), 2), "to", min(pa, pb))

Key takeaways

  • Three axioms generate every probability rule you will use in this course.
  • Inclusion–exclusion links unions and intersections; Boole and Fréchet bound what you cannot observe.
  • Complete randomisation defines a finite, equally likely probability space over assignments.

Simulation Lab: Inclusion–Exclusion & Fréchet Bounds

Open full screen →

Set P(A), P(B) and their overlap; watch the union, the complement and the feasible range of the joint move.

The sample space Ω has length 1. A and B are intervals inside it.A (0.70)B (0.50)A∩B = 0.35
P(A ∪ B)
0.85
P(A)+P(B)−P(A∩B)
P(neither)
0.15
De Morgan
P(A | B)
0.70
P(A) = 0.70
Fréchet range of P(A∩B)
0.20–0.50
independent: 0.350

A and B are independent: P(A∩B) = P(A)P(B).

The overlap can only move inside the Fréchet bounds (the shaded band). Without linked data, that band is all the marginals tell you.

Day 2