Quant Sandbox
DerivativesPortfolio & RiskFixed IncomeCorporate FinanceProbability & MeasureStochastic ModelsMarket MicrostructureGuide
Guide
Derivatives pricing0 / 17
01Forwards, calls and puts02Combining positions03Arbitrage and the forward price04Put–call parity05The one-step binomial model06Risk-neutral probabilities07Multi-step trees and backward induction08American options and early exercise09Delta and hedging10Geometric Brownian motion11The Black–Scholes formula12The Greeks: gamma, vega, theta and rho13Options on dividend-paying stocks, indices, currencies and futures14Implied volatility and the volatility smile15Stochastic volatility and the Heston model16Static replication: Breeden–Litzenberger and Carr–Madan17Exotic options: barriers, Asians and digitals
Portfolio & risk0 / 12
01Returns and volatility02Diversification and correlation03The efficient frontier and the capital market line04Risk aversion and the optimal complete portfolio05CAPM, beta and the security market line06Performance measures: Sharpe, Treynor, Jensen and information ratio07Factor models and systematic risk08The Fama–French factor models09Value at Risk and expected shortfall10Systemic risk and contagion11Portfolio constraints and the no-short-sales frontier12Estimating expected returns and covariances
Fixed income0 / 10
01Bond prices and yields02Duration and convexity03Immunization and duration matching04Spot rates, forward rates and the yield curve05Non-parallel curve moves and key-rate durations06Bond futures and the cheapest-to-deliver07Interest rate swaps08Callable bonds and negative convexity09Credit risk: default probabilities and credit spreads10Real rates, inflation and inflation-linked bonds
Corporate finance0 / 10
01Interest, compounding and discounting02Annuities, perpetuities and loan amortization03Net present value and internal rate of return04Project risk: sensitivity, scenarios and Monte Carlo NPV05The weighted average cost of capital06Capital structure and the Modigliani–Miller theorems07Dividends, payout policy and the dividend discount model08Discounted cash flow valuation09Relative valuation with multiples10Real options: the value of flexibility
Probability and measure0 / 13
01Measuring the size of sets02σ-algebras and Borel sets03Lebesgue measure and null sets04Measurable functions05The Lebesgue integral06Convergence theorems07Probability spaces and Kolmogorov's axioms08Random variables and their distributions09Expectation, variance and inequalities10Independence and product measures11Modes of convergence and the law of large numbers12Conditional probability and conditional expectation13Measure theory in option pricing
Stochastic models0 / 17
01Random walks and Brownian motion02The law of large numbers and the central limit theorem03Probability spaces, σ-algebras and random variables04Filtrations, adapted processes and stopping times05Conditional expectation and martingales06Properties of Brownian motion07The reflection principle and first passage times08The Brownian bridge09The Itô integral10Itô's lemma11Kolmogorov equations and the Feynman–Kac formula12Change of measure and Girsanov's theorem13Monte Carlo option pricing14Simulating SDEs: the Euler–Maruyama scheme15Correlated Brownian motions and multi-asset models16Mean reversion: Ornstein–Uhlenbeck and Vasicek17Jumps and the Merton jump-diffusion model
Market microstructure0 / 11
01Market makers and liquidity02The limit order book03Queue position and fill probability04Adverse selection and informed trading05The Glosten–Milgrom model06Measuring and decomposing the bid–ask spread07Informed trading and Kyle's lambda08Price impact and optimal execution09Inventory risk and quote skewing10Optimal quoting: the Avellaneda–Stoikov model11Market making profit and loss attribution
Knowledge graph

© 2026 Quant Sandbox · A study aid for quantitative finance

Privacy & dataNo cookies

This site does not use cookies and asks for no personal data. It keeps a few small settings in your browser's local storage — your chosen theme and language, the sidebar layout, and your progress and answers in the Guides — so it remembers them on your next visit. This data never leaves your device; clearing your browser storage removes it. Inputs you change can also be captured in the page URL, so you can share or bookmark a specific setup. The site uses Vercel Web Analytics, a privacy-friendly, cookieless service that records only anonymous, aggregated usage (such as page views) without identifying you or tracking you across other sites.

Guides/Probability and measure/10

Independence and product measures

Lesson 10 of 13 · 1 min read

The lesson "Probability spaces and Kolmogorov's axioms" turned a probability into a measure of total mass 1 and showed that the binary digits of one uniform number behave like coin tosses, and "Expectation, variance and inequalities" turned averages into integrals and measured spread by the variance. Both looked at one random quantity at a time, but real questions involve several: two dice, the horizontal and vertical position of a dart, ten coins. This lesson makes the idea that one quantity carries no information about another precise under the name independence, first for events, then for σ-algebras and random variables. It shows that independence is the same thing as area being length times length, which leads to product measures and to Fubini's theorem for integrals over a product. From these come the rule E[XY]=E[X] E[Y]\mathbb{E}[XY] = \mathbb{E}[X]\,\mathbb{E}[Y]E[XY]=E[X]E[Y], the covariance, the variance of a sum, and finally the proof, promised earlier, that the binary digits of a uniform number are independent fair coins.

Conditional probability in brief

Roll two fair dice and suppose you are told that the first shows 3. The 36 equally likely outcomes shrink to the six with first die 3, and the sum is 8 exactly when the second die shows 5. So the probability of a sum of 8 has become 1/6≈0.16671/6 \approx 0.16671/6≈0.1667, while before the information it was 5/36≈0.13895/36 \approx 0.13895/36≈0.1389. Conditioning is this shrinking: keep only the outcomes of the event BBB known to have happened, and rescale so that BBB carries total probability 1. For an event BBB with P(B)>0\mathbb{P}(B) > 0P(B)>0, the conditional probability of AAA given BBB is

P(A∣B)=P(A∩B)P(B).\mathbb{P}(A \mid B) = \frac{\mathbb{P}(A \cap B)}{\mathbb{P}(B)}.P(A∣B)=P(B)P(A∩B)​.

In words: of the probability that BBB carries, the fraction that lies inside AAA. For the dice, AAA is "the sum is 8" and BBB is "the first die shows 3". The intersection is the single outcome (3,5)(3, 5)(3,5), so P(A∩B)=1/36\mathbb{P}(A \cap B) = 1/36P(A∩B)=1/36, and P(B)=1/6\mathbb{P}(B) = 1/6P(B)=1/6; the quotient is 1/61/61/6. The division by P(B)\mathbb{P}(B)P(B) is the rescaling; without it the restricted probabilities would add up to P(B)\mathbb{P}(B)P(B). For a fixed BBB the map A↦P(A∣B)A \mapsto \mathbb{P}(A \mid B)A↦P(A∣B) obeys the axioms of "Probability spaces and Kolmogorov's axioms": it is a probability measure again, the old one restricted to BBB and rescaled. This lesson needs conditional probability only as far as independence requires it; a later lesson of this track treats conditioning in full.

Independent events

Two events are independent when learning that one of them happened does not change the probability of the other: P(A∣B)=P(A)\mathbb{P}(A \mid B) = \mathbb{P}(A)P(A∣B)=P(A). Substitute the definition of conditional probability and multiply by P(B)\mathbb{P}(B)P(B), and the condition becomes the product rule

P(A∩B)=P(A) P(B).\mathbb{P}(A \cap B) = \mathbb{P}(A)\,\mathbb{P}(B).P(A∩B)=P(A)P(B).

The product rule is taken as the definition, because it needs no assumption P(B)>0\mathbb{P}(B) > 0P(B)>0 and treats the two events symmetrically. It says that the share of the whole space taken by "both" equals the share of AAA times the share of BBB, exactly as the area of a rectangle is width times height.

Independence does not require two separate physical mechanisms. Take one fair die, A=A = A= "even" and B={1,2}B = \{1, 2\}B={1,2}. Then P(A)=1/2\mathbb{P}(A) = 1/2P(A)=1/2, P(B)=1/3\mathbb{P}(B) = 1/3P(B)=1/3 and A∩B={2}A \cap B = \{2\}A∩B={2} has probability 1/6=12⋅131/6 = \tfrac12 \cdot \tfrac131/6=21​⋅31​. The events are independent, because the outcomes in BBB are half even, the same fraction as in the whole die. Replace BBB by {1,2,3}\{1, 2, 3\}{1,2,3} and the property is gone: P(A∩B)=1/6\mathbb{P}(A \cap B) = 1/6P(A∩B)=1/6, but P(A)P(B)=1/4\mathbb{P}(A)\mathbb{P}(B) = 1/4P(A)P(B)=1/4. Independence is a numerical relation between proportions inside the probability space. It usually arises because the events concern different dice or coins, but the definition only looks at the numbers.

An event of probability 0 or 1 is independent of every event, since both sides of the product rule are then 0 or P(A)\mathbb{P}(A)P(A). Independence also survives taking complements. If AAA and BBB are independent, so are AAA and BcB^cBc:

P(A∩Bc)=P(A)−P(A∩B)=P(A)−P(A) P(B)=P(A) P(Bc).\mathbb{P}(A \cap B^c) = \mathbb{P}(A) - \mathbb{P}(A \cap B) = \mathbb{P}(A) - \mathbb{P}(A)\,\mathbb{P}(B) = \mathbb{P}(A)\,\mathbb{P}(B^c).P(A∩Bc)=P(A)−P(A∩B)=P(A)−P(A)P(B)=P(A)P(Bc).

The first step is the rule μ(A∖B)=μ(A)−μ(A∩B)\mu(A \setminus B) = \mu(A) - \mu(A \cap B)μ(A∖B)=μ(A)−μ(A∩B) from "Measuring the size of sets", the second is the product rule for AAA and BBB, and the third is P(Bc)=1−P(B)\mathbb{P}(B^c) = 1 - \mathbb{P}(B)P(Bc)=1−P(B). Applying the same step to AcA^cAc and BBB, and then to AcA^cAc and BcB^cBc, shows that all four pairs made of AAA, AcA^cAc and BBB, BcB^cBc satisfy the product rule.

Disjoint is not the same as independent; it is nearly the opposite. If AAA and BBB are disjoint and both have positive probability, then P(A∩B)=0\mathbb{P}(A \cap B) = 0P(A∩B)=0 while P(A)P(B)>0\mathbb{P}(A)\mathbb{P}(B) > 0P(A)P(B)>0. Learning that BBB happened rules AAA out completely, which is the strongest possible dependence.

Pairwise and mutual independence

With three or more events, independence of every pair is not enough. Toss two fair coins, so that the four outcomes HH, HT, TH, TT have probability 1/41/41/4 each, and let

  • AAA = the first coin is heads ={HH,HT}= \{HH, HT\}={HH,HT},
  • BBB = the second coin is heads ={HH,TH}= \{HH, TH\}={HH,TH},
  • CCC = both coins show the same side ={HH,TT}= \{HH, TT\}={HH,TT}.

Each of the three events has probability 1/21/21/2. Each pairwise intersection is the single outcome HHHHHH, with probability 1/4=12⋅121/4 = \tfrac12 \cdot \tfrac121/4=21​⋅21​, so A,BA, BA,B, then A,CA, CA,C and B,CB, CB,C are all independent pairs. But the triple intersection A∩B∩C={HH}A \cap B \cap C = \{HH\}A∩B∩C={HH} also has probability 1/41/41/4, while the product of the three probabilities is 1/81/81/8. The reason: if AAA and BBB both happened, both coins are heads and CCC is certain, although neither AAA nor BBB alone says anything about CCC.

Events A1,…,AnA_1, \ldots, A_nA1​,…,An​ are therefore called mutually independent if the product rule holds for every sub-collection:

P(⋂i∈SAi)=∏i∈SP(Ai)for every S⊆{1,…,n}.\mathbb{P}\Big(\bigcap_{i \in S} A_i\Big) = \prod_{i \in S} \mathbb{P}(A_i) \qquad \text{for every } S \subseteq \{1, \ldots, n\}.P(i∈S⋂​Ai​)=i∈S∏​P(Ai​)for every S⊆{1,…,n}.

For three events this means four equations, three for the pairs and one for the triple; for nnn events it means 2n−n−12^n - n - 12n−n−1. An infinite family is mutually independent when every finite sub-collection is. When a sequence of coin tosses is called independent, this is what is meant, and from here on "independent" without further qualification means mutually independent. Events that are independent only in pairs are called pairwise independent.

Independent σ-algebras and random variables

Often one wants to compare everything that can be asked about one quantity with everything that can be asked about another: the first die against the second, the horizontal position of a dart against its vertical position. Recall from "σ-algebras and Borel sets" that a σ-algebra is a collection of questions that can be answered, closed under complements and countable unions. Two σ-algebras G\mathcal{G}G and H\mathcal{H}H inside the event collection F\mathcal{F}F are independent if every question of one is independent of every question of the other:

P(G∩H)=P(G) P(H)for all G∈G,  H∈H.\mathbb{P}(G \cap H) = \mathbb{P}(G)\,\mathbb{P}(H) \qquad \text{for all } G \in \mathcal{G},\; H \in \mathcal{H}.P(G∩H)=P(G)P(H)for all G∈G,H∈H.

Independence of two events AAA and BBB is the special case of the smallest σ-algebras {∅,A,Ac,Ω}\{\emptyset, A, A^c, \Omega\}{∅,A,Ac,Ω} and {∅,B,Bc,Ω}\{\emptyset, B, B^c, \Omega\}{∅,B,Bc,Ω}: the pairs involving AAA, AcA^cAc, BBB and BcB^cBc were settled in the previous section, and ∅\emptyset∅ and Ω\OmegaΩ have probabilities 0 and 1.

A random variable XXX comes with the σ-algebra σ(X)\sigma(X)σ(X) of "Measurable functions", made of all events {X∈B}\{X \in B\}{X∈B} for Borel sets BBB, the questions that can be answered by looking at XXX alone. Random variables XXX and YYY are independent if σ(X)\sigma(X)σ(X) and σ(Y)\sigma(Y)σ(Y) are independent, that is, if

P(X∈B,  Y∈C)=P(X∈B) P(Y∈C)for all Borel sets B,C.\mathbb{P}(X \in B,\; Y \in C) = \mathbb{P}(X \in B)\,\mathbb{P}(Y \in C) \qquad \text{for all Borel sets } B, C.P(X∈B,Y∈C)=P(X∈B)P(Y∈C)for all Borel sets B,C.

Checking every pair of Borel sets looks impossible, but half-lines are enough. The variables XXX and YYY are independent exactly when

P(X≤x,  Y≤y)=FX(x) FY(y)for all real x,y,\mathbb{P}(X \le x,\; Y \le y) = F_X(x)\,F_Y(y) \qquad \text{for all real } x, y,P(X≤x,Y≤y)=FX​(x)FY​(y)for all real x,y,

where FXF_XFX​ and FYF_YFY​ are the distribution functions of "Random variables and their distributions". The reason is the argument that made length unique in "Lebesgue measure and null sets": half-lines are closed under intersection and generate the Borel sets, and the sets for which a product rule holds are closed under complements and countable disjoint unions, so a product rule that holds on half-lines holds on all Borel sets. This is an idea of the proof, applied once to each variable, not a full proof. For the two dice, P(X≤3,Y≤2)=6/36=1/6\mathbb{P}(X \le 3, Y \le 2) = 6/36 = 1/6P(X≤3,Y≤2)=6/36=1/6, and FX(3)FY(2)=12⋅13=1/6F_X(3)F_Y(2) = \tfrac12 \cdot \tfrac13 = 1/6FX​(3)FY​(2)=21​⋅31​=1/6. For variables that take countably many values, the condition reads P(X=i,Y=j)=P(X=i) P(Y=j)\mathbb{P}(X = i, Y = j) = \mathbb{P}(X = i)\,\mathbb{P}(Y = j)P(X=i,Y=j)=P(X=i)P(Y=j) for all values i,ji, ji,j.

Independence passes through functions. If XXX and YYY are independent and ggg, hhh are measurable functions, then g(X)g(X)g(X) and h(Y)h(Y)h(Y) are independent. The reason is that an event about g(X)g(X)g(X) is an event about XXX: {g(X)∈B}={X∈g−1(B)}\{g(X) \in B\} = \{X \in g^{-1}(B)\}{g(X)∈B}={X∈g−1(B)}, and the preimage g−1(B)g^{-1}(B)g−1(B) is a Borel set because ggg is measurable. So σ(g(X))⊆σ(X)\sigma(g(X)) \subseteq \sigma(X)σ(g(X))⊆σ(X), and a smaller σ-algebra of an independent pair stays independent. The parity of the first die and the square of the second die are independent for this reason. Finally, random variables X1,…,XnX_1, \ldots, X_nX1​,…,Xn​ are mutually independent if P(X1∈B1,…,Xn∈Bn)=∏iP(Xi∈Bi)\mathbb{P}(X_1 \in B_1, \ldots, X_n \in B_n) = \prod_i \mathbb{P}(X_i \in B_i)P(X1​∈B1​,…,Xn​∈Bn​)=∏i​P(Xi​∈Bi​) for all Borel sets, which is the same as mutual independence of the σ-algebras σ(Xi)\sigma(X_i)σ(Xi​).

Product measures

The area of a rectangle [0,a]×[0,b][0, a] \times [0, b][0,a]×[0,b] in the unit square is ababab: length times length. "Lebesgue measure and null sets" built area by covering sets with rectangles. The same recipe works for any two measure spaces. Take (Ω1,F1,μ1)(\Omega_1, \mathcal{F}_1, \mu_1)(Ω1​,F1​,μ1​) and (Ω2,F2,μ2)(\Omega_2, \mathcal{F}_2, \mu_2)(Ω2​,F2​,μ2​) and form the set Ω1×Ω2\Omega_1 \times \Omega_2Ω1​×Ω2​ of pairs (ω1,ω2)(\omega_1, \omega_2)(ω1​,ω2​). A rectangle is a set A×BA \times BA×B with A∈F1A \in \mathcal{F}_1A∈F1​ and B∈F2B \in \mathcal{F}_2B∈F2​. The product σ-algebra F1⊗F2\mathcal{F}_1 \otimes \mathcal{F}_2F1​⊗F2​ is the σ-algebra generated by the rectangles, in the sense of "σ-algebras and Borel sets"; for R×R\mathbb{R} \times \mathbb{R}R×R with the Borel sets it is the Borel σ-algebra of the plane. The product measure μ1⊗μ2\mu_1 \otimes \mu_2μ1​⊗μ2​ is the measure on it that gives every rectangle its natural size,

(μ1⊗μ2)(A×B)=μ1(A) μ2(B).(\mu_1 \otimes \mu_2)(A \times B) = \mu_1(A)\,\mu_2(B).(μ1​⊗μ2​)(A×B)=μ1​(A)μ2​(B).

Such a measure exists, by covering a set with rectangles and taking the smallest total, and it is unique for finite measures and for measures such as length on R\mathbb{R}R, which are countable sums of finite pieces. The uniqueness argument is the one used for length: the intersection of two rectangles, (A×B)∩(A′×B′)=(A∩A′)×(B∩B′)(A \times B) \cap (A' \times B') = (A \cap A') \times (B \cap B')(A×B)∩(A′×B′)=(A∩A′)×(B∩B′), is again a rectangle, so a measure is pinned down by its values on rectangles. Two examples. Counting measure on the six faces of a die, taken twice, gives counting measure on the 36 pairs, and with the uniform probability 1/61/61/6 on each face every pair has probability 16⋅16=1/36\tfrac16 \cdot \tfrac16 = 1/3661​⋅61​=1/36. Length taken twice on [0,1][0, 1][0,1] gives area on the unit square.

Now the link to probability. Two random variables XXX and YYY on the same probability space have a joint distribution, the measure on the plane P(X,Y)(D)=P((X,Y)∈D)\mathbb{P}_{(X, Y)}(D) = \mathbb{P}((X, Y) \in D)P(X,Y)​(D)=P((X,Y)∈D), which is the image measure of ω↦(X(ω),Y(ω))\omega \mapsto (X(\omega), Y(\omega))ω↦(X(ω),Y(ω)) in the sense of "Measurable functions". On a rectangle it reads P(X,Y)(B×C)=P(X∈B,Y∈C)\mathbb{P}_{(X, Y)}(B \times C) = \mathbb{P}(X \in B, Y \in C)P(X,Y)​(B×C)=P(X∈B,Y∈C), and the definition of independence says that this equals PX(B) PY(C)\mathbb{P}_X(B)\,\mathbb{P}_Y(C)PX​(B)PY​(C). Since rectangles determine a measure, the two statements are the same:

X and Y are independent  ⟺  P(X,Y)=PX⊗PY.X \text{ and } Y \text{ are independent} \iff \mathbb{P}_{(X, Y)} = \mathbb{P}_X \otimes \mathbb{P}_Y.X and Y are independent⟺P(X,Y)​=PX​⊗PY​.

In words, the joint distribution of independent variables is the product of their separate distributions, and nothing else can be said about a pair unless the pair is told to be independent. If XXX and YYY have densities fXf_XfX​ and fYf_YfY​, the joint distribution of an independent pair has density fX(x) fY(y)f_X(x)\,f_Y(y)fX​(x)fY​(y), because P(X≤a,Y≤b)=FX(a)FY(b)\mathbb{P}(X \le a, Y \le b) = F_X(a)F_Y(b)P(X≤a,Y≤b)=FX​(a)FY​(b) is the integral of fX(x)fY(y)f_X(x)f_Y(y)fX​(x)fY​(y) over the quadrant. Two independent uniform numbers on [0,1][0, 1][0,1] form exactly a point chosen by area on the unit square. The dart of "Probability spaces and Kolmogorov's axioms", thrown uniformly at the square, therefore has independent horizontal and vertical coordinates.

The joint distribution holds more information than the two separate distributions. The figure shows a point (X,Y)(X, Y)(X,Y) in the unit square in which both coordinates are uniform on [0,1][0, 1][0,1], whatever the dependence. The event A={X≤a}A = \{X \le a\}A={X≤a} is the vertical strip of width aaa, the event B={Y≤b}B = \{Y \le b\}B={Y≤b} is the horizontal strip of height bbb, and A∩BA \cap BA∩B is the rectangle [0,a]×[0,b][0, a] \times [0, b][0,a]×[0,b] in the lower-left corner. The shading is the joint density c(x,y)=1+θ(1−2x)(1−2y)c(x, y) = 1 + \theta(1 - 2x)(1 - 2y)c(x,y)=1+θ(1−2x)(1−2y), so that θ\thetaθ sets how strongly the coordinates are tied together. Start at θ=0\theta = 0θ=0: the shading is flat, the pair is two independent uniforms, and the rectangle with a=0.6a = 0.6a=0.6 and b=0.5b = 0.5b=0.5 holds P(A∩B)=0.3=0.6⋅0.5\mathbb{P}(A \cap B) = 0.3 = 0.6 \cdot 0.5P(A∩B)=0.3=0.6⋅0.5. Move θ\thetaθ to 111: probability moves toward the lower-left and upper-right corners, the same rectangle now holds 0.360.360.36, and P(A∣B)\mathbb{P}(A \mid B)P(A∣B) rises from 0.60.60.6 to 0.720.720.72, so learning that YYY is small makes XXX small more likely. At θ=−1\theta = -1θ=−1 the rectangle holds 0.240.240.24 and P(A∣B)=0.48\mathbb{P}(A \mid B) = 0.48P(A∣B)=0.48. Throughout, P(A)\mathbb{P}(A)P(A) and P(B)\mathbb{P}(B)P(B) stay at 0.60.60.6 and 0.50.50.5: the dependence is entirely in how the coordinates are tied together. (The family is known as Farlie–Gumbel–Morgenstern; the name is not needed.)

Independent events as rectangles in the unit squareOpen in σ-Algebras
0.60
01
0.50
01
0.00
-11
000.50.511AB
ℙ(A)
0.6000
ℙ(B)
0.5000
ℙ(A ∩ B)
0.3000
ℙ(A)ℙ(B)
0.3000
ℙ(A | B)
0.6000

Slide a and b to resize the rectangle A × B and θ to tilt the density. At θ = 0 the shading is flat and the rectangle holds exactly ℙ(A)ℙ(B); for θ > 0 the lower-left and upper-right corners carry more mass, for θ < 0 the other two.

Fubini and Tonelli

A product measure lets you integrate over a product, and the way to do it is to slice. To find the area of a region in the square, add up the lengths of its vertical slices. In general, to integrate a function f(x,y)f(x, y)f(x,y) over the product, hold xxx fixed, integrate over yyy, and integrate the result over xxx. For f(x,y)=xyf(x, y) = xyf(x,y)=xy on the unit square,

∫01(∫01x y dy)dx=∫01x⋅12 dx=14.\int_0^1 \Big(\int_0^1 x\,y\,dy\Big) dx = \int_0^1 x \cdot \frac12\,dx = \frac14.∫01​(∫01​xydy)dx=∫01​x⋅21​dx=41​.

Doing the xxx-integral first gives ∫01y⋅12 dy=14\int_0^1 y \cdot \tfrac12\,dy = \tfrac14∫01​y⋅21​dy=41​ as well. Two theorems say when the order does not matter. Tonelli's theorem: for a measurable f≥0f \ge 0f≥0 on the product, both iterated integrals exist, possibly infinite, and both equal ∫f d(μ⊗ν)\int f \,d(\mu \otimes \nu)∫fd(μ⊗ν). Fubini's theorem: the same holds for every integrable fff, that is, when ∫∣f∣ d(μ⊗ν)<∞\int |f|\,d(\mu \otimes \nu) < \infty∫∣f∣d(μ⊗ν)<∞. The proof builds up in the order of "The Lebesgue integral": for the indicator of a rectangle the statement is the product rule; the uniqueness argument extends it to every set of the product σ-algebra; linearity gives simple functions; monotone convergence, from "Convergence theorems", gives non-negative functions; and f=f+−f−f = f^+ - f^-f=f+−f− gives integrable ones. This is an outline, not a proof.

Tonelli's theorem also explains a formula from earlier. Apply it to the indicator 1{t<f(x)}\mathbf{1}\{t < f(x)\}1{t<f(x)} of the region under the graph, on the product of the space and [0,∞)[0, \infty)[0,∞). Integrating over ttt first gives f(x)f(x)f(x), integrating over xxx first gives μ(f>t)\mu(f > t)μ(f>t), so ∫f dμ=∫0∞μ(f>t) dt\int f\,d\mu = \int_0^\infty \mu(f > t)\,dt∫fdμ=∫0∞​μ(f>t)dt, the layer-cake formula of "The Lebesgue integral". With P\mathbb{P}P in place of μ\muμ it is the tail formula of "Expectation, variance and inequalities".

Now the consequence for probability. Let XXX and YYY be independent and integrable. The expectation of XYXYXY is the integral of the function (x,y)↦xy(x, y) \mapsto xy(x,y)↦xy against the joint distribution, which is the product measure PX⊗PY\mathbb{P}_X \otimes \mathbb{P}_YPX​⊗PY​. Tonelli applied to ∣xy∣|xy|∣xy∣ gives E∣XY∣=E∣X∣ E∣Y∣<∞\mathbb{E}|XY| = \mathbb{E}|X|\,\mathbb{E}|Y| < \inftyE∣XY∣=E∣X∣E∣Y∣<∞, so XYXYXY is integrable and Fubini applies:

E[XY]=∫ ⁣ ⁣∫x y dPX(x) dPY(y)=∫x dPX(x)⋅∫y dPY(y)=E[X] E[Y].\mathbb{E}[XY] = \int\!\!\int x\,y \,d\mathbb{P}_X(x)\,d\mathbb{P}_Y(y) = \int x\,d\mathbb{P}_X(x) \cdot \int y\,d\mathbb{P}_Y(y) = \mathbb{E}[X]\,\mathbb{E}[Y].E[XY]=∫∫xydPX​(x)dPY​(y)=∫xdPX​(x)⋅∫ydPY​(y)=E[X]E[Y].

For the two dice E[XY]=3.5⋅3.5=12.25\mathbb{E}[XY] = 3.5 \cdot 3.5 = 12.25E[XY]=3.5⋅3.5=12.25, which a sum over the 36 pairs confirms. Without independence the rule fails: take Y=XY = XY=X, and E[X2]\mathbb{E}[X^2]E[X2] is larger than E[X]2\mathbb{E}[X]^2E[X]2 by the variance. The gap is exactly what the next section measures.

Integrability cannot be dropped from Fubini's theorem. The function f(x,y)=(x2−y2)/(x2+y2)2f(x, y) = (x^2 - y^2)/(x^2 + y^2)^2f(x,y)=(x2−y2)/(x2+y2)2 on the unit square has the two iterated integrals π/4\pi/4π/4 and −π/4-\pi/4−π/4 in the two orders; it is not integrable, since ∫∣f∣\int |f|∫∣f∣ is infinite near the origin.

Covariance and correlation

For independent variables E[XY]=E[X]E[Y]\mathbb{E}[XY] = \mathbb{E}[X]\mathbb{E}[Y]E[XY]=E[X]E[Y]. The size of the gap measures how far a pair is from behaving like that. For XXX and YYY with finite variance, the covariance is

Cov⁡(X,Y)=E[XY]−E[X] E[Y]=E[(X−EX)(Y−EY)].\operatorname{Cov}(X, Y) = \mathbb{E}[XY] - \mathbb{E}[X]\,\mathbb{E}[Y] = \mathbb{E}\big[(X - \mathbb{E}X)(Y - \mathbb{E}Y)\big].Cov(X,Y)=E[XY]−E[X]E[Y]=E[(X−EX)(Y−EY)].

The two forms agree after expanding the product and using linearity of expectation. The second form shows what covariance records: it is positive when above-average values of XXX tend to come with above-average values of YYY, and negative when they come with below-average ones. Taking Y=XY = XY=X gives Cov⁡(X,X)=Var⁡X\operatorname{Cov}(X, X) = \operatorname{Var} XCov(X,X)=VarX. Independence gives Cov⁡(X,Y)=0\operatorname{Cov}(X, Y) = 0Cov(X,Y)=0 by the product rule for expectations.

Covariance is exactly what is missing in the variance of a sum. Write X~=X−EX\tilde X = X - \mathbb{E}XX~=X−EX and Y~=Y−EY\tilde Y = Y - \mathbb{E}YY~=Y−EY; the centred sum is X~+Y~\tilde X + \tilde YX~+Y~. Then

Var⁡(X+Y)=E[(X~+Y~)2]=E[X~2]+2 E[X~Y~]+E[Y~2]\operatorname{Var}(X + Y) = \mathbb{E}\big[(\tilde X + \tilde Y)^2\big] = \mathbb{E}[\tilde X^2] + 2\,\mathbb{E}[\tilde X \tilde Y] + \mathbb{E}[\tilde Y^2]Var(X+Y)=E[(X~+Y~)2]=E[X~2]+2E[X~Y~]+E[Y~2]
Var⁡(X+Y)=Var⁡X+Var⁡Y+2Cov⁡(X,Y).\operatorname{Var}(X + Y) = \operatorname{Var} X + \operatorname{Var} Y + 2\operatorname{Cov}(X, Y).Var(X+Y)=VarX+VarY+2Cov(X,Y).

The first line squares the sum and uses linearity; the second recognises the three expectations. For independent variables, or just uncorrelated ones, the covariance term vanishes and the variances add. The same holds for any number of pairwise uncorrelated variables.

Ten dice show how much this matters. One die has variance 35/12≈2.91735/12 \approx 2.91735/12≈2.917 and standard deviation 1.7081.7081.708. The sum of ten independent dice has variance 10⋅35/12≈29.1710 \cdot 35/12 \approx 29.1710⋅35/12≈29.17 and standard deviation 29.17≈5.401\sqrt{29.17} \approx 5.40129.17​≈5.401. If the ten dice were instead the same die copied ten times, the sum would be 10X10X10X with standard deviation 10⋅1.708=17.0810 \cdot 1.708 = 17.0810⋅1.708=17.08. Independent fluctuations partly cancel: a high value of one die is likely to meet a low value of another, so the spread of the sum grows like n\sqrt{n}n​ instead of nnn. The average of the ten dice has standard deviation 1.708/10≈0.54011.708/\sqrt{10} \approx 0.54011.708/10​≈0.5401, a little under a third of the spread of a single die.

Worked example

Independence on two dice and the variance of ten dice

  1. The first die is even with probability:

    P(first even)=3/6\displaystyle \mathbb{P}(\text{first even}) = 3/6P(first even)=3/6=0.5
  2. The sum is 7 for exactly one second die value per first die value, so 6 of the 36 outcomes:

    P(sum=7)=6/36\displaystyle \mathbb{P}(\text{sum} = 7) = 6/36P(sum=7)=6/36=0.1666667
  3. Both: the first die is 2, 4 or 6 and the second makes the sum 7, which is 3 outcomes:

    P(first even and sum=7)=3/36\displaystyle \mathbb{P}(\text{first even and sum} = 7) = 3/36P(first even and sum=7)=3/36=0.0833333
  4. The product of the two separate probabilities is the same number, so the events are independent:

    12⋅16\displaystyle \tfrac12 \cdot \tfrac1621​⋅61​=0.0833333
  5. The variance of one die, from E[X2]−E[X]2=91/6−49/4\mathbb{E}[X^2] - \mathbb{E}[X]^2 = 91/6 - 49/4E[X2]−E[X]2=91/6−49/4:

    35/12\displaystyle 35/1235/12=2.916667
  6. Independence makes variances add, so for ten dice:

    10⋅35/12\displaystyle 10 \cdot 35/1210⋅35/12=29.166667
  7. The standard deviation of the sum of ten dice:

    29.1667\displaystyle \sqrt{29.1667}29.1667​=5.400617

The result of the third and fourth steps looks surprising next to the first section, where learning the first die changed the probability of a sum of 8. A sum of 7 is special: whatever the first die shows, exactly one value of the second makes the sum 7, so the first die tells you nothing about whether the sum is 7. The sum of 8 is impossible after a first die of 1, and that is a piece of information.

Covariance depends on the units of measurement. The correlation removes them by dividing by the two standard deviations:

ρ(X,Y)=Cov⁡(X,Y)Var⁡X Var⁡Y.\rho(X, Y) = \frac{\operatorname{Cov}(X, Y)}{\sqrt{\operatorname{Var} X}\,\sqrt{\operatorname{Var} Y}}.ρ(X,Y)=VarX​VarY​Cov(X,Y)​.

Correlation always lies in [−1,1][-1, 1][−1,1]. This is the Cauchy–Schwarz inequality, E∣X~Y~∣≤E[X~2] E[Y~2]\mathbb{E}|\tilde X \tilde Y| \le \sqrt{\mathbb{E}[\tilde X^2]\,\mathbb{E}[\tilde Y^2]}E∣X~Y~∣≤E[X~2]E[Y~2]​, which is stated here without proof. It equals +1+1+1 or −1-1−1 exactly when YYY is, almost surely, an increasing or a decreasing linear function of XXX, and it is 000 when the variables are uncorrelated. As an example let XXX and YYY be two independent dice and S=X+YS = X + YS=X+Y their sum. Then Cov⁡(X,S)=Var⁡X+Cov⁡(X,Y)=35/12\operatorname{Cov}(X, S) = \operatorname{Var} X + \operatorname{Cov}(X, Y) = 35/12Cov(X,S)=VarX+Cov(X,Y)=35/12, because the second die is independent of the first, and ρ=(35/12)/(1.708⋅2.415)≈0.7071\rho = (35/12)/(1.708 \cdot 2.415) \approx 0.7071ρ=(35/12)/(1.708⋅2.415)≈0.7071, which is 1/21/\sqrt 21/2​: the first die supplies half of the variance of the sum, and ρ2=1/2\rho^2 = 1/2ρ2=1/2.

Uncorrelated variables that are not independent

Independence implies zero covariance, but the converse is false. Let XXX be uniform on {−1,0,1}\{-1, 0, 1\}{−1,0,1}, each value with probability 1/31/31/3, and let Y=X2Y = X^2Y=X2. Then E[X]=0\mathbb{E}[X] = 0E[X]=0, and since X3=XX^3 = XX3=X for these values, E[XY]=E[X3]=E[X]=0\mathbb{E}[XY] = \mathbb{E}[X^3] = \mathbb{E}[X] = 0E[XY]=E[X3]=E[X]=0, so

Cov⁡(X,Y)=E[X3]−E[X] E[X2]=0−0=0.\operatorname{Cov}(X, Y) = \mathbb{E}[X^3] - \mathbb{E}[X]\,\mathbb{E}[X^2] = 0 - 0 = 0.Cov(X,Y)=E[X3]−E[X]E[X2]=0−0=0.

Yet YYY is a function of XXX, so the pair is about as dependent as a pair can be. The product rule fails at once: Y=1Y = 1Y=1 happens with probability 2/32/32/3 and X=0X = 0X=0 with probability 1/31/31/3, but X=0X = 0X=0 forces Y=0Y = 0Y=0, so P(X=0,Y=1)=0\mathbb{P}(X = 0, Y = 1) = 0P(X=0,Y=1)=0, while P(X=0) P(Y=1)=13⋅23=2/9\mathbb{P}(X = 0)\,\mathbb{P}(Y = 1) = \tfrac13 \cdot \tfrac23 = 2/9P(X=0)P(Y=1)=31​⋅32​=2/9.

The explanation is that covariance only detects a linear tendency: whether larger XXX goes with larger YYY on average. Here YYY falls as XXX rises from −1-1−1 to 000 and rises again from 000 to 111, and the two trends cancel exactly. Independence is a statement about all pairs of events at once, correlation is one number computed from them, and zero correlation never proves independence.

Independent coin tosses inside one uniform number

"Probability spaces and Kolmogorov's axioms" modelled infinitely many coin tosses by the binary digits of a number ω\omegaω drawn uniformly from [0,1)[0, 1)[0,1), written here d1(ω),d2(ω),…d_1(\omega), d_2(\omega), \ldotsd1​(ω),d2​(ω),…, and treated them as separate fair coins without proving that they are independent. The tools are now in place. The first digit is 111 exactly on [12,1)[\tfrac12, 1)[21​,1), so P(d1=1)=12\mathbb{P}(d_1 = 1) = \tfrac12P(d1​=1)=21​. The second digit is 111 on [14,12)∪[34,1)[\tfrac14, \tfrac12) \cup [\tfrac34, 1)[41​,21​)∪[43​,1), again of total length 12\tfrac1221​. In general dk=1d_k = 1dk​=1 on 2k−12^{k-1}2k−1 intervals of length 2−k2^{-k}2−k, so every digit is a fair coin. Two digits together: {d1=1,d2=1}=[34,1)\{d_1 = 1, d_2 = 1\} = [\tfrac34, 1){d1​=1,d2​=1}=[43​,1) has length 14=12⋅12\tfrac14 = \tfrac12 \cdot \tfrac1241​=21​⋅21​.

The general case is the same computation. Fix the first kkk digits to prescribed values. They determine one dyadic interval [m/2k,(m+1)/2k)[m/2^k, (m+1)/2^k)[m/2k,(m+1)/2k), where mmm is the integer with those binary digits, of length 2−k2^{-k}2−k, which is the product of kkk factors 12\tfrac1221​. Digits at arbitrary positions i1<⋯<iji_1 < \cdots < i_ji1​<⋯<ij​ are no harder. Let n=ijn = i_jn=ij​ be the last position. The n−jn - jn−j unconstrained digits among the first nnn can take any of 2n−j2^{n-j}2n−j values, so the event is a union of 2n−j2^{n-j}2n−j dyadic intervals of length 2−n2^{-n}2−n, with total length 2−j2^{-j}2−j, which is again the product of jjj factors 12\tfrac1221​. The product rule therefore holds for every finite set of digits: the digits d1,d2,…d_1, d_2, \ldotsd1​,d2​,… are mutually independent, and each is a fair coin.

Worked example

Three binary digits of 0.8

  1. The first digit is 1 exactly on [12,1)[\tfrac12, 1)[21​,1), so its probability is:

    λ([12,1))\displaystyle \lambda([\tfrac12, 1))λ([21​,1))=0.5
  2. The number 0.8=0.11001100…20.8 = 0.11001100\ldots_20.8=0.11001100…2​ has first three digits 1, 1, 0, read as a binary integer:

    1⋅4+1⋅2+0⋅1\displaystyle 1 \cdot 4 + 1 \cdot 2 + 0 \cdot 11⋅4+1⋅2+0⋅1=6
  3. These three digits fix the dyadic interval [6/8,7/8)[6/8, 7/8)[6/8,7/8), whose left end is:

    6/8\displaystyle 6/86/8=0.75
  4. Its length is:

    1/8\displaystyle 1/81/8=0.125
  5. The product of three fair-coin probabilities is the same number:

    (1/2)3\displaystyle (1/2)^3(1/2)3=0.125
  6. Fix only d2=1d_2 = 1d2​=1 and d4=0d_4 = 0d4​=0. The digits d1d_1d1​ and d3d_3d3​ are free, giving 4 dyadic intervals of length 1/161/161/16:

    4⋅1/16\displaystyle 4 \cdot 1/164⋅1/16=0.25
  7. The product of the two separate probabilities:

    P(d2=1) P(d4=0)=12⋅12\displaystyle \mathbb{P}(d_2 = 1)\,\mathbb{P}(d_4 = 0) = \tfrac12 \cdot \tfrac12P(d2​=1)P(d4​=0)=21​⋅21​=0.25

One uniform number therefore holds an infinite sequence of independent fair coins. It holds much more. Deal the digits of ω\omegaω into two sequences, the odd positions and the even positions, and read each as a binary number: U=0.d1d3d5…2U = 0.d_1 d_3 d_5 \ldots_2U=0.d1​d3​d5​…2​ and V=0.d2d4d6…2V = 0.d_2 d_4 d_6 \ldots_2V=0.d2​d4​d6​…2​. The first kkk digits of UUU are kkk independent fair coins, so UUU lands in each dyadic interval of length 2−k2^{-k}2−k with probability 2−k2^{-k}2−k, and since dyadic intervals are closed under intersection and generate the Borel sets, UUU is uniform on [0,1)[0, 1)[0,1); likewise VVV. The two sequences are built from disjoint groups of independent coins, and functions of disjoint groups of independent variables are independent, by the same argument as for functions of two variables. So UUU and VVV are independent uniforms, and by the previous sections (U,V)(U, V)(U,V) is a point drawn by area on the unit square. The map ω↦(U,V)\omega \mapsto (U, V)ω↦(U,V) carries length on [0,1)[0, 1)[0,1) onto area on the square. For ω=0.8\omega = 0.8ω=0.8 the first eight digits give U=V=0.625U = V = 0.625U=V=0.625 and the full expansions give U=V=2/3U = V = 2/3U=V=2/3.

Dealing the digits into countably many sequences, by the rows of a table, gives a whole sequence of independent uniform numbers from one. Applying the quantile function of "Random variables and their distributions" to each gives independent variables of any prescribed distributions. The interval [0,1)[0, 1)[0,1) with length is thus a sample space large enough for any sequence of independent random variables. That infinite products of probability measures exist in general is Kolmogorov's extension theorem; the construction above is a concrete instance. The next lesson, "Modes of convergence and the law of large numbers", uses independent tosses to show how frequencies settle down.

Summary

  • Events are independent when P(A∩B)=P(A)P(B)\mathbb{P}(A \cap B) = \mathbb{P}(A)\mathbb{P}(B)P(A∩B)=P(A)P(B), equivalently when conditioning on one leaves the other unchanged; for several events the product rule must hold for every sub-collection, since independence in pairs is not enough.
  • σ-algebras are independent when all their events are; random variables are independent when σ(X)\sigma(X)σ(X) and σ(Y)\sigma(Y)σ(Y) are, which can be checked on half-lines, and functions of independent variables stay independent.
  • The product measure μ1⊗μ2\mu_1 \otimes \mu_2μ1​⊗μ2​ is the unique measure that gives every rectangle the product of the sides; area is length ⊗\otimes⊗ length, and the joint distribution of independent variables is the product of their distributions.
  • Fubini and Tonelli let you integrate over a product in either order, and give E[XY]=E[X]E[Y]\mathbb{E}[XY] = \mathbb{E}[X]\mathbb{E}[Y]E[XY]=E[X]E[Y] for independent variables.
  • Var⁡(X+Y)=Var⁡X+Var⁡Y+2Cov⁡(X,Y)\operatorname{Var}(X + Y) = \operatorname{Var} X + \operatorname{Var} Y + 2\operatorname{Cov}(X, Y)Var(X+Y)=VarX+VarY+2Cov(X,Y), so variances of independent variables add; uncorrelated does not imply independent.
  • The binary digits of a uniform number are independent fair coins, and dealing them into two sequences produces two independent uniform numbers.
Try itOpen the σ-algebras lab
Previous · 09Expectation, variance and inequalitiesNext · 11Modes of convergence and the law of large numbers
Connections

Independence and product measures

Open the full graph
Builds on
05.09Expectation, variance and inequalities05.07Probability spaces and Kolmogorov's axioms05.01Measuring the size of sets05.02σ-algebras and Borel sets05.04Measurable functions05.08Random variables and their distributions05.03Lebesgue measure and null sets05.05The Lebesgue integral05.06Convergence theorems
Leads to
05.11Modes of convergence and the law of large numbers05.12Conditional probability and conditional expectation05.13Measure theory in option pricing
See it in the knowledge graph
Labs for this lesson
σ-Algebras