Lecture 4

Expectation, inequalities, and applications

Course edition
Fall 2026
Last updated
October 19, 2026

Part I · Foundations: the language of probability · Lecture 4 of 5

Student PDFReport an issue

A guided route

Lecture map

High and mid topics are both examined. Follow the topic links, and open optional branches when they help.

These notes support STAT 709 at the University of Wisconsin–Madison. Use them alongside the cited textbooks; corrections and questions are welcome.

High priorityFrom integration to probability

  • Purpose. Lectures 2 and 3 supplied random variables, their laws, and integration. We now give the probability integral its usual name: expectation. The central question is how information about a distribution becomes a useful numerical summary or a probability bound. An average loss, a variance, and an expected number of triangles in a graph are all expectations, even though their formulas may look different.

  • Route. We first learn to compute expectations from laws and tails. We then study norms and inequalities, and use them in examples involving random graphs, information theory, and collinearity. Independence and conditional expectation are developed further in Lecture 5; in this lecture, any independence used in a specific model is stated explicitly.

Recap from earlier lecturesFrom Lectures 1–3: integrals and inequalities · 1 min

Reminder only: this block introduces no new exam requirements.

Learning goals

1. Expectation

High priorityDefinition and the role of the probability measure

Definition 1Expectation and integrability

Let \(X:\Omega\to\R\)X:Ω→ℝX:\Omega\to\mathbb{R} be a random variable on \((\Omega,\gF,P)\)(Ω,ℱ,P)(\Omega,\mathcal{F},P). If \(X\ge0\)X≥0X\ge0 almost surely, define \(\E X=\int_\Omega X\,dP\in[0,\infty]\)𝔼X=∫ΩXdP∈[0,∞]\mathbb{E}X=\int_\Omega X\,dP\in[0,\infty]. For a signed \(X\)XX, write \(X^+=\max(X,0)\)X+=max(X,0)X^+=\max(X,0) and \(X^-=\max(-X,0)\)X−=max(−X,0)X^-=\max(-X,0). Then \(\E X=\E X^+-\E X^-\)𝔼X=𝔼X+−𝔼X−\mathbb{E}X=\mathbb{E}X^+-\mathbb{E}X^- is defined if at least one term is finite; \(\infty-\infty\)∞−∞\infty-\infty is undefined. We call \(X\)XX integrable, or say it has finite expectation, when \[\E|X|=\int_\Omega |X(\omega)|\,dP(\omega)<\infty.\]𝔼|X|=∫Ω|X(ω)|dP(ω)<∞.\mathbb{E}|X|=\int_\Omega |X(\omega)|\,dP(\omega)<\infty. In that case both terms are finite and \(\E X=\int_\Omega X\,dP\in\R\)𝔼X=∫ΩXdP∈ℝ\mathbb{E}X=\int_\Omega X\,dP\in\mathbb{R}.

Linearity holds for integrable random variables and does not require independence. Expectation also preserves inequalities: if \(X\le Y\)X≤YX\le Y a.s. and both are integrable, then \(Y-X\ge0\)Y−X≥0Y-X\ge0, so positivity of the integral gives \(\E Y-\E X=\E(Y-X)\ge0\)𝔼Y−𝔼X=𝔼(Y−X)≥0\mathbb{E}Y-\mathbb{E}X=\mathbb{E}(Y-X)\ge0. For nonnegative variables the corresponding monotonicity also holds with infinite expectations.

Instructor’s NoteA unified definition

In undergraduate probability, expectation is a probability-weighted sum of outcomes for discrete random variables and a density-weighted integral for continuous random variables. Measure theory provides a unified definition. The weighting is “absorbed” into an abstract probability measure \(P\)PP without specifying the base measure.

Changing from outcomes to the law of a random variable

High priorityTwo domains, the same expectation
Definition 2Distribution or law

For a real-valued \(X\)XX, its law is the probability measure \(\mu_X=P\circ X^{-1}\)μX=P∘X−1\mu_X=P\circ X^{-1} on \((\R,\gB)\)(ℝ,ℬ)(\mathbb{R},\mathcal{B}) given by \[\mu_X(B)=P\{\omega:X(\omega)\in B\},\qquad B\in\gB.\]μX(B)=P{ω:X(ω)∈B},B∈ℬ.\mu_X(B)=P\{\omega:X(\omega)\in B\},\qquad B\in\mathcal{B}. The cumulative distribution function (CDF) is \(F_X(t)=P(X\le t)=\mu_X(( -\infty,t])\)FX(t)=P(X≤t)=μX((−∞,t])F_X(t)=P(X\le t)=\mu_X(( -\infty,t]).

  • Identity. For a Borel function \(g:\R\to\R\)g:ℝ→ℝg:\mathbb{R}\to\mathbb{R}, the change-of-variables identity is

    \[\E[g(X)]=\int_\Omega g(X(\omega))\,dP(\omega) =\int_\R g(x)\,d\mu_X(x).\]𝔼[g(X)]=∫Ωg(X(ω))dP(ω)=∫ℝg(x)dμX(x).\mathbb{E}[g(X)]=\int_\Omega g(X(\omega))\,dP(\omega) =\int_\mathbb{R}g(x)\,d\mu_X(x).

    (1)
  • When it applies. It holds for nonnegative \(g\)gg, allowing \(+\infty\)+∞+\infty, and for integrable \(g(X)\)g(X)g(X); more generally it holds whenever the positive/negative-part definition is unambiguous. In particular, \(\E|g(X)|=\int|g|\,d\mu_X\)𝔼|g(X)|=∫|g|dμX\mathbb{E}|g(X)|=\int|g|\,d\mu_X.

  • Change of domain. The measure on the right lives on possible values of \(X\)XX; it is not the original measure \(P\)PP on outcomes. This identity does not require a density or a one-to-one map. A vector-valued \(X\)XX uses the same argument with \(\R^d\)ℝd\mathbb{R}^d in place of \(\R\)ℝ\mathbb{R}.

The law and its CDF determine each other. For \(a<b\)a<ba<b,

\[F_X(b)-F_X(a)=P(a<X\le b) =\int_\Omega\mathbf1_{(a,b]}(X(\omega))\,dP(\omega) =\mu_X((a,b]).\]FX(b)−FX(a)=P(a<X≤b)=∫Ω1(a,b](X(ω))dP(ω)=μX((a,b]).F_X(b)-F_X(a)=P(a<X\le b) =\int_\Omega\mathbf1_{(a,b]}(X(\omega))\,dP(\omega) =\mu_X((a,b]).

(2)

Thus the CDF specifies the probabilities of half-open intervals; the uniqueness of the Borel probability measure with these interval values is the CDF correspondence from Lecture 2. Notice the integration domain \(\Omega\)Ω\Omega in the middle expression, rather than the interval \((a,b]\)(a,b](a,b].

Mid priorityA mixed law retains both kinds of mass
Example 1Discrete and absolutely continuous components
  • Model. Let \(p_j\ge0\)pj≥0p_j\ge0, \(\sum_{j\ge0}p_j=1\)∑j≥0pj=1\sum_{j\ge0}p_j=1, and \(\mu_0=\sum_{j\ge0}p_j\delta_j\)μ0=∑j≥0pjδj\mu_0=\sum_{j\ge0}p_j\delta_j, where \(\delta_j\)δj\delta_j puts unit mass at \(j\)jj. Let \(h\ge0\)h≥0h\ge0 be a Lebesgue density with \(\int_\R h(x)\,dx=1\)∫ℝh(x)dx=1\int_\mathbb{R}h(x)\,dx=1. Then \[\mu(B)=\tfrac12\mu_0(B)+\tfrac12\int_B h(x)\,dx\]μ(B)=12μ0(B)+12∫Bh(x)dx\mu(B)=\tfrac12\mu_0(B)+\tfrac12\int_B h(x)\,dx is a probability law.

  • CDF and expectation. Its CDF and, for integrable \(g\)gg, its expectation are \[F(t)=\tfrac12\sum_{j\le t}p_j+\tfrac12\int_{-\infty}^t h(x)\,dx, \qquad \int g\,d\mu=\tfrac12\sum_{j\ge0}p_jg(j)+\tfrac12\int_\R g(x)h(x)\,dx.\]F(t)=12∑j≤tpj+12∫−∞th(x)dx,∫gdμ=12∑j≥0pjg(j)+12∫ℝg(x)h(x)dx.F(t)=\tfrac12\sum_{j\le t}p_j+\tfrac12\int_{-\infty}^t h(x)\,dx, \qquad \int g\,d\mu=\tfrac12\sum_{j\ge0}p_jg(j)+\tfrac12\int_\mathbb{R}g(x)h(x)\,dx.

  • Interpretation. The CDF jumps by \(p_j/2\)pj/2p_j/2 precisely at the integers with \(p_j>0\)pj>0p_j>0 and is continuous elsewhere. This law has neither a Lebesgue density nor a pmf that accounts for all its mass. It does have a density relative to the combined reference measure \(\sum_{j\ge0}\delta_j+dx\)∑j≥0δj+dx\sum_{j\ge0}\delta_j+dx, as in Lecture 3.

An atom plus a uniform component Explanation
Point mass 1/2 at zero.Density 1/4 on (0,2), with area 1/2.Right-continuous CDF: jump 1/2 at zero, then linear rise to one at two.

For a concrete picture, take \(\mu=\tfrac12\delta_0+\tfrac12\mathrm{Unif}([0,2])\)μ=12δ0+12Unif([0,2])\mu=\tfrac12\delta_0+\tfrac12\mathrm{Unif}([0,2]). Then \[F(t)=\begin{cases}0,&t<0,\\ \tfrac12+\tfrac14t,&0\le t\le2,\\1,&t>2. \end{cases}\]F(t)={0,t<0,12+14t,0≤t≤2,1,t>2.F(t)=\begin{cases}0,&t<0,\\ \tfrac12+\tfrac14t,&0\le t\le2,\\1,&t>2. \end{cases} The jump at zero records an atom of mass \(1/2\)1/21/2; the rise from \(1/2\)1/21/2 to \(1\)11 over \((0,2)\)(0,2)(0,2) records the continuous half of the mass. Integrating only the ordinary density \(\tfrac14\mathbf1_{(0,2)}\)141(0,2)\tfrac14\mathbf1_{(0,2)} would miss the atom.

A three-part decomposition of a law

Low priority — not examined: Optional refinement of the mixed-law picture
Quick Explanation
Cantor distribution

Every Borel probability measure on \(\R\)ℝ\mathbb{R} has a unique decomposition

\[\mu=\mu_{\mathrm{dis}}+\mu_{\mathrm{cont}}+\mu_{\mathrm{sing}}.\]μ=μdis+μcont+μsing.\mu=\mu_{\mathrm{dis}}+\mu_{\mathrm{cont}}+\mu_{\mathrm{sing}}.

(3)

Here the three terms are finite nonnegative measures whose total masses sum to one; individually they need not be probability measures.

  • The discrete (atomic) part is \(\mu_{\mathrm{dis}}=\sum_{a\in D}\mu(\{a\})\delta_a\)μdis=∑a∈Dμ({a})δa\mu_{\mathrm{dis}}=\sum_{a\in D}\mu(\{a\})\delta_a, where \(D=\{a:\mu(\{a\})>0\}\)D={a:μ({a})>0}D=\{a:\mu(\{a\})>0\} is at most countable. Its atoms give exactly the CDF jumps, since \(F(a)-F(a-)=\mu(\{a\})\)F(a)−F(a−)=μ({a})F(a)-F(a-)=\mu(\{a\}).

  • The absolutely continuous part satisfies \(\mu_{\mathrm{cont}}(B)=\int_B f(x)\,dx\)μcont(B)=∫Bf(x)dx\mu_{\mathrm{cont}}(B)=\int_B f(x)\,dx for some \(f\ge0\)f≥0f\ge0. Its total mass \(\int f\)∫f\int f can be smaller than one. We use the legacy subscript “cont” for this part, but it means absolutely continuous with respect to Lebesgue measure, not merely a continuous CDF.

  • The singular continuous part \(\mu_{\mathrm{sing}}\)μsing\mu_{\mathrm{sing}} is concentrated on a Lebesgue-null Borel set and has no atoms: \(\mu_{\mathrm{sing}}(\{a\})=0\)μsing({a})=0\mu_{\mathrm{sing}}(\{a\})=0 for every \(a\)aa. This distinguishes it from the entire singular part relative to Lebesgue measure, which also includes the atoms. The Cantor distribution is a standard example.1

Instructor’s NoteThree pictures of probability mass

Think of three ways to arrange probability mass: piles at individual points, mass spread out with a density, and atomless mass on a very thin set. The piles make jumps in the CDF. For the third picture, imagine successively concentrating the mass onto thinner collections of intervals: in the limit, all the probability sits on a zero-measure set, yet no single point carries a pile. The CDF is still continuous.

The construction and a precise proof reference are given in Section 4. No part of the high/mid calculations below requires this optional decomposition theorem.

Expectations from tails and Gaussian transformations

High priorityTail integrals

  • Conditions and identity. If \(f:[0,\infty)\to[0,\infty)\)f:[0,∞)→[0,∞)f:[0,\infty)\to[0,\infty) is nondecreasing and continuously differentiable with \(f(0)=0\)f(0)=0f(0)=0, then

    \[\E[f(|X|)]=\int_0^\infty f'(t)P(|X|>t)\,dt.\]𝔼[f(|X|)]=∫0∞f′(t)P(|X|>t)dt.\mathbb{E}[f(|X|)]=\int_0^\infty f'(t)P(|X|>t)\,dt.

    (4)
  • Why Tonelli applies. Both sides may be infinite. The appropriate interchange theorem is Tonelli’s theorem, because the integrand is nonnegative; one need not assume the desired expectation is finite beforehand. In particular, \[\E|X|=\int_0^\infty P(|X|>t)\,dt.\]𝔼|X|=∫0∞P(|X|>t)dt.\mathbb{E}|X|=\int_0^\infty P(|X|>t)\,dt.

  • Interpretation. This relates the average magnitude to the entire tail curve, rather than to a single tail probability.

A discrete example is drawn in the complete tail-identity solution.

Mid priorityGaussian squares and their distributions

  • One square. If \(Z\sim N(0,1)\)Z∼N(0,1)Z\sim N(0,1), then \(Z^2\)Z2Z^2 has the chi-squared distribution with one degree of freedom, denoted \(\chi_1^2\)χ12\chi_1^2.

  • Two squares. If \(Z_1,Z_2\)Z1,Z2Z_1,Z_2 are independent \(N(0,1)\)N(0,1)N(0,1) variables, then \[Z_1^2+Z_2^2\sim\chi_2^2=\mathrm{Exp}(\text{rate }1/2).\]Z12+Z22∼χ22=Exp(rate 1/2).Z_1^2+Z_2^2\sim\chi_2^2=\mathrm{Exp}(\text{rate }1/2).

  • Rate convention. Our convention is that \(Y\sim\mathrm{Exp}(\text{rate }\lambda)\)Y∼Exp(rate λ)Y\sim\mathrm{Exp}(\text{rate }\lambda) has density \(\lambda e^{-\lambda y}\mathbf1_{\{y>0\}}\)λe−λy1{y>0}\lambda e^{-\lambda y}\mathbf1_{\{y>0\}} and survival probability \(P(Y>y)=e^{-\lambda y}\)P(Y>y)=e−λyP(Y>y)=e^{-\lambda y} for \(y\ge0\)y≥0y\ge0. Thus the squared two-dimensional standard-normal radius has rate \(1/2\)1/21/2, not rate \(1\)11. The full density and polar-coordinate calculations are in Exercise 6 and its solution; see also the expectation examples in [3].

2. Functional perspective and inequalities

Norms, moments, and covariance

High priorityMeasure the size of a random variable

  • Space and norm. For \(1\le p<\infty\)1≤p<∞1\le p<\infty, let \(L^p(P)\)Lp(P)L^p(P) consist of random variables with \(\E|X|^p<\infty\)𝔼|X|p<∞\mathbb{E}|X|^p<\infty. For \(p=\infty\)p=∞p=\infty, use the essentially bounded random variables. Their \(L^p\)LpL^p norms are \[\|X\|_p=\begin{cases} (\E|X|^p)^{1/p},&1\le p<\infty,\\ \inf\{M\ge0:P(|X|>M)=0\},&p=\infty. \end{cases}\]∥X∥p={(𝔼|X|p)1/p,1≤p<∞,inf{M≥0:P(|X|>M)=0},p=∞.\|X\|_p=\begin{cases} (\mathbb{E}|X|^p)^{1/p},&1\le p<\infty,\\ \inf\{M\ge0:P(|X|>M)=0\},&p=\infty. \end{cases}

  • Essential bound. An empty set in the last infimum gives \(+\infty\)+∞+\infty, which means \(X\notin L^\infty\)X∉L∞X\notin L^\infty. The essential supremum ignores exceptional values on a zero-probability set.

  • Identifying variables. To obtain a norm, we identify variables equal almost surely, rather than treating different values on a null set as different elements.2

Theorem 1Hölder and Cauchy–Schwarz

Let \(1\le p,q\le\infty\)1≤p,q≤∞1\le p,q\le\infty with \(1/p+1/q=1\)1/p+1/q=11/p+1/q=1, interpreting \(1/\infty=0\)1/∞=01/\infty=0. For \(X\in L^p(P)\)X∈Lp(P)X\in L^p(P) and \(Y\in L^q(P)\)Y∈Lq(P)Y\in L^q(P), \[\E|XY|\le\|X\|_p\|Y\|_q.\]𝔼|XY|≤∥X∥p∥Y∥q.\mathbb{E}|XY|\le\|X\|_p\|Y\|_q. In particular, \(X,Y\in L^2(P)\)X,Y∈L2(P)X,Y\in L^2(P) imply \(\E|XY|\le(\E X^2)^{1/2}(\E Y^2)^{1/2}\)𝔼|XY|≤(𝔼X2)1/2(𝔼Y2)1/2\mathbb{E}|XY|\le(\mathbb{E}X^2)^{1/2}(\mathbb{E}Y^2)^{1/2}.

The proof of Hölder, and the triangle inequality (Minkowski) needed for the norm assertion, are given in Exercise 7 and its complete solution. Positivity, homogeneity, and the treatment of null sets are included there. Finite-dimensional norm intuition from Lecture 1 helps, but is not itself a proof for an arbitrary probability space.

Example 2Higher moments control lower moments
Example 3Covariance is bounded by marginal variation

For \(X,Y\in L^2(P)\)X,Y∈L2(P)X,Y\in L^2(P), define \[\mathrm{Cov}(X,Y)=\E[(X-\E X)(Y-\E Y)],\qquad \var(X)=\E[(X-\E X)^2].\]Cov(X,Y)=𝔼[(X−𝔼X)(Y−𝔼Y)],Var(X)=𝔼[(X−𝔼X)2].\mathrm{Cov}(X,Y)=\mathbb{E}[(X-\mathbb{E}X)(Y-\mathbb{E}Y)],\qquad \operatorname{Var}(X)=\mathbb{E}[(X-\mathbb{E}X)^2].

Convexity and probability bounds

High priorityJensen’s inequality
Theorem 2Jensen

Let \(\varphi:\R\to\R\)φ:ℝ→ℝ\varphi:\mathbb{R}\to\mathbb{R} be a finite convex function and let \(X\)XX be integrable. Then \(\E\varphi(X)\)𝔼φ(X)\mathbb{E}\varphi(X) is well defined in \((-\infty,\infty]\)(−∞,∞](-\infty,\infty], and \[\varphi(\E X)\le\E\varphi(X).\]φ(𝔼X)≤𝔼φ(X).\varphi(\mathbb{E}X)\le\mathbb{E}\varphi(X). If \(\varphi\)φ\varphi is strictly convex, equality holds if and only if \(X=\E X\)X=𝔼XX=\mathbb{E}X almost surely.

Proof.

  • Supporting line. Put \(m=\E X\)m=𝔼Xm=\mathbb{E}X. A finite convex function on \(\R\)ℝ\mathbb{R} has a supporting line at \(m\)mm: for some finite \(a\)aa, \(\varphi(x)\ge\varphi(m)+a(x-m)\)φ(x)≥φ(m)+a(x−m)\varphi(x)\ge\varphi(m)+a(x-m) for all \(x\)xx. Indeed, every left secant slope at \(m\)mm is at most every right secant slope, so choose \(a\)aa between their supremum and infimum. These bounds are finite by comparison with secants through \(m-1\)m−1m-1 and \(m+1\)m+1m+1.

  • Take expectations. The affine lower bound is integrable, so the negative part of \(\varphi(X)\)φ(X)\varphi(X) has finite expectation. Taking expectations proves the inequality even if the positive part has infinite expectation.

  • Equality. For strict convexity, the supporting line touches the graph only at \(m\)mm; a second contact would force equality along the joining segment, contrary to strict convexity. Therefore the nonnegative gap \(\varphi(X)-\varphi(m)-a(X-m)\)φ(X)−φ(m)−a(X−m)\varphi(X)-\varphi(m)-a(X-m) vanishes almost surely precisely when \(X=m\)X=mX=m almost surely. A nonnegative random variable has expectation zero only if it vanishes almost surely. Writing \(V\)VV for the gap above, apply positivity to \(\E V\ge k^{-1}P(V\ge k^{-1})\)𝔼V≥k−1P(V≥k−1)\mathbb{E}V\ge k^{-1}P(V\ge k^{-1}) for every positive integer \(k\)kk and take the countable union. This proves the equality assertion; the converse is immediate.

 ◻

Jensen: two orders of averaging

The geometric question · Read the explanation

-2-10121234Endpoint x; use the matching slider or number field to move it.Endpoint y; use the matching slider or number field to move it.f(z) = z²zAB
A · average, then evaluate
0
B · evaluate, then average
1
Gap B − A
1

Averaged input: (1 − s)x + sy = 0. Circle A lies on the curve; diamond B lies on the dashed chord.

-2-10121234Endpoint x; use the matching slider or number field to move it.Endpoint y; use the matching slider or number field to move it.f(z) = z²zAB

A · average, then evaluate
0
B · evaluate, then average
1
Gap B − A
1

Averaged input: (1 − s)x + sy = 0. Circle A lies on the curve; diamond B lies on the dashed chord.

The geometric question is whether averaging before applying a convex function can give a larger value than applying it first and then averaging. For \(P(X=-1)=P(X=1)=1/2\)P(X=−1)=P(X=1)=1/2P(X=-1)=P(X=1)=1/2 and \(\varphi(x)=x^2\)φ(x)=x2\varphi(x)=x^2, \[\varphi(\E X)=0,\qquad \E\varphi(X)=1.\]φ(𝔼X)=0,𝔼φ(X)=1.\varphi(\mathbb{E}X)=0,\qquad \mathbb{E}\varphi(X)=1. More generally, for \(P(X=x)=1-s\)P(X=x)=1−sP(X=x)=1-s and \(P(X=y)=s\)P(X=y)=sP(X=y)=s, \[(1-s)x^2+sy^2-\big((1-s)x+sy\big)^2=s(1-s)(x-y)^2\ge0.\](1−s)x2+sy2−((1−s)x+sy)2=s(1−s)(x−y)2≥0.(1-s)x^2+sy^2-\big((1-s)x+sy\big)^2=s(1-s)(x-y)^2\ge0. The graph lies below the chord: the gap is zero for a degenerate mixture (\(s=0\)s=0s=0 or \(1\)11) or identical endpoints, and positive otherwise. This calculation illustrates Jensen for a two-point law; the theorem above covers arbitrary integrable random variables.

High priorityMarkov’s inequality
Theorem 3Markov

For a nonnegative random variable \(X\)XX and \(a>0\)a>0a>0, \[P(X\ge a)\le\frac{\E X}{a}.\]P(X≥a)≤𝔼Xa.P(X\ge a)\le\frac{\mathbb{E}X}{a}. The bound is useful when \(\E X<\infty\)𝔼X<∞\mathbb{E}X<\infty; with \(\E X=\infty\)𝔼X=∞\mathbb{E}X=\infty it remains valid but gives no information.

Proof. Pointwise, \(a\mathbf1_{\{X\ge a\}}\le X\mathbf1_{\{X\ge a\}}\le X\)a1{X≥a}≤X1{X≥a}≤Xa\mathbf1_{\{X\ge a\}}\le X\mathbf1_{\{X\ge a\}}\le X. Take expectations and divide by the positive number \(a\)aa. ◻

Markov: a rectangle inside the expectation

Y = X², with X uniform on [0, 4]. Move the threshold a. Picture question · Area proof

S(t) = P(Y > t) 00.510481216t width a = 4
Whole area · E Y
16/3 ≈ 5.3333
Rectangle · a × P(Y > a)
4 × 0.5 = 2 ≤ 16/3
Divide by a · Markov’s bound
0.5 ≤ 16/(3a) ≈ 1.3333

Static view: a = 4.

S(t) = P(Y > t) 00.510481216t width a = 4

The rectangle’s width is a; its height is P(Y > a).

Whole area · E Y
16/3 ≈ 5.3333
Rectangle · a × P(Y > a)
4 × 0.5 = 2 ≤ 16/3
Divide by a · Markov’s bound
0.5 ≤ 16/(3a) ≈ 1.3333
Why the rectangle proves Markov’s inequality

A picture proof: fit a rectangle under the tail.

For \(Y\ge0\)Y≥0Y\ge0, the tail identity says that \(\E Y\)𝔼Y\mathbb{E}Y is the area under the nonincreasing curve \(S(t)=P(Y>t)\)S(t)=P(Y>t)S(t)=P(Y>t): \[\E Y=\int_0^\infty S(t)\,dt.\]𝔼Y=∫0∞S(t)dt.\mathbb{E}Y=\int_0^\infty S(t)\,dt. Choose a threshold \(a>0\)a>0a>0. Draw the rectangle with opposite corners \((0,0)\)(0,0)(0,0) and \((a,S(a))\)(a,S(a))(a,S(a)). As \(a\)aa changes, why does this rectangle always stay below the curve?

For the picture, take \(Y=X^2\)Y=X2Y=X^2 with \(X\sim\operatorname{Unif}([0,4])\)X∼Unif([0,4])X\sim\operatorname{Unif}([0,4]). For \(0\le t\le16\)0≤t≤160\le t\le16, \[S(t)=P(X^2>t)=P(X>\sqrt t)=1-\frac{\sqrt t}{4},\]S(t)=P(X2>t)=P(X>t)=1−t4,S(t)=P(X^2>t)=P(X>\sqrt t)=1-\frac{\sqrt t}{4}, and \(S(t)=0\)S(t)=0S(t)=0 for \(t>16\)t>16t>16. The whole shaded area is \[\E Y=\E X^2=\frac14\int_0^4 x^2\,dx=\frac{16}{3}.\]𝔼Y=𝔼X2=14∫04x2dx=163.\mathbb{E}Y=\mathbb{E}X^2=\frac14\int_0^4 x^2\,dx=\frac{16}{3}. At \(a=4\)a=4a=4, the rectangle has width \(4\)44, height \(P(Y>4)=1/2\)P(Y>4)=1/2P(Y>4)=1/2, and area \(2\le16/3\)2≤16/32\le16/3.

The geometric reason works for every nonnegative \(Y\)YY: for \(0\le t<a\)0≤t<a0\le t<a, \(S(t)\ge S(a)\)S(t)≥S(a)S(t)\ge S(a). Comparing areas gives \[\underbrace{\E Y}_{\text{whole area}} =\int_0^\infty S(t)\,dt \ge\int_0^a S(t)\,dt \ge\underbrace{aP(Y>a)}_{\text{rectangle area}}.\]𝔼Y⏟whole area=∫0∞S(t)dt≥∫0aS(t)dt≥aP(Y>a)⏟rectangle area.\underbrace{\mathbb{E}Y}_{\text{whole area}} =\int_0^\infty S(t)\,dt \ge\int_0^a S(t)\,dt \ge\underbrace{aP(Y>a)}_{\text{rectangle area}}. Dividing by \(a\)aa yields \(P(Y>a)\le\E Y/a\)P(Y>a)≤𝔼Y/aP(Y>a)\le\mathbb{E}Y/a. For the theorem’s \(P(Y\ge a)\)P(Y≥a)P(Y\ge a) version, use \(\{Y\ge a\}\subseteq\{Y>t\}\){Y≥a}⊆{Y>t}\{Y\ge a\}\subseteq\{Y>t\} for every \(t<a\)t<at<a: the rectangle of height \(P(Y\ge a)\)P(Y≥a)P(Y\ge a) also fits under the curve on \([0,a)\)[0,a)[0,a), so \(\E Y\ge aP(Y\ge a)\)𝔼Y≥aP(Y≥a)\mathbb{E}Y\ge aP(Y\ge a). A single endpoint does not change its area.

Applying Markov to the nonnegative variable \((X-\E X)^2\)(X−𝔼X)2(X-\mathbb{E}X)^2 gives Chebyshev’s inequality, for \(X\in L^2(P)\)X∈L2(P)X\in L^2(P) and \(t>0\)t>0t>0: \[P(|X-\E X|\ge t)\le\frac{\var(X)}{t^2}.\]P(|X−𝔼X|≥t)≤Var(X)t2.P(|X-\mathbb{E}X|\ge t)\le\frac{\operatorname{Var}(X)}{t^2}. This is a probability bound from a moment, whereas the tail identity recovers a moment from all tail probabilities. A bound greater than one can always be replaced by one; it is valid but uninformative.

Used again in weak laws, Chernoff bounds.

Almost sure convergence and expectations

High priorityKeep the exceptional set and the envelope explicit

We say \(X_n\to X\)Xn→XX_n\to X almost surely (a.s.) if there is a measurable \(N\)NN with \(P(N)=0\)P(N)=0P(N)=0 such that \(X_n(\omega)\to X(\omega)\)Xn(ω)→X(ω)X_n(\omega)\to X(\omega) for every \(\omega\notin N\)ω∉N\omega\notin N. This is pointwise convergence outside a single null set, not necessarily convergence at every outcome. We write \(X_n\to X\)Xn→XX_n\to X a.s., rather than suppressing the mode of convergence.

Instructor’s NoteFollow one outcome at a time

Think of each outcome \(\omega\)ω\omega as choosing a path \(X_1(\omega),X_2(\omega),\ldots\)X1(ω),X2(ω),…X_1(\omega),X_2(\omega),\ldots. Almost sure convergence says that the path settles toward \(X(\omega)\)X(ω)X(\omega) for almost every choice. We can set the values on the exceptional null set to zero and picture convergence along every path. To understand convergence of averages, also picture the integrable envelope \(Y\)YY in the DCT below: it keeps the paths from making ever taller spikes in ever smaller regions, as in Lecture 3.

Quick Recall
Integrability

  • Assumptions. For the dominated convergence theorem, suppose \(X_n\to X\)Xn→XX_n\to X a.s. and \(|X_n|\le Y\)|Xn|≤Y|X_n|\le Y a.s. for every \(n\)nn, with \(Y\ge0\)Y≥0Y\ge0 and \(\E Y<\infty\)𝔼Y<∞\mathbb{E}Y<\infty. Recall the definition of integrability.

  • Common exceptional set. Outside the countable union of the exceptional sets, \(|X|\le Y\)|X|≤Y|X|\le Y and \(|X_n-X|\le2Y\)|Xn−X|≤2Y|X_n-X|\le2Y.

  • Conclusions. The DCT from Lecture 3 therefore gives \[\E|X_n-X|\longrightarrow0,\qquad |\E X_n-\E X|\le\E|X_n-X|\longrightarrow0.\]𝔼|Xn−X|→0,|𝔼Xn−𝔼X|≤𝔼|Xn−X|→0.\mathbb{E}|X_n-X|\longrightarrow0,\qquad |\mathbb{E}X_n-\mathbb{E}X|\le\mathbb{E}|X_n-X|\longrightarrow0. The first assertion is convergence in the \(L^1\)L1L^1 norm defined above.

3. Useful examples

The moment method for random graphs

Low priority — not examined: Count structures with indicators

  • Model. In the Erdős–Rényi random graph \(G\sim\mathcal G(n,p_n)\)G∼𝒢(n,pn)G\sim\mathcal G(n,p_n), the vertex set is \(\{1,\ldots,n\}\){1,…,n}\{1,\ldots,n\} and the indicators \(A_{ij}\)AijA_{ij} for \(1\le i<j\le n\)1≤i<j≤n1\le i<j\le n are independent Bernoulli variables with success probability \(p_n\)pnp_n. Set \(A_{ji}=A_{ij}\)Aji=AijA_{ji}=A_{ij} and \(A_{ii}=0\)Aii=0A_{ii}=0: opposite orientations of one undirected edge are the same variable, not independent copies.

  • Count with indicators. Let \(B_{ijk}\)BijkB_{ijk} be the event that vertices \(i<j<k\)i<j<ki<j<k form a triangle. Then \[N=\sum_{i<j<k}\mathbf1_{B_{ijk}},\qquad \E N=\sum_{i<j<k}P(B_{ijk})=\binom n3 p_n^3.\]N=∑i<j<k1Bijk,𝔼N=∑i<j<kP(Bijk)=(n3)pn3.N=\sum_{i<j<k}\mathbf1_{B_{ijk}},\qquad \mathbb{E}N=\sum_{i<j<k}P(B_{ijk})=\binom n3 p_n^3.

  • Expectation. Linearity needs no independence among the triangle indicators. Independence of the three distinct edges gives \(P(B_{ijk})=p_n^3\)P(Bijk)=pn3P(B_{ijk})=p_n^3.

  • First moment. Markov yields \[P(N\ge1)\le\min\{1,\E N\}.\]P(N≥1)≤min{1,𝔼N}.P(N\ge1)\le\min\{1,\mathbb{E}N\}.

  • Sparse regime. For \(p_n=n^{-\alpha}\)pn=n−αp_n=n^{-\alpha} with fixed \(\alpha>0\)α>0\alpha>0, \(\E N=(1+o(1))n^{3-3\alpha}/6\)𝔼N=(1+o(1))n3−3α/6\mathbb{E}N=(1+o(1))n^{3-3\alpha}/6. Hence for \(\alpha>1\)α>1\alpha>1 the probability of no triangle tends to one.

  • Second moment. A diverging expected count when \(\alpha<1\)α<1\alpha<1 does not by itself show that a triangle is likely: variability must also be controlled. A second-moment calculation in Exercise 8 and its solution supplies the missing argument and gives \[P(N=0)=\begin{cases}1-o(1),&\alpha>1,\\o(1),&0<\alpha<1. \end{cases}\]P(N=0)={1−o(1),α>1,o(1),0<α<1.P(N=0)=\begin{cases}1-o(1),&\alpha>1,\\o(1),&0<\alpha<1. \end{cases}

  • Boundary. The boundary \(\alpha=1\)α=1\alpha=1 has \(\E N\to1/6\)𝔼N→1/6\mathbb{E}N\to1/6; these two off-boundary arguments do not determine its limiting probability of no triangle.

KL divergence, entropy, and cross-entropy

Mid priorityCompare probability laws through a density ratio

  • Measures and derivative. Let \(P,Q\)P,QP,Q be probability measures on \((\R^d,\gB^d)\)(ℝd,ℬd)(\mathbb{R}^d,\mathcal{B}^d) with \(P\ll Q\)P≪QP\ll Q and let \(r=dP/dQ\)r=dP/dQr=dP/dQ be their Radon–Nikodym derivative. Recall that this means \(P(B)=\int_B r\,dQ\)P(B)=∫BrdQP(B)=\int_B r\,dQ, with \(r\ge0\)r≥0r\ge0 and \(\int r\,dQ=1\)∫rdQ=1\int r\,dQ=1.

  • Definition and conventions. The Kullback–Leibler (KL) divergence is \[D_{\mathrm{KL}}(P\|Q)=\int\log r\,dP=\int r\log r\,dQ,\]DKL(P∥Q)=∫logrdP=∫rlogrdQ,D_{\mathrm{KL}}(P\|Q)=\int\log r\,dP=\int r\log r\,dQ, where \(0\log0=0\)0log0=00\log0=0. The value of \(\log r\)logr\log r on \(\{r=0\}\){r=0}\{r=0\} is irrelevant under \(P\)PP. This integral is well defined, possibly \(+\infty\)+∞+\infty, because \((r\log r)^-\le1/e\)(rlogr)−≤1/e(r\log r)^-\le1/e and \(Q\)QQ is a probability measure. If \(P\not\ll Q\)P≪̸QP\not\ll Q, we set \(D_{\mathrm{KL}}(P\|Q)=+\infty\)DKL(P∥Q)=+∞D_{\mathrm{KL}}(P\|Q)=+\infty.

  • Density formula. For Lebesgue densities \(f,g\)f,gf,g it becomes \[D_{\mathrm{KL}}(P\|Q)=\int f(x)\log\frac{f(x)}{g(x)}\,dx,\]DKL(P∥Q)=∫f(x)logf(x)g(x)dx,D_{\mathrm{KL}}(P\|Q)=\int f(x)\log\frac{f(x)}{g(x)}\,dx, with a zero contribution where \(f=0\)f=0f=0 and an infinite contribution if \(g=0\)g=0g=0 on a set of positive \(P\)PP-probability.

  • Supporting-line gap. The convex-function idea in Jensen’s inequality applies to \(h(u)=u\log u\)h(u)=uloguh(u)=u\log u, extended by \(h(0)=0\)h(0)=0h(0)=0 on \([0,\infty)\)[0,∞)[0,\infty). To avoid a hidden domain or finite-integral assumption, use its explicit supporting-line gap: \[u\log u-u+1\ge0\quad(u\ge0),\qquad u\log u-u+1=0\ \Longleftrightarrow\ u=1.\]ulogu−u+1≥0(u≥0),ulogu−u+1=0⇔u=1.u\log u-u+1\ge0\quad(u\ge0),\qquad u\log u-u+1=0\ \Longleftrightarrow\ u=1.

  • Integrate the gap. For \(u>0\)u>0u>0 its derivative is \(\log u\)logu\log u and its second derivative is \(1/u\)1/u1/u; at \(u=0\)u=0u=0 the gap is one. Consequently, \[D_{\mathrm{KL}}(P\|Q)=\int(r\log r-r+1)\,dQ\ge0.\]DKL(P∥Q)=∫(rlogr−r+1)dQ≥0.D_{\mathrm{KL}}(P\|Q)=\int(r\log r-r+1)\,dQ\ge0.

  • Equality. Equality holds exactly when \(r=1\)r=1r=1 \(Q\)QQ-a.e., which is equivalent to \(P=Q\)P=QP=Q as measures. “\(P=Q\)P=QP=Q almost surely” is not the appropriate statement. KL is generally asymmetric, so it is not a metric, although it is a useful measure of discrepancy.

If \(P\)PP has pmf \(p_1,\ldots,p_K\)p1,…,pKp_1,\ldots,p_K and \(Q\)QQ is uniform on \(\{1,\ldots,K\}\){1,…,K}\{1,\ldots,K\}, \[D_{\mathrm{KL}}(P\|Q)=\sum_{k:p_k>0}p_k\log(Kp_k) =\log K-H(P),\qquad H(P)=-\sum_{k=1}^K p_k\log p_k.\]DKL(P∥Q)=∑k:pk>0pklog(Kpk)=logK−H(P),H(P)=−∑k=1Kpklogpk.D_{\mathrm{KL}}(P\|Q)=\sum_{k:p_k>0}p_k\log(Kp_k) =\log K-H(P),\qquad H(P)=-\sum_{k=1}^K p_k\log p_k. Here \(H(P)\)H(P)H(P) is the entropy. In particular, \(H(P)\le\log K\)H(P)≤logKH(P)\le\log K, with equality exactly for the uniform law. For a Bernoulli law with parameter \(\gamma\)γ\gamma, the Lecture 1 formula is \[H(P)=-\gamma\log\gamma-(1-\gamma)\log(1-\gamma),\]H(P)=−γlogγ−(1−γ)log(1−γ),H(P)=-\gamma\log\gamma-(1-\gamma)\log(1-\gamma), including the endpoints by \(0\log0=0\)0log0=00\log0=0. All logarithms here are natural.

  • Loss identity. For target probabilities \(p_k\)pkp_k and predicted probabilities \(q_k\)qkq_k over \(K\)KK classes, the cross-entropy loss is \[H(p,q)=\E_{Y\sim p}[-\log q_Y] =-\sum_{k:p_k>0}p_k\log q_k=H(p)+D_{\mathrm{KL}}(p\|q).\]H(p,q)=𝔼Y∼p[−logqY]=−∑k:pk>0pklogqk=H(p)+DKL(p∥q).H(p,q)=\mathbb{E}_{Y\sim p}[-\log q_Y] =-\sum_{k:p_k>0}p_k\log q_k=H(p)+D_{\mathrm{KL}}(p\|q).

  • Zero probabilities and minimization. If \(q_k=0\)qk=0q_k=0 while \(p_k>0\)pk>0p_k>0, both the loss and divergence are infinite. Since \(H(p)\)H(p)H(p) is fixed during prediction, minimizing cross-entropy is the same as minimizing this KL divergence.

  • Softmax. Real-valued scores \(z_1,\ldots,z_K\)z1,…,zKz_1,\ldots,z_K, often called logits, produce positive predicted probabilities through the softmax function \[q_k=\frac{e^{z_k}}{\sum_{j=1}^K e^{z_j}},\qquad k=1,\ldots,K.\]qk=ezk∑j=1Kezj,k=1,…,K.q_k=\frac{e^{z_k}}{\sum_{j=1}^K e^{z_j}},\qquad k=1,\ldots,K.

Collinearity and covariance geometry

Low priority — not examined: Center before interpreting a zero-variance direction

  • Relations among features. In regression, regard \(X=(X_1,\ldots,X_p)^\top\)X=(X1,…,Xp)⊤X=(X_1,\ldots,X_p)^\top as a random feature vector and observations as its realized values. A nontrivial deterministic relation \(a^\top X=0\)a⊤X=0a^\top X=0 a.s. puts its law on a linear subspace. More generally, \(a^\top X=c\)a⊤X=ca^\top X=c a.s. puts the law on an affine hyperplane. Duplicate features can cause the first relation; a full set of category indicators sums to one and gives the second.

  • Centering and covariance. Let \(m=\E X\)m=𝔼Xm=\mathbb{E}X and \(\Sigma=\E[(X-m)(X-m)^\top]\)Σ=𝔼[(X−m)(X−m)⊤]\Sigma=\mathbb{E}[(X-m)(X-m)^\top], assuming finite second moments. If \(\mathrm{rank}(\Sigma)=r<p\)rank(Σ)=r<p\mathrm{rank}(\Sigma)=r<p, write \(\Sigma=U\Lambda U^\top\)Σ=UΛU⊤\Sigma=U\Lambda U^\top, where \(U\)UU is \(p\times r\)p×rp\times r, \(U^\top U=I_r\)U⊤U=IrU^\top U=I_r, and \(\Lambda\)Λ\Lambda contains the positive eigenvalues. For \(U^\top u=0\)U⊤u=0U^\top u=0, \[\var(u^\top X)=u^\top\Sigma u=0, \qquad u^\top(X-m)=0\quad\hbox{a.s.}\]Var(u⊤X)=u⊤Σu=0,u⊤(X−m)=0a.s.\operatorname{Var}(u^\top X)=u^\top\Sigma u=0, \qquad u^\top(X-m)=0\quad\text{a.s.}

  • Reconstruction. Using a finite orthonormal basis of the orthogonal complement shows \[X=m+U\widetilde X\quad\hbox{a.s.},\qquad \widetilde X=U^\top(X-m).\]X=m+UX̃a.s.,X̃=U⊤(X−m).X=m+U\widetilde X\quad\text{a.s.},\qquad \widetilde X=U^\top(X-m). Thus the law is concentrated on \(m+\mathrm{range}(U)\)m+range(U)m+\mathrm{range}(U), an affine subspace. The complete argument and a translated-line example are in Exercise 9 and its solution. Centering locates the subspace; \(U^\top X\)U⊤XU^\top X alone omits the reconstruction’s mean term.

  • Data and formula. For observations \(X^{(1)},\ldots,X^{(n)}\in\R^p\)X(1),…,X(n)∈ℝpX^{(1)},\ldots,X^{(n)}\in\mathbb{R}^p, let \(\bar X=n^{-1}\sum_i X^{(i)}\)X‾=n−1∑iX(i)\bar X=n^{-1}\sum_i X^{(i)} and let \(\mathsf X_c\)𝖷c\mathsf X_c be the \(n\times p\)n×pn\times p matrix with rows \((X^{(i)}-\bar X)^\top\)(X(i)−X‾)⊤(X^{(i)}-\bar X)^\top. The course’s empirical covariance convention is

    \[\widehat\Sigma=\frac1n\sum_{i=1}^n (X^{(i)}-\bar X)(X^{(i)}-\bar X)^\top =\frac{\mathsf X_c^\top\mathsf X_c}{n}.\]Σ̂=1n∑i=1n(X(i)−X‾)(X(i)−X‾)⊤=𝖷c⊤𝖷cn.\widehat\Sigma=\frac1n\sum_{i=1}^n (X^{(i)}-\bar X)(X^{(i)}-\bar X)^\top =\frac{\mathsf X_c^\top\mathsf X_c}{n}.

    (5)
  • Normalization and centering. The factor \(1/(n-1)\)1/(n−1)1/(n-1) is another convention, but is not used here. If the population mean is known to be zero and centering is not performed, \(n^{-1}\sum_i X^{(i)}(X^{(i)})^\top\)n−1∑iX(i)(X(i))⊤n^{-1}\sum_i X^{(i)}(X^{(i)})^\top estimates the second moment, which then equals the population covariance. Otherwise it estimates a different matrix.

  • Interpretation. PCA finds directions of greatest empirical variance. Since \(\mathrm{rank}(\widehat\Sigma)\le\min(p,n-1)\)rank(Σ̂)≤min(p,n−1)\mathrm{rank}(\widehat\Sigma)\le\min(p,n-1), sample rank deficiency alone does not establish population collinearity. A small-variance direction also need not be irrelevant for predicting a response.

4. Further reading

Further reading: Measure decomposition and complete function spaces

  • Meaning. For two measures, mutual singularity \(\nu\perp\eta\)ν⊥η\nu\perp\eta means that some measurable set \(S\)SS satisfies \(\nu(S^c)=0\)ν(Sc)=0\nu(S^c)=0 and \(\eta(S)=0\)η(S)=0\eta(S)=0. These are disjoint sets of concentration, not necessarily disjoint topological supports. A set of concentration need not be unique or be the largest set on which the measure is positive.

  • Remove atoms. Here is the construction behind (3). For each integer \(k\ge1\)k≥1k\ge1, there are at most \(k\)kk atoms of mass at least \(1/k\)1/k1/k; hence their union \(D\)DD is countable. Remove the atomic measure to form the nonnegative atomless measure \(\nu=\mu-\mu_{\mathrm{dis}}\)ν=μ−μdis\nu=\mu-\mu_{\mathrm{dis}}.

  • Decompose the remainder. Apply the Lebesgue decomposition theorem to \(\nu\)ν\nu relative to Lebesgue measure \(\lambda\)λ\lambda: \(\nu=\mu_{\mathrm{cont}}+\mu_{\mathrm{sing}}\)ν=μcont+μsing\nu=\mu_{\mathrm{cont}}+\mu_{\mathrm{sing}}, where \(\mu_{\mathrm{cont}}\ll\lambda\)μcont≪λ\mu_{\mathrm{cont}}\ll\lambda and \(\mu_{\mathrm{sing}}\perp\lambda\)μsing⊥λ\mu_{\mathrm{sing}}\perp\lambda. Both components are atomless because each is bounded by \(\nu\)ν\nu.

  • Concentration sets and proof. If \(S\)SS is a Lebesgue-null set carrying \(\mu_{\mathrm{sing}}\)μsing\mu_{\mathrm{sing}}, remove \(D\)DD from it without changing its \(\mu_{\mathrm{sing}}\)μsing\mu_{\mathrm{sing}} mass. Then \[\mu(A)=(\mu_{\mathrm{dis}}+\mu_{\mathrm{cont}})(A\cap S^c) +\mu_{\mathrm{sing}}(A\cap S).\]μ(A)=(μdis+μcont)(A∩Sc)+μsing(A∩S).\mu(A)=(\mu_{\mathrm{dis}}+\mu_{\mathrm{cont}})(A\cap S^c) +\mu_{\mathrm{sing}}(A\cap S). This shows how mutual exclusivity produces negative covariance precisely. The atoms are determined by \(\mu\)μ\mu, and uniqueness of the two-part Lebesgue decomposition gives uniqueness of all three parts. A proof of the theorem used here is in John Hunter’s Measure Theory, Theorem 6.27; see also Chapter 6 of [2]. The existence of the singular continuous component does not follow merely from the phrase “singular relative to the other two parts”; its atomless property is essential.

Quick Explanation
Banach space

On almost-sure equivalence classes, \(L^p(P)\)Lp(P)L^p(P) is a complete normed space, also called a Banach space,3 for \(1\le p\le\infty\)1≤p≤∞1\le p\le\infty. The completeness proof is in Hunter’s Theorem 7.10. Convergence in its norm is written \[X_n\stackrel{L^p}{\longrightarrow}X \quad\Longleftrightarrow\quad\|X_n-X\|_p\longrightarrow0.\]Xn→LpX⇔∥Xn−X∥p→0.X_n\stackrel{L^p}{\longrightarrow}X \quad\Longleftrightarrow\quad\|X_n-X\|_p\longrightarrow0. This is a different definition from almost sure convergence. Section 1.5.1 of [3] develops modes of convergence further. For KL divergence, entropy, and cross-entropy, Chapter 2 of [1] gives an information-theoretic perspective.

Key ideas

  • Expectation can be computed on the original sample space or through the law of a random variable.

  • Tail probabilities encode the expectation of a nonnegative variable.

  • Jensen, Hölder, Markov and Chebyshev turn structural assumptions into useful inequalities.

  • Limit exchanges and information inequalities depend on their stated integrability conditions.

Looking ahead

Lecture 5 asks how averaging changes after we observe additional information. Expectation and the squared-error inequalities here lead to conditional means and optimal prediction. Continue to Lecture 5.

5. Exercises and complete solutions9 exercises · complete solutions
High priorityPractice using a law

Exercise 1Change of variables through the law#

For a real random variable \(X\)XX with law \(\mu_X\)μX\mu_X, prove \(\E g(X)=\int g\,d\mu_X\)𝔼g(X)=∫gdμX\mathbb{E}g(X)=\int g\,d\mu_X first for a nonnegative simple Borel function \(g=\sum_{j=1}^m c_j\mathbf1_{B_j}\)g=∑j=1mcj1Bjg=\sum_{j=1}^m c_j\mathbf1_{B_j} with disjoint \(B_j\)BjB_j. Extend the identity to nonnegative Borel functions and then to integrable signed functions.

Reveal solution

For an indicator, \(\E\mathbf1_B(X)=P(X\in B)=\mu_X(B)\)𝔼1B(X)=P(X∈B)=μX(B)\mathbb{E}\mathbf1_B(X)=P(X\in B)=\mu_X(B). Finite additivity of the integral now gives \[\E g(X)=\sum_j c_j P(X\in B_j)=\sum_j c_j\mu_X(B_j)=\int g\,d\mu_X.\]𝔼g(X)=∑jcjP(X∈Bj)=∑jcjμX(Bj)=∫gdμX.\mathbb{E}g(X)=\sum_j c_j P(X\in B_j)=\sum_j c_j\mu_X(B_j)=\int g\,d\mu_X. For a general nonnegative Borel \(g\)gg, take simple \(g_n\uparrow g\)gn↑gg_n\uparrow g. Then \(g_n(X)\uparrow g(X)\)gn(X)↑g(X)g_n(X)\uparrow g(X), so applying MCT once under \(P\)PP and once under \(\mu_X\)μX\mu_X gives \[\E g(X)=\lim_n\E g_n(X)=\lim_n\int g_n\,d\mu_X=\int g\,d\mu_X.\]𝔼g(X)=limn𝔼gn(X)=limn∫gndμX=∫gdμX.\mathbb{E}g(X)=\lim_n\mathbb{E}g_n(X)=\lim_n\int g_n\,d\mu_X=\int g\,d\mu_X. This includes infinite values. Apply this identity to \(|g|\)|g||g| to see that integrability on the two spaces is equivalent. Finally apply it separately to \(g^+\)g+g^+ and \(g^-\)g−g^- and subtract when both integrals are finite (or when at least one is finite for an extended expectation). The proof never uses injectivity or a density.

High priorityPractice choosing an interchange theorem
Exercise 2Tail integrals, including infinite expectations#

Prove the main-text identity \(\E|X|=\int_0^\infty P(|X|>t)\,dt\)𝔼|X|=∫0∞P(|X|>t)dt\mathbb{E}|X|=\int_0^\infty P(|X|>t)\,dt without assuming finiteness. Derive (4) under its stated assumptions. As a numerical illustration, calculate both sides for a variable \(Y\)YY equally likely to be 1 or 3.

Reveal solution
Expectation as area under the survival curve Explanation
For Y equally likely 1 or 3, P(Y>t) is 1 on [0,1), 1/2 on [1,3), and zero thereafter. The rectangle areas are 1 and 1.

For each fixed \(y\ge0\)y≥0y\ge0, \(y=\int_0^\infty\mathbf1_{\{t<y\}}\,dt\)y=∫0∞1{t<y}dty=\int_0^\infty\mathbf1_{\{t<y\}}\,dt. The function \((\omega,t)\mapsto\mathbf1_{\{t<|X(\omega)|\}}\)(ω,t)↦1{t<|X(ω)|}(\omega,t)\mapsto\mathbf1_{\{t<|X(\omega)|\}} is measurable and nonnegative. Tonelli on \(P\otimes dt\)P⊗dtP\otimes dt therefore gives \[\E|X|=\int_\Omega\int_0^\infty\mathbf1_{\{t<|X(\omega)|\}}\,dt\,dP =\int_0^\infty P(|X|>t)\,dt.\]𝔼|X|=∫Ω∫0∞1{t<|X(ω)|}dtdP=∫0∞P(|X|>t)dt.\mathbb{E}|X|=\int_\Omega\int_0^\infty\mathbf1_{\{t<|X(\omega)|\}}\,dt\,dP =\int_0^\infty P(|X|>t)\,dt. For the extension, the fundamental theorem of calculus gives \(f(y)=\int_0^y f'(t)\,dt\)f(y)=∫0yf′(t)dtf(y)=\int_0^y f'(t)\,dt. Since \(f'\ge0\)f′≥0f'\ge0, another application of Tonelli to \(f'(t)\mathbf1_{\{t<|X(\omega)|\}}\)f′(t)1{t<|X(ω)|}f'(t)\mathbf1_{\{t<|X(\omega)|\}} yields (4). Neither argument needs an a priori finite expectation. The value of the indicator at \(t=y\)t=yt=y does not affect the Lebesgue integral in \(t\)tt. For the two-point example, \(\E Y=(1+3)/2=2\)𝔼Y=(1+3)/2=2\mathbb{E}Y=(1+3)/2=2, while \[P(Y>t)=\begin{cases}1,&0\le t<1,\\1/2,&1\le t<3,\\0,&t\ge3. \end{cases} \qquad \int_0^\infty P(Y>t)\,dt=1\cdot1+\tfrac12\cdot2=2.\]P(Y>t)={1,0≤t<1,1/2,1≤t<3,0,t≥3.∫0∞P(Y>t)dt=1⋅1+12⋅2=2.P(Y>t)=\begin{cases}1,&0\le t<1,\\1/2,&1\le t<3,\\0,&t\ge3. \end{cases} \qquad \int_0^\infty P(Y>t)\,dt=1\cdot1+\tfrac12\cdot2=2. The rectangle picture is an illustration; Tonelli proves the identity for arbitrary distributions.

High priorityPractice with moment orders
Exercise 3Higher moments imply lower moments#

Suppose \(1\le p<q<\infty\)1≤p<q<∞1\le p<q<\infty and \(X\in L^q(P)\)X∈Lq(P)X\in L^q(P). Prove \(\|X\|_p\le\|X\|_q\)∥X∥p≤∥X∥q\|X\|_p\le\|X\|_q. State the analogous conclusion for \(q=\infty\)q=∞q=\infty.

Reveal solution

Apply Hölder to \(|X|^p\cdot1\)|X|p⋅1|X|^p\cdot1 with conjugate exponents \(q/p\)q/pq/p and \(q/(q-p)\)q/(q−p)q/(q-p). Its first factor is integrable to the required power because \((|X|^p)^{q/p}=|X|^q\)(|X|p)q/p=|X|q(|X|^p)^{q/p}=|X|^q. Since \(P(\Omega)=1\)P(Ω)=1P(\Omega)=1, \[\E|X|^p\le(\E|X|^q)^{p/q} (\E1^{q/(q-p)})^{(q-p)/q}=(\E|X|^q)^{p/q}.\]𝔼|X|p≤(𝔼|X|q)p/q(𝔼1q/(q−p))(q−p)/q=(𝔼|X|q)p/q.\mathbb{E}|X|^p\le(\mathbb{E}|X|^q)^{p/q} (\mathbb{E}1^{q/(q-p)})^{(q-p)/q}=(\mathbb{E}|X|^q)^{p/q}. Taking the \(p\)ppth root gives the claimed bound and proves finiteness. If \(X\in L^\infty\)X∈L∞X\in L^\infty, for every \(\varepsilon>0\)ε>0\varepsilon>0 we have \(|X|\le\|X\|_\infty+\varepsilon\)|X|≤∥X∥∞+ε|X|\le\|X\|_\infty+\varepsilon a.s.; hence \(\|X\|_p\le\|X\|_\infty+\varepsilon\)∥X∥p≤∥X∥∞+ε\|X\|_p\le\|X\|_\infty+\varepsilon. Let \(\varepsilon\downarrow0\)ε↓0\varepsilon\downarrow0. The constant one in these comparisons uses the fact that the underlying measure has total mass one.

High priorityPractice with centered variables
Exercise 4Covariance bound and zero variance#

Let \(X,Y\in L^2(P)\)X,Y∈L2(P)X,Y\in L^2(P). Show that \(|\mathrm{Cov}(X,Y)|\le\sqrt{\var(X)\var(Y)}\)|Cov(X,Y)|≤Var(X)Var(Y)|\mathrm{Cov}(X,Y)|\le\sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)} and treat the case where one variance is zero.

Reveal solution

Set \(U=X-\E X\)U=X−𝔼XU=X-\mathbb{E}X and \(V=Y-\E Y\)V=Y−𝔼YV=Y-\mathbb{E}Y. These are in \(L^2\)L2L^2, and Cauchy–Schwarz gives \[|\mathrm{Cov}(X,Y)|=|\E UV|\le\E|UV| \le(\E U^2)^{1/2}(\E V^2)^{1/2} =\sqrt{\var(X)\var(Y)}.\]|Cov(X,Y)|=|𝔼UV|≤𝔼|UV|≤(𝔼U2)1/2(𝔼V2)1/2=Var(X)Var(Y).|\mathrm{Cov}(X,Y)|=|\mathbb{E}UV|\le\mathbb{E}|UV| \le(\mathbb{E}U^2)^{1/2}(\mathbb{E}V^2)^{1/2} =\sqrt{\operatorname{Var}(X)\operatorname{Var}(Y)}. If \(\var(X)=\E U^2=0\)Var(X)=𝔼U2=0\operatorname{Var}(X)=\mathbb{E}U^2=0, then \(U=0\)U=0U=0 a.s.: for each \(k\ge1\)k≥1k\ge1, \(P(|U|\ge1/k)\le k^2\E U^2=0\)P(|U|≥1/k)≤k2𝔼U2=0P(|U|\ge1/k)\le k^2\mathbb{E}U^2=0, and their union is \(\{|U|>0\}\){|U|>0}\{|U|>0\}. Thus \(\mathrm{Cov}(X,Y)=0\)Cov(X,Y)=0\mathrm{Cov}(X,Y)=0 for every such \(Y\)YY; the same applies when \(\var(Y)=0\)Var(Y)=0\operatorname{Var}(Y)=0. If both variances are positive, dividing by their standard deviations shows that the correlation is in \([-1,1]\)[−1,1][-1,1]. Correlation is not defined by that quotient when one variance is zero.

Mid priorityPractice interpreting a classification loss
Exercise 5Binary softmax gives logistic loss#

Use scores \(z_0=0,z_1=z\)z0=0,z1=zz_0=0,z_1=z for classes \(0,1\)0,10,1. Derive the softmax probability \(q_1\)q1q_1 and the cross-entropy for an observed class \(y\in\{0,1\}\)y∈{0,1}y\in\{0,1\}. Also give the formula for a target probability \(\gamma\in[0,1]\)γ∈[0,1]\gamma\in[0,1] of class 1.

Reveal solution

The two probabilities are \(q_1=e^z/(1+e^z)=1/(1+e^{-z})\)q1=ez/(1+ez)=1/(1+e−z)q_1=e^z/(1+e^z)=1/(1+e^{-z}) and \(q_0=1/(1+e^z)\)q0=1/(1+ez)q_0=1/(1+e^z). Hence \(\log q_1=z-\log(1+e^z)\)logq1=z−log(1+ez)\log q_1=z-\log(1+e^z) and \(\log q_0=-\log(1+e^z)\)logq0=−log(1+ez)\log q_0=-\log(1+e^z). Substituting into the loss gives \[-y\log q_1-(1-y)\log q_0=\log(1+e^z)-yz.\]−ylogq1−(1−y)logq0=log(1+ez)−yz.-y\log q_1-(1-y)\log q_0=\log(1+e^z)-yz. For \(\widetilde y=2y-1\in\{-1,1\}\)ỹ=2y−1∈{−1,1}\widetilde y=2y-1\in\{-1,1\} this equals \(\log(1+e^{-\widetilde y z})\)log(1+e−ỹz)\log(1+e^{-\widetilde y z}), the binary logistic loss. A target probability \(\gamma\)γ\gamma gives \(\log(1+e^z)-\gamma z\)log(1+ez)−γz\log(1+e^z)-\gamma z by replacing \(y\)yy with \(\gamma\)γ\gamma. More general scores yield the same probabilities after subtracting \(z_0\)z0z_0 from both scores, so only their difference matters.

Mid priorityDetails for the Gaussian examples
Exercise 6One square and a squared radius#

Find the density of \(Z^2\)Z2Z^2 for \(Z\sim N(0,1)\)Z∼N(0,1)Z\sim N(0,1). For independent standard normals \(Z_1,Z_2\)Z1,Z2Z_1,Z_2, prove that \(Z_1^2+Z_2^2\)Z12+Z22Z_1^2+Z_2^2 is exponential with rate \(1/2\)1/21/2.

Reveal solution

Writing \(\phi(z)=(2\pi)^{-1/2}e^{-z^2/2}\)ϕ(z)=(2π)−1/2e−z2/2\phi(z)=(2\pi)^{-1/2}e^{-z^2/2}, for \(t>0\)t>0t>0, \(P(Z^2\le t)=\int_{-\sqrt t}^{\sqrt t}\phi(z)\,dz\)P(Z2≤t)=∫−ttϕ(z)dzP(Z^2\le t)=\int_{-\sqrt t}^{\sqrt t}\phi(z)\,dz. Differentiating both endpoints gives \[f_{Z^2}(t)=\frac{\phi(\sqrt t)+\phi(-\sqrt t)}{2\sqrt t} =\frac{e^{-t/2}}{\sqrt{2\pi t}},\qquad t>0.\]fZ2(t)=ϕ(t)+ϕ(−t)2t=e−t/22πt,t>0.f_{Z^2}(t)=\frac{\phi(\sqrt t)+\phi(-\sqrt t)}{2\sqrt t} =\frac{e^{-t/2}}{\sqrt{2\pi t}},\qquad t>0. There is no atom at zero, since \(P(Z=0)=0\)P(Z=0)=0P(Z=0)=0; the density is zero for \(t<0\)t<0t<0. This is the \(\chi_1^2\)χ12\chi_1^2 density. For the two-dimensional radius, independence gives the joint density \((2\pi)^{-1}e^{-(z_1^2+z_2^2)/2}\)(2π)−1e−(z12+z22)/2(2\pi)^{-1}e^{-(z_1^2+z_2^2)/2}. For \(t\ge0\)t≥0t\ge0, polar coordinates, including their Jacobian \(r\)rr, give \[P(Z_1^2+Z_2^2>t) =\int_0^{2\pi}\int_{\sqrt t}^{\infty}\frac1{2\pi}e^{-r^2/2}r\,dr\,d\theta =e^{-t/2}.\]P(Z12+Z22>t)=∫02π∫t∞12πe−r2/2rdrdθ=e−t/2.P(Z_1^2+Z_2^2>t) =\int_0^{2\pi}\int_{\sqrt t}^{\infty}\frac1{2\pi}e^{-r^2/2}r\,dr\,d\theta =e^{-t/2}. Differentiating \(1-e^{-t/2}\)1−e−t/21-e^{-t/2} yields density \(\tfrac12e^{-t/2}\)12e−t/2\tfrac12e^{-t/2} on \((0,\infty)\)(0,∞)(0,\infty). Its mean, from the tail identity, is \(\int_0^\infty e^{-t/2}\,dt=2\)∫0∞e−t/2dt=2\int_0^\infty e^{-t/2}\,dt=2, consistent with \(\E Z_1^2+\E Z_2^2=2\)𝔼Z12+𝔼Z22=2\mathbb{E}Z_1^2+\mathbb{E}Z_2^2=2.

High priorityDetails for the norm and inequality assertions
Exercise 7Hölder and the \(L^p\)LpL^p norm#

Prove Hölder’s inequality and verify the norm properties of \(L^p(P)\)Lp(P)L^p(P), \(1\le p\le\infty\)1≤p≤∞1\le p\le\infty, after identifying variables equal almost surely.

Reveal solution

For \(1<p<\infty\)1<p<∞1<p<\infty and \(q=p/(p-1)\)q=p/(p−1)q=p/(p-1), Young’s scalar inequality is \(ab\le a^p/p+b^q/q\)ab≤ap/p+bq/qab\le a^p/p+b^q/q for \(a,b\ge0\)a,b≥0a,b\ge0. To see it, for fixed \(b\)bb minimize \(a^p/p-ab\)ap/p−aba^p/p-ab over \(a\ge0\)a≥0a\ge0; its minimum occurs at \(a=b^{1/(p-1)}\)a=b1/(p−1)a=b^{1/(p-1)} and equals \(-b^q/q\)−bq/q-b^q/q (including \(b=0\)b=0b=0). If \(\|X\|_p,\|Y\|_q\)∥X∥p,∥Y∥q\|X\|_p,\|Y\|_q are positive, apply Young to \(|X|/\|X\|_p\)|X|/∥X∥p|X|/\|X\|_p and \(|Y|/\|Y\|_q\)|Y|/∥Y∥q|Y|/\|Y\|_q and integrate. The right side is \(1/p+1/q=1\)1/p+1/q=11/p+1/q=1, which proves Hölder. If one norm is zero, that variable is zero a.s., so the result is immediate. For \(p=1,q=\infty\)p=1,q=∞p=1,q=\infty, the bound follows from \(|Y|\le\|Y\|_\infty+\varepsilon\)|Y|≤∥Y∥∞+ε|Y|\le\|Y\|_\infty+\varepsilon a.s. and then \(\varepsilon\downarrow0\)ε↓0\varepsilon\downarrow0; the other endpoint is symmetric.

Nonnegativity and homogeneity follow directly from the definitions. For finite \(p\)pp, norm zero implies \(X=0\)X=0X=0 a.s. because \(P(|X|\ge1/k)\le k^p\E|X|^p=0\)P(|X|≥1/k)≤kp𝔼|X|p=0P(|X|\ge1/k)\le k^p\mathbb{E}|X|^p=0 for all \(k\)kk. For \(p=\infty\)p=∞p=\infty, norm zero implies \(P(|X|>1/k)=0\)P(|X|>1/k)=0P(|X|>1/k)=0 for all \(k\)kk, with the same conclusion. Conversely an a.s. zero variable has norm zero. This also proves that the value of a norm is unchanged by null-set modifications.

It remains to prove the triangle inequality. For \(p=1\)p=1p=1, integrate \(|X+Y|\le|X|+|Y|\)|X+Y|≤|X|+|Y||X+Y|\le|X|+|Y|. For \(p=\infty\)p=∞p=\infty, combine a.s. bounds with \(\varepsilon>0\)ε>0\varepsilon>0 and let \(\varepsilon\downarrow0\)ε↓0\varepsilon\downarrow0. For \(1<p<\infty\)1<p<∞1<p<\infty, first use \(|X+Y|^p\le2^{p-1}(|X|^p+|Y|^p)\)|X+Y|p≤2p−1(|X|p+|Y|p)|X+Y|^p\le2^{p-1}(|X|^p+|Y|^p), a scalar convexity inequality, to establish \(X+Y\in L^p\)X+Y∈LpX+Y\in L^p. Then Hölder gives \[\begin{aligned} \E|X+Y|^p &\le\E\big[|X||X+Y|^{p-1}\big]+\E\big[|Y||X+Y|^{p-1}\big]\\ &\le(\|X\|_p+\|Y\|_p) \big(\E|X+Y|^{(p-1)q}\big)^{1/q}\\ &=(\|X\|_p+\|Y\|_p)\|X+Y\|_p^{p-1}.\end{aligned}\]𝔼|X+Y|p≤𝔼[|X||X+Y|p−1]+𝔼[|Y||X+Y|p−1]≤(∥X∥p+∥Y∥p)(𝔼|X+Y|(p−1)q)1/q=(∥X∥p+∥Y∥p)∥X+Y∥pp−1.\begin{aligned} \mathbb{E}|X+Y|^p &\le\mathbb{E}\big[|X||X+Y|^{p-1}\big]+\mathbb{E}\big[|Y||X+Y|^{p-1}\big]\\ &\le(\|X\|_p+\|Y\|_p) \big(\mathbb{E}|X+Y|^{(p-1)q}\big)^{1/q}\\ &=(\|X\|_p+\|Y\|_p)\|X+Y\|_p^{p-1}.\end{aligned} If \(\|X+Y\|_p=0\)∥X+Y∥p=0\|X+Y\|_p=0 the triangle inequality is immediate; otherwise divide by its finite positive \((p-1)\)(p−1)(p-1)st power. This proves Minkowski without assuming the norm property one is trying to establish. Together with linearity of almost-sure equivalence classes, these facts give the claimed normed vector space. Completeness is a separate theorem, referenced in the further reading.

Low priority — not examined: Details for the optional random-graph threshold
Exercise 8The missing second-moment argument#

For \(G\sim\mathcal G(n,p_n)\)G∼𝒢(n,pn)G\sim\mathcal G(n,p_n), let \(N\)NN count triangles. Compute its variance and use it to show \(P(N=0)\to0\)P(N=0)→0P(N=0)\to0 if \(p_n=n^{-\alpha}\)pn=n−αp_n=n^{-\alpha}, \(0<\alpha<1\)0<α<10<\alpha<1.

Reveal solution

Each triangle indicator has variance \(p_n^3-p_n^6\)pn3−pn6p_n^3-p_n^6. Distinct triangles with no common edge depend on disjoint sets of independent edge variables and hence have covariance zero, even if they share a vertex. Those sharing one edge have five distinct required edges, so covariance \(p_n^5-p_n^6\)pn5−pn6p_n^5-p_n^6. There are \(\binom n2\binom{n-2}2=6\binom n4\)(n2)(n−22)=6(n4)\binom n2\binom{n-2}2=6\binom n4 unordered pairs sharing an edge. Since a variance expansion counts each unordered pair twice, \[\var(N)=\binom n3(p_n^3-p_n^6)+12\binom n4(p_n^5-p_n^6).\]Var(N)=(n3)(pn3−pn6)+12(n4)(pn5−pn6).\operatorname{Var}(N)=\binom n3(p_n^3-p_n^6)+12\binom n4(p_n^5-p_n^6). For \(n\ge3\)n≥3n\ge3 and \(p_n>0\)pn>0p_n>0, Chebyshev, with \(m_n=\E N>0\)mn=𝔼N>0m_n=\mathbb{E}N>0, gives \[P(N=0)\le P(|N-m_n|\ge m_n)\le\frac{\var(N)}{m_n^2} \le\frac{1}{\binom n3p_n^3} +\frac{12\binom n4}{\binom n3^2p_n}.\]P(N=0)≤P(|N−mn|≥mn)≤Var(N)mn2≤1(n3)pn3+12(n4)(n3)2pn.P(N=0)\le P(|N-m_n|\ge m_n)\le\frac{\operatorname{Var}(N)}{m_n^2} \le\frac{1}{\binom n3p_n^3} +\frac{12\binom n4}{\binom n3^2p_n}. As \(n\to\infty\)n→∞n\to\infty, the terms are respectively \(O(n^{-3+3\alpha})\)O(n−3+3α)O(n^{-3+3\alpha}) and \(O(n^{-2+\alpha})\)O(n−2+α)O(n^{-2+\alpha}), both tending to zero for \(0<\alpha<1\)0<α<10<\alpha<1. This proves the claimed existence of a triangle with probability tending to one. The \(\alpha>1\)α>1\alpha>1 assertion follows from the first moment as in the main text; no critical-case probability was proved.

Low priority — not examined: Details for covariance geometry
Exercise 9Affine concentration and centered empirical covariance#

Under the finite-second-moment and eigendecomposition assumptions of Section 3.3, prove \(X=m+UU^\top(X-m)\)X=m+UU⊤(X−m)X=m+UU^\top(X-m) a.s. Check the empirical covariance formula and rank bound. Illustrate why “linear subspace” needs centering.

Reveal solution

Choose an orthonormal basis \(v_1,\ldots,v_{p-r}\)v1,…,vp−rv_1,\ldots,v_{p-r} for the orthogonal complement of the columns of \(U\)UU. For each \(j\)jj, \[\E\big[(v_j^\top(X-m))^2\big]=v_j^\top\Sigma v_j=0.\]𝔼[(vj⊤(X−m))2]=vj⊤Σvj=0.\mathbb{E}\big[(v_j^\top(X-m))^2\big]=v_j^\top\Sigma v_j=0. The zero-expectation argument from Exercise 4 shows that each scalar vanishes a.s. A finite union of the exceptional null sets is null, so all coordinates vanish simultaneously outside one null set. The orthogonal projection onto the complement is \(I-UU^\top=\sum_j v_jv_j^\top\)I−UU⊤=∑jvjvj⊤I-UU^\top=\sum_j v_jv_j^\top, giving \((I-UU^\top)(X-m)=0\)(I−UU⊤)(X−m)=0(I-UU^\top)(X-m)=0 a.s. If \(r=0\)r=0r=0, the same argument gives \(X=m\)X=mX=m a.s.

Centering moves an affine line through the origin Explanation
Outcomes (-1,1) and (1,3) lie on x2=x1+2 with mean (0,2).After subtracting the mean, outcomes (-1,-1) and (1,1) lie on x2=x1 through the origin.

Matrix multiplication gives \(\mathsf X_c^\top\mathsf X_c=\sum_i(X^{(i)}-\bar X)(X^{(i)}-\bar X)^\top\)𝖷c⊤𝖷c=∑i(X(i)−X‾)(X(i)−X‾)⊤\mathsf X_c^\top\mathsf X_c=\sum_i(X^{(i)}-\bar X)(X^{(i)}-\bar X)^\top, so division by \(n\)nn proves (5). Since \(\mathbf1_n^\top\mathsf X_c=0\)1n⊤𝖷c=0\mathbf1_n^\top\mathsf X_c=0, the columns lie in the \((n-1)\)(n−1)(n-1)-dimensional orthogonal complement of \(\mathbf1_n\)1n\mathbf1_n. Also \(\ker(\mathsf X_c^\top\mathsf X_c)=\ker(\mathsf X_c)\)ker(𝖷c⊤𝖷c)=ker(𝖷c)\ker(\mathsf X_c^\top\mathsf X_c)=\ker(\mathsf X_c) because \(v^\top\mathsf X_c^\top\mathsf X_cv=\|\mathsf X_cv\|^2\)v⊤𝖷c⊤𝖷cv=∥𝖷cv∥2v^\top\mathsf X_c^\top\mathsf X_cv=\|\mathsf X_cv\|^2. Thus \(\mathrm{rank}(\widehat\Sigma)=\mathrm{rank}(\mathsf X_c) \le\min(p,n-1)\)rank(Σ̂)=rank(𝖷c)≤min(p,n−1)\mathrm{rank}(\widehat\Sigma)=\mathrm{rank}(\mathsf X_c) \le\min(p,n-1). Let \(T\)TT take \(-1\)−1-1 and \(1\)11 equally likely and let \(X=(T,T+2)^\top\)X=(T,T+2)⊤X=(T,T+2)^\top. Then \(m=(0,2)^\top\)m=(0,2)⊤m=(0,2)^\top and \[\Sigma=\begin{pmatrix}1&1\\1&1\end{pmatrix},\quad U=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix},\quad\Lambda=(2).\]Σ=(1111),U=12(11),Λ=(2).\Sigma=\begin{pmatrix}1&1\\1&1\end{pmatrix},\quad U=\frac1{\sqrt2}\begin{pmatrix}1\\1\end{pmatrix},\quad\Lambda=(2). The two outcomes \((-1,1)\)(−1,1)(-1,1) and \((1,3)\)(1,3)(1,3) lie on the affine line \(x_2=x_1+2\)x2=x1+2x_2=x_1+2, while \(X-m\)X−mX-m lies on the linear line \(x_2=x_1\)x2=x1x_2=x_1. For \(u=(1,-1)^\top/\sqrt2\)u=(1,−1)⊤/2u=(1,-1)^\top/\sqrt2, \(u^\top X=-\sqrt2\)u⊤X=−2u^\top X=-\sqrt2 is constant, not zero. Zero variance means constancy; centering turns that constant into zero.

References

[1]
T. M. Cover and J. A. Thomas. Elements of information theory. Wiley-Interscience. 2006.
[2]
W. Rudin. Real and complex analysis. McGraw-Hill Education. 1987.
[3]
J. Shao. Mathematical Statistics. Springer. 2003.

Terminology notes


  1. Cantor distribution · Low — not examined

    The Cantor distribution is a probability law concentrated on the Cantor set, a subset of \([0,1]\)[0,1][0,1] of Lebesgue measure zero, yet each individual point has probability zero. Its CDF is continuous but is not the integral of a Lebesgue density. It illustrates the third term in the decomposition; its full construction is optional here.↩︎

  2. An equivalence class here is the collection of all random variables equal to one another with probability one. The zero element consists of variables that are zero almost surely, even if a chosen representative is nonzero on a null set. This is why norm zero means equality almost surely.↩︎

  3. Banach space · Further reading

    A Banach space is a normed vector space in which every Cauchy sequence converges in that norm to an element of the same space. “Cauchy” means that \(\|X_n-X_m\|\)∥Xn−Xm∥\|X_n-X_m\| becomes arbitrarily small for all sufficiently large \(n,m\)n,mn,m.↩︎

What changed

October 19, 2026 (instructor follow-up). Removed the spatial log-gradient exercise, its solution and boundary diagram at the instructor’s request. Nine complete exercises remain.

October 19, 2026: Corrected notation, wording and cross-references after the course-wide errata review; refreshed the linked HTML and PDF editions.

October 14, 2026. Added issue-reporting links to the webpage and PDF. The mathematics and priority assignments are unchanged in this update.

Comments

Discuss an idea or ask a public question. Include a section or exercise number when relevant. For errors in the notes or website, Report an issue.

Public comments use Disqus. Enable JavaScript to load them.

Email the instructor for a private question or if comments are unavailable.