Skip to content

Random Variables and Expectation: Measurable Functions and the Lebesgue Integral

Prerequisite:Probability Spaces and Kolmogorov's Axioms: Probability as a Measure of Total Mass One

Raw
  • A random variable is a measurable function from a probability space to the real line. Measurability is demanded so that quantities such as P(X≤a)P(X \le a) make sense, that is, so that {ω:X(ω)≤a}\{\omega : X(\omega) \le a\} is an event to which a probability has been assigned.
  • A random variable XX induces a distribution PXP_X (its image measure) on the real line. The distinction between “discrete” and “continuous” is nothing more than the question of whether PXP_X is concentrated on a countable set or has a density with respect to Lebesgue measure.
  • The expectation is the Lebesgue integral E[X]=∫ΩX dPE[X] = \int_\Omega X \, dP. It is built in four stages: indicator functions, then nonnegative simple functions, then nonnegative measurable functions, then integrable functions.
  • The transfer formula E[g(X)]=∫Rg dPXE[g(X)] = \int_{\mathbb{R}} g \, dP_X translates an integral over an abstract Ω\Omega into a familiar sum or an integral over the real line. Every actual computation passes through this theorem.
  • Variance and covariance are precisely the inner-product structure of L2L^2. The correlation coefficient ρ\rho is the cosine of the angle between two centred random variables, and ∣ρ∣≤1|\rho| \le 1 is nothing but the Cauchy–Schwarz inequality.
  • Chebyshev’s inequality bounds tail probabilities using the variance alone, with no assumption whatever on the shape of the distribution. The weak law of large numbers is a two-line consequence of it.

1.1. “A variable determined at random” is not a definition

Section titled “1.1. “A variable determined at random” is not a definition”

In high-school texts and in elementary statistics, a random variable is described as “a variable whose value is determined by the outcome of a trial”. The description is intuitively correct, but as a mathematical object it defines nothing: neither “variable” nor “determined at random” has been given a meaning.

The resolution Kolmogorov gave in his 1933 Grundbegriffe der Wahrscheinlichkeitsrechnung is almost disappointingly simple. Push all the randomness into the probability measure PP, and make the random variable itself a deterministic function. A point ω\omega of the sample space Ω\Omega records which outcome occurred, and X(ω)X(\omega) is the number attached to that outcome. Only the selection of ω\omega is random; the assignment rule XX contains no randomness at all.

For instance, for the experiment of rolling two dice we may take Ω={1,…,6}2\Omega = \{1,\dots,6\}^2, and the sum of the faces is the completely deterministic function X(ω1,ω2)=ω1+ω2X(\omega_1,\omega_2) = \omega_1 + \omega_2. The “probability that the sum is 77” is the PP-measure of the set X−1({7})X^{-1}(\{7\}).

Once this point of view is adopted, the condition to impose on a random variable becomes visible by itself. What we wish to compute are quantities such as P(X≤a)P(X \le a) and P(X∈B)P(X \in B). But the probability measure PP is not defined on all subsets of Ω\Omega; it is defined only on the sets (events) belonging to the σ\sigma-algebra F\mathcal{F}. Hence unless

{ω∈Ω:X(ω)≤a}∈F\{\omega \in \Omega : X(\omega) \le a\} \in \mathcal{F}

holds, the symbol P(X≤a)P(X \le a) is meaningless. Requiring this for every Borel subset of R\mathbb{R} is exactly measurability, and it becomes the definition of a random variable.

This condition is by no means automatic. Let Ω=[0,1]\Omega = [0,1], let F\mathcal{F} be the Lebesgue measurable sets, let PP be Lebesgue measure, and let V⊂[0,1]V \subset [0,1] be a Vitali non-measurable set. Then X=1VX = \mathbf{1}_V is a real-valued function on [0,1][0,1], but X−1({1})=V∉FX^{-1}(\{1\}) = V \notin \mathcal{F}, so P(X=1)P(X = 1) cannot be defined. Measurability is “the minimal etiquette that excludes pathological functions”. For details see Probability spaces and Kolmogorov’s axioms, and in particular the definition of a σ-algebra and a measurable space(Definition 3.1)[Probability Spaces and Kolmogorov's Axioms].

1.3. Why the expectation is defined as a Lebesgue integral

Section titled “1.3. Why the expectation is defined as a Lebesgue integral”

Elementary probability defines the expectation in two separate ways: ∑kxkpk\sum_k x_k p_k in the discrete case and ∫xf(x) dx\int x f(x)\,dx in the continuous case. This carries three disadvantages.

First, random variables of neither kind arise constantly in practice. The payout of an insurance policy with a deductible, for example, is a mixture: an atom of positive probability at 00 with a continuous distribution sitting above it. Second, every theorem has to be proved twice, once for each case. Third, and most importantly, the law of large numbers and the central limit theorem deal with limits of sequences of random variables, and the theorems guaranteeing that limits may be interchanged with integrals (monotone convergence, dominated convergence) are available only within the Lebesgue framework.

Defining the expectation as the single Lebesgue integral E[X]=∫ΩX dPE[X] = \int_\Omega X \, dP resolves all three at once. Below we follow that construction, starting from approximation by simple functions.

Throughout, (Ω,F,P)(\Omega, \mathcal{F}, P) is a probability space (Definition 4.1[Probability Spaces and Kolmogorov's Axioms]): Ω\Omega is a nonempty set, F\mathcal{F} is a σ\sigma-algebra on Ω\Omega, and P:F→[0,1]P : \mathcal{F} \to [0,1] is a countably additive measure with P(Ω)=1P(\Omega) = 1. The σ\sigma-algebra generated by the open subsets of R\mathbb{R} is written B(R)\mathcal{B}(\mathbb{R}) and called the Borel σ\sigma-algebra; its members are Borel sets. We set N={1,2,…}\mathbb{N} = \{1, 2, \ldots\}.

The indicator function of a set AA is written 1A\mathbf{1}_A: it equals 11 when ω∈A\omega \in A and 00 otherwise. Following the usual convention, sets describing events are abbreviated as {X≤a}:={ω∈Ω:X(ω)≤a}\{X \le a\} := \{\omega \in \Omega : X(\omega) \le a\}.

We use the following theorem, established in The Lebesgue integral and the convergence theorems, as known; the proof is left to that article.

Theorem 2.1(Monotone convergence theorem)

Let (Ω,F,μ)(\Omega, \mathcal{F}, \mu) be a measure space and let Xn:Ω→[0,∞]X_n : \Omega \to [0, \infty] be a sequence of measurable functions. If 0≤X1(ω)≤X2(ω)≤⋯0 \le X_1(\omega) \le X_2(\omega) \le \cdots and Xn(ω)→X(ω)X_n(\omega) \to X(\omega) for every ω∈Ω\omega \in \Omega, then XX is measurable and

lim⁡n→∞∫ΩXn dμ=∫ΩX dμ\lim_{n \to \infty} \int_\Omega X_n \, d\mu = \int_\Omega X \, d\mu

holds (as an equality, including the case where both sides are +∞+\infty).

Remark 2.2

The proof is the monotone convergence theorem (Beppo Levi)(Theorem 5.2)[ルベーグ積分の定義と収束定理] in The Lebesgue integral and the convergence theorems. Wherever below we write “interchange the limit and the integral as n→∞n \to \infty”, the justification is, unless stated otherwise, an application of Theorem 2.1.

To handle additivity of the variance in Section 5, we record independence in the language of random variables.

Definition 2.3(Independence of random variables)

Random variables X1,…,XnX_1, \ldots, X_n are independent if for all Borel sets B1,…,Bn∈B(R)B_1, \ldots, B_n \in \mathcal{B}(\mathbb{R})

P(X1∈B1, …, Xn∈Bn)=∏i=1nP(Xi∈Bi)P\bigl(X_1 \in B_1,\ \ldots,\ X_n \in B_n\bigr) = \prod_{i=1}^{n} P(X_i \in B_i)

holds. An infinite family of random variables is independent if every finite subfamily is independent.

3. Random variables and their distributions

Section titled “3. Random variables and their distributions”

3.1. Definition and criteria for measurability

Section titled “3.1. Definition and criteria for measurability”

Definition 3.1(Random variable)

Let (Ω,F,P)(\Omega, \mathcal{F}, P) be a probability space. A map X:Ω→RX : \Omega \to \mathbb{R} is a random variable (equivalently, an F\mathcal{F}-measurable function) if

∀B∈B(R),X−1(B):={ω∈Ω:X(ω)∈B}∈F\forall B \in \mathcal{B}(\mathbb{R}), \quad X^{-1}(B) := \{\omega \in \Omega : X(\omega) \in B\} \in \mathcal{F}

holds. If the range is enlarged to [−∞,+∞][-\infty, +\infty], one uses the Borel σ\sigma-algebra of [−∞,+∞][-\infty,+\infty] in place of B(R)\mathcal{B}(\mathbb{R}) and speaks of an extended-real-valued random variable.

Verifying the definition literally would require checking X−1(B)∈FX^{-1}(B) \in \mathcal{F} for every member of B(R)\mathcal{B}(\mathbb{R}), which is not feasible: the Borel sets include a vast supply of sets with no explicit description. The next proposition guarantees that it suffices to check on a generating family, and thereby turns the verification of measurability into a practical task.

Proposition 3.2(Measurability criterion via a generating family)

Let E⊂2R\mathcal{E} \subset 2^{\mathbb{R}} be a family of sets with σ(E)=B(R)\sigma(\mathcal{E}) = \mathcal{B}(\mathbb{R}). If a map X:Ω→RX : \Omega \to \mathbb{R} satisfies

∀E∈E,X−1(E)∈F\forall E \in \mathcal{E}, \quad X^{-1}(E) \in \mathcal{F}

then XX is a random variable.

Proof(Proposition 3.2)

Put G:={B⊂R:X−1(B)∈F}\mathcal{G} := \{B \subset \mathbb{R} : X^{-1}(B) \in \mathcal{F}\}; we show that G\mathcal{G} is a σ\sigma-algebra on R\mathbb{R}. The key is the elementary fact that preimages commute with all set operations.

(i) X−1(R)=Ω∈FX^{-1}(\mathbb{R}) = \Omega \in \mathcal{F}, so R∈G\mathbb{R} \in \mathcal{G}.

(ii) Let B∈GB \in \mathcal{G}. The statement ω∈X−1(Bc)\omega \in X^{-1}(B^c) is equivalent to X(ω)∉BX(\omega) \notin B, that is, to ω∉X−1(B)\omega \notin X^{-1}(B); hence X−1(Bc)=(X−1(B))cX^{-1}(B^c) = (X^{-1}(B))^c. Since F\mathcal{F} is closed under complements, (X−1(B))c∈F(X^{-1}(B))^c \in \mathcal{F}, so Bc∈GB^c \in \mathcal{G}.

(iii) Let B1,B2,…∈GB_1, B_2, \ldots \in \mathcal{G}. The statement X(ω)∈⋃nBnX(\omega) \in \bigcup_n B_n is equivalent to ”X(ω)∈BnX(\omega) \in B_n for some nn”, so X−1(⋃nBn)=⋃nX−1(Bn)X^{-1}\bigl(\bigcup_n B_n\bigr) = \bigcup_n X^{-1}(B_n). Since F\mathcal{F} is closed under countable unions, this lies in F\mathcal{F}, whence ⋃nBn∈G\bigcup_n B_n \in \mathcal{G}.

Therefore G\mathcal{G} is a σ\sigma-algebra. By hypothesis E⊂G\mathcal{E} \subset \mathcal{G}, and σ(E)\sigma(\mathcal{E}) is the smallest σ\sigma-algebra containing E\mathcal{E}, so B(R)=σ(E)⊂G\mathcal{B}(\mathbb{R}) = \sigma(\mathcal{E}) \subset \mathcal{G}. This says that X−1(B)∈FX^{-1}(B) \in \mathcal{F} for every Borel set BB, which is the condition in Definition 3.1.

Corollary 3.3(Criterion via half-lines)

A map X:Ω→RX : \Omega \to \mathbb{R} is a random variable if and only if

∀a∈R,{X≤a}∈F.\forall a \in \mathbb{R}, \quad \{X \le a\} \in \mathcal{F}.
Proof(Corollary 3.3)

Necessity follows from Definition 3.1, since (−∞,a](-\infty, a] is a Borel set. For sufficiency, put E:={(−∞,a]:a∈R}\mathcal{E} := \{(-\infty, a] : a \in \mathbb{R}\}; we claim σ(E)=B(R)\sigma(\mathcal{E}) = \mathcal{B}(\mathbb{R}). Indeed, every open interval can be produced from members of E\mathcal{E} by countably many set operations:

(a,b)=(⋃n≥n0(−∞,b−1/n])∖(−∞,a](a, b) = \Bigl(\bigcup_{n \ge n_0} (-\infty, b - 1/n]\Bigr) \setminus (-\infty, a]

(where n0n_0 is a natural number large enough that b−1/n0>ab - 1/n_0 > a), and every open subset of R\mathbb{R} is a countable union of open intervals. Hence σ(E)\sigma(\mathcal{E}) contains all open sets, so B(R)⊂σ(E)\mathcal{B}(\mathbb{R}) \subset \sigma(\mathcal{E}). The reverse inclusion is clear because (−∞,a](-\infty,a] is closed. It now suffices to apply Proposition 3.2 to E\mathcal{E}.

We must also check that operations on random variables produce random variables again. Without this we could not even write “the expectation of X+YX + Y”.

Proposition 3.4(Closure of random variables under operations)

Let X,YX, Y be random variables on a probability space (Ω,F,P)(\Omega, \mathcal{F}, P) and let c∈Rc \in \mathbb{R}. Then cXcX, X+YX + Y, XYXY and max⁡(X,Y)\max(X, Y) are all random variables. Moreover, for a sequence (Xn)n∈N(X_n)_{n \in \mathbb{N}} of random variables, sup⁡nXn\sup_n X_n, inf⁡nXn\inf_n X_n, lim sup⁡nXn\limsup_n X_n and lim inf⁡nXn\liminf_n X_n are extended-real-valued random variables.

Proof(Proposition 3.4)

Everything is reduced to Corollary 3.3.

Sum. For every a∈Ra \in \mathbb{R},

{X+Y<a}=⋃q∈Q({X<q}∩{Y<a−q}).\{X + Y < a\} = \bigcup_{q \in \mathbb{Q}} \bigl(\{X < q\} \cap \{Y < a - q\}\bigr).

Indeed, if X(ω)+Y(ω)<aX(\omega) + Y(\omega) < a then X(ω)<a−Y(ω)X(\omega) < a - Y(\omega), so by density of the rationals there is q∈Qq \in \mathbb{Q} with X(ω)<q<a−Y(ω)X(\omega) < q < a - Y(\omega), placing ω\omega in the right-hand side; the reverse inclusion is clear. Since {X<q}=⋃n{X≤q−1/n}∈F\{X < q\} = \bigcup_{n} \{X \le q - 1/n\} \in \mathcal{F} and Q\mathbb{Q} is countable, the right-hand side lies in F\mathcal{F}. Consequently {X+Y≤a}=⋂n{X+Y<a+1/n}∈F\{X+Y \le a\} = \bigcap_n \{X + Y < a + 1/n\} \in \mathcal{F}.

Scalar multiple. If c>0c > 0 then {cX≤a}={X≤a/c}\{cX \le a\} = \{X \le a/c\}; if c<0c < 0 then {cX≤a}={X≥a/c}={X<a/c}c\{cX \le a\} = \{X \ge a/c\} = \{X < a/c\}^c; if c=0c = 0 then cX≡0cX \equiv 0. In each case the set lies in F\mathcal{F}.

Product. First consider X2X^2: if a<0a < 0 then {X2≤a}=∅\{X^2 \le a\} = \emptyset, and if a≥0a \ge 0 then {X2≤a}={−a≤X≤a}∈F\{X^2 \le a\} = \{-\sqrt{a} \le X \le \sqrt{a}\} \in \mathcal{F}. So X2X^2 is a random variable, and by the identity XY=12((X+Y)2−X2−Y2)XY = \frac{1}{2}\bigl((X+Y)^2 - X^2 - Y^2\bigr) together with the closure under sums and scalar multiples already proved, XYXY is a random variable too.

Maximum. {max⁡(X,Y)≤a}={X≤a}∩{Y≤a}∈F\{\max(X,Y) \le a\} = \{X \le a\} \cap \{Y \le a\} \in \mathcal{F}.

Supremum and infimum. {sup⁡nXn≤a}=⋂n{Xn≤a}\{\sup_n X_n \le a\} = \bigcap_n \{X_n \le a\} is a countable intersection, hence lies in F\mathcal{F}; the infimum follows from inf⁡nXn=−sup⁡n(−Xn)\inf_n X_n = -\sup_n(-X_n). Finally lim sup⁡nXn=inf⁡msup⁡n≥mXn\limsup_n X_n = \inf_{m} \sup_{n \ge m} X_n and lim inf⁡nXn=sup⁡minf⁡n≥mXn\liminf_n X_n = \sup_m \inf_{n \ge m} X_n, so applying the supremum and infimum results twice gives the claim.

3.2. Distribution (image measure) and distribution function

Section titled “3.2. Distribution (image measure) and distribution function”

The “probabilistic information” carried by a random variable does not depend on what kind of set Ω\Omega is. It is determined solely by how much probability mass is placed where on the real line. The object that extracts this is the distribution.

Definition 3.5(Distribution and distribution function)

Let XX be a random variable on a probability space (Ω,F,P)(\Omega, \mathcal{F}, P). The set function PXP_X on B(R)\mathcal{B}(\mathbb{R}) defined by

PX(B):=P(X−1(B))(B∈B(R))P_X(B) := P\bigl(X^{-1}(B)\bigr) \qquad (B \in \mathcal{B}(\mathbb{R}))

is called the distribution (or image measure, or law) of XX. Furthermore

FX(a):=P(X≤a)=PX((−∞,a])(a∈R)F_X(a) := P(X \le a) = P_X\bigl((-\infty, a]\bigr) \qquad (a \in \mathbb{R})

is called the distribution function of XX.

Proposition 3.6(The distribution is a probability measure, determined by its distribution function)

The set function PXP_X of Definition 3.5 is a probability measure on (R,B(R))(\mathbb{R}, \mathcal{B}(\mathbb{R})). Moreover its distribution function FXF_X has the following three properties.

  1. Nondecreasing: a≤b  ⟹  FX(a)≤FX(b)a \le b \implies F_X(a) \le F_X(b).
  2. Right-continuous: lim⁡h↓0FX(a+h)=FX(a)\lim_{h \downarrow 0} F_X(a + h) = F_X(a) for every aa.
  3. Limits at the ends: lim⁡a→−∞FX(a)=0\lim_{a \to -\infty} F_X(a) = 0 and lim⁡a→+∞FX(a)=1\lim_{a \to +\infty} F_X(a) = 1.
Proof(Proposition 3.6)

It is a measure. PX(B)=P(X−1(B))≥0P_X(B) = P(X^{-1}(B)) \ge 0 by nonnegativity of PP, and PX(R)=P(Ω)=1P_X(\mathbb{R}) = P(\Omega) = 1 because X−1(R)=ΩX^{-1}(\mathbb{R}) = \Omega. For countable additivity, let B1,B2,…∈B(R)B_1, B_2, \ldots \in \mathcal{B}(\mathbb{R}) be pairwise disjoint; then their preimages are pairwise disjoint as well, since ω∈X−1(Bi)∩X−1(Bj)\omega \in X^{-1}(B_i) \cap X^{-1}(B_j) would give X(ω)∈Bi∩Bj=∅X(\omega) \in B_i \cap B_j = \emptyset, a contradiction. Hence, using the identity X−1(⋃nBn)=⋃nX−1(Bn)X^{-1}(\bigcup_n B_n) = \bigcup_n X^{-1}(B_n) from the proof of Proposition 3.2 together with countable additivity of PP,

PX(⨆nBn)=P(⨆nX−1(Bn))=∑nP(X−1(Bn))=∑nPX(Bn).P_X\Bigl(\bigsqcup_n B_n\Bigr) = P\Bigl(\bigsqcup_n X^{-1}(B_n)\Bigr) = \sum_n P(X^{-1}(B_n)) = \sum_n P_X(B_n).

Property 1. If a≤ba \le b then (−∞,a]⊂(−∞,b](-\infty,a] \subset (-\infty,b], so monotonicity of measures applies.

Property 2. Let hn↓0h_n \downarrow 0 be any decreasing sequence; then (−∞,a+hn]↓(−∞,a](-\infty, a + h_n] \downarrow (-\infty, a]. Since PXP_X is a finite measure, continuity from above applies and FX(a+hn)=PX((−∞,a+hn])→PX((−∞,a])=FX(a)F_X(a + h_n) = P_X((-\infty,a+h_n]) \to P_X((-\infty,a]) = F_X(a). As FXF_X is monotone, validity along every decreasing sequence gives the limit as h↓0h \downarrow 0.

Property 3. From (−∞,−n]↓∅(-\infty, -n] \downarrow \emptyset and continuity from above, FX(−n)→PX(∅)=0F_X(-n) \to P_X(\emptyset) = 0; from (−∞,n]↑R(-\infty, n] \uparrow \mathbb{R} and continuity from below, FX(n)→PX(R)=1F_X(n) \to P_X(\mathbb{R}) = 1. Monotonicity makes this sufficient.

Remark 3.7

Conversely, given any F:R→[0,1]F : \mathbb{R} \to [0,1] with properties 1–3, there is exactly one probability measure having FF as its distribution function (the Lebesgue–Stieltjes construction). Thus “distributions of random variables” and “functions with properties 1–3” correspond one to one. The construction uses the same outer-measure machinery as in Measurable sets and Lebesgue measure.

Definition 3.8(Discrete and continuous types)

A random variable XX is discrete if there is a countable set S={x1,x2,…}⊂RS = \{x_1, x_2, \ldots\} \subset \mathbb{R} with P(X∈S)=1P(X \in S) = 1. In this case pk:=P(X=xk)p_k := P(X = x_k) is called the probability mass function.

XX is continuous (absolutely continuous) if there is a Borel measurable f:R→[0,∞)f : \mathbb{R} \to [0,\infty) with

PX(B)=∫Bf(x) dx(∀B∈B(R)),P_X(B) = \int_B f(x) \, dx \qquad (\forall B \in \mathcal{B}(\mathbb{R})),

where the right-hand side is a Lebesgue integral. Such an ff is called a probability density function.

These two do not exhaust the possibilities. There are random variables whose distribution function is continuous but which have no density (the Cantor distribution), and there are mixtures of a discrete and a continuous part. Defining the expectation by the Lebesgue integral is stronger than the elementary dichotomy precisely because it treats all of these without distinction.

Example 3.9(Standard discrete distributions)

Bernoulli distribution Ber(p)\mathrm{Ber}(p) (with 0≤p≤10 \le p \le 1): P(X=1)=pP(X=1)=p, P(X=0)=1−pP(X=0)=1-p. It records whether a single trial succeeded.

Binomial distribution Bin(n,p)\mathrm{Bin}(n,p): P(X=k)=(nk)pk(1−p)n−kP(X=k) = \binom{n}{k} p^k (1-p)^{n-k} for k=0,1,…,nk = 0,1,\ldots,n. That this is a probability mass function follows from the binomial theorem:

∑k=0n(nk)pk(1−p)n−k=(p+(1−p))n=1.\sum_{k=0}^{n} \binom{n}{k} p^k (1-p)^{n-k} = \bigl(p + (1-p)\bigr)^n = 1 .

It is the distribution of the number of successes in nn independent trials with success probability pp.

Poisson distribution Po(λ)\mathrm{Po}(\lambda) (with λ>0\lambda > 0): P(X=k)=e−λλkk!P(X=k) = e^{-\lambda} \dfrac{\lambda^k}{k!} for k=0,1,2,…k = 0,1,2,\ldots. The total mass is 11 by the Taylor expansion of the exponential:

∑k=0∞e−λλkk!=e−λeλ=1.\sum_{k=0}^{\infty} e^{-\lambda} \frac{\lambda^k}{k!} = e^{-\lambda} e^{\lambda} = 1 .

It arises as the limit of the binomial distribution when n→∞n \to \infty, p→0p \to 0 and np→λnp \to \lambda (the law of small numbers), and it is used to model the number of rare events per unit time.

Example 3.10(Standard continuous distributions)

Exponential distribution Exp(λ)\mathrm{Exp}(\lambda) (with λ>0\lambda > 0): density f(x)=λe−λx1{x>0}f(x) = \lambda e^{-\lambda x} \mathbf{1}_{\{x > 0\}}. The total integral is

∫0∞λe−λx dx=[−e−λx]0∞=0−(−1)=1.\int_0^\infty \lambda e^{-\lambda x} \, dx = \Bigl[-e^{-\lambda x}\Bigr]_0^\infty = 0 - (-1) = 1 .

Its distribution function is F(a)=1−e−λaF(a) = 1 - e^{-\lambda a} for a≥0a \ge 0, and it is memoryless: P(X>s+t∣X>s)=e−λt=P(X>t)P(X > s + t \mid X > s) = e^{-\lambda t} = P(X > t).

Normal distribution N(μ,σ2)N(\mu, \sigma^2) (with μ∈R\mu \in \mathbb{R} and σ>0\sigma > 0): density

f(x)=12π σexp⁡ ⁣(−(x−μ)22σ2).f(x) = \frac{1}{\sqrt{2\pi}\,\sigma} \exp\!\left(-\frac{(x-\mu)^2}{2\sigma^2}\right).

That the total integral is 11 follows by substituting z=(x−μ)/σz = (x-\mu)/\sigma and then using the Gaussian integral ∫−∞∞e−z2/2dz=2π\int_{-\infty}^{\infty} e^{-z^2/2} dz = \sqrt{2\pi}. By the central limit theorem it appears universally as the limit of sums of many small independent effects. For details see the central limit theorem (Lindeberg–Lévy)(Theorem 5.6)[The Law of Large Numbers and the Central Limit Theorem] in The law of large numbers and the central limit theorem.

4. Defining the expectation as a Lebesgue integral

Section titled “4. Defining the expectation as a Lebesgue integral”

The expectation E[X]=∫ΩX dPE[X] = \int_\Omega X \, dP is defined in the following four stages. At each stage one must check that the definition extends the previous one consistently.

The four stages in the construction of the expectation (Lebesgue integral)

Definition 4.1(Expectation)

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

(Stages 1 and 2.) If A1,…,An∈FA_1, \ldots, A_n \in \mathcal{F} form a partition of Ω\Omega and a1,…,an∈[0,∞)a_1, \ldots, a_n \in [0,\infty), a random variable of the form S=∑i=1nai1AiS = \sum_{i=1}^n a_i \mathbf{1}_{A_i} is called a nonnegative simple function, and its expectation is defined by

E[S]:=∑i=1naiP(Ai).E[S] := \sum_{i=1}^{n} a_i P(A_i).

(Stage 3.) For measurable X:Ω→[0,∞]X : \Omega \to [0, \infty] set

E[X]:=sup⁡{ E[S] : S is a nonnegative simple function, 0≤S≤X }∈[0,∞].E[X] := \sup\bigl\{\, E[S] \ :\ S \text{ is a nonnegative simple function},\ 0 \le S \le X \,\bigr\} \in [0, \infty].

(Stage 4.) For a general random variable XX put X+:=max⁡(X,0)X^{+} := \max(X, 0) and X−:=max⁡(−X,0)X^{-} := \max(-X, 0), so that X=X+−X−X = X^+ - X^- and ∣X∣=X++X−|X| = X^+ + X^-. If E[∣X∣]<∞E[|X|] < \infty we call XX integrable and define

E[X]:=E[X+]−E[X−].E[X] := E[X^{+}] - E[X^{-}].

The set of all integrable random variables is written L1(Ω,F,P)L^1(\Omega, \mathcal{F}, P).

The definition in stages 1 and 2 requires a check: since the same simple function admits several representations, we must show that the expectation does not depend on the representation chosen.

Lemma 4.2(The expectation of a simple function is well defined)

If a nonnegative simple function SS has two representations S=∑i=1mai1Ai=∑j=1nbj1BjS = \sum_{i=1}^{m} a_i \mathbf{1}_{A_i} = \sum_{j=1}^{n} b_j \mathbf{1}_{B_j}, where {Ai}\{A_i\} and {Bj}\{B_j\} are both partitions of Ω\Omega into members of F\mathcal{F} and ai,bj≥0a_i, b_j \ge 0, then

∑i=1maiP(Ai)=∑j=1nbjP(Bj).\sum_{i=1}^{m} a_i P(A_i) = \sum_{j=1}^{n} b_j P(B_j).
Proof(Lemma 4.2)

Consider the common refinement Cij:=Ai∩BjC_{ij} := A_i \cap B_j. The family {Cij}i,j\{C_{ij}\}_{i,j} is a partition of Ω\Omega with Ai=⨆jCijA_i = \bigsqcup_j C_{ij} and Bj=⨆iCijB_j = \bigsqcup_i C_{ij}, so finite additivity of PP gives

P(Ai)=∑j=1nP(Cij),P(Bj)=∑i=1mP(Cij).P(A_i) = \sum_{j=1}^{n} P(C_{ij}), \qquad P(B_j) = \sum_{i=1}^{m} P(C_{ij}).

If Cij≠∅C_{ij} \ne \emptyset, then for ω∈Cij\omega \in C_{ij} the value S(ω)S(\omega) equals aia_i in the first representation and bjb_j in the second, so ai=bja_i = b_j. Therefore

∑iaiP(Ai)=∑i∑jaiP(Cij)=∑i∑jbjP(Cij)=∑jbjP(Bj)\sum_{i} a_i P(A_i) = \sum_{i}\sum_{j} a_i P(C_{ij}) = \sum_{i}\sum_{j} b_j P(C_{ij}) = \sum_{j} b_j P(B_j)

(the terms with Cij=∅C_{ij} = \emptyset have P(Cij)=0P(C_{ij}) = 0 and hence do no harm even when ai≠bja_i \ne b_j).

Remark 4.3

One must also check that the definition at stage 3 is consistent with stage 2, that is, that the two agree when XX is itself a nonnegative simple function. Since XX itself is among the simple functions S≤XS \le X, we have sup⁡≥E[X]\sup \ge E[X]; conversely, for any simple SS with 0≤S≤X0 \le S \le X, passing to a common refinement shows E[S]≤E[X]E[S] \le E[X] by finite additivity. Hence sup⁡=E[X]\sup = E[X].

The definition by a supremum at stage 3 is not usable for computation as it stands. What one actually uses is the following construction, which approximates an arbitrary nonnegative measurable function from below by an increasing sequence of simple functions. (The same statement for a general measure space is the simple approximation theorem(Theorem 3.7)[ルベーグ積分の定義と収束定理].)

Proposition 4.4(Standard approximating sequence)

Let X:Ω→[0,∞]X : \Omega \to [0,\infty] be measurable and for n∈Nn \in \mathbb{N} set

Xn:=∑k=0n2n−1k2n 1{k2n≤X<k+12n}  +  n 1{X≥n}.X_n := \sum_{k=0}^{n2^n - 1} \frac{k}{2^n}\, \mathbf{1}_{\left\{\frac{k}{2^n} \le X < \frac{k+1}{2^n}\right\}} \;+\; n\, \mathbf{1}_{\{X \ge n\}} .

Then each XnX_n is a nonnegative simple function, and for every ω\omega we have Xn(ω)≤Xn+1(ω)X_n(\omega) \le X_{n+1}(\omega) and Xn(ω)→X(ω)X_n(\omega) \to X(\omega). Moreover E[Xn]→E[X]E[X_n] \to E[X].

Proof(Proposition 4.4)

They are simple functions. Since XX is measurable, each of the sets {k2−n≤X<(k+1)2−n}=X−1([k2−n,(k+1)2−n))\{k2^{-n} \le X < (k+1)2^{-n}\} = X^{-1}([k2^{-n}, (k+1)2^{-n})) and {X≥n}\{X \ge n\} lies in F\mathcal{F} by Definition 3.1. They form a finite partition of Ω\Omega, and the coefficients are nonnegative.

Monotonicity. Passing from stage nn to stage n+1n+1 halves the width of the intervals from 2−n2^{-n} to 2−(n+1)2^{-(n+1)}. If X(ω)∈[k2−n,(k+1)2−n)X(\omega) \in [k2^{-n}, (k+1)2^{-n}), then the value at stage n+1n+1 is either 2k⋅2−(n+1)=k2−n2k \cdot 2^{-(n+1)} = k2^{-n} or (2k+1)2−(n+1)>k2−n(2k+1)2^{-(n+1)} > k2^{-n}, so Xn+1(ω)≥Xn(ω)X_{n+1}(\omega) \ge X_n(\omega). On the part where X(ω)≥nX(\omega) \ge n, the value at stage n+1n+1 is at least nn.

Pointwise convergence. If X(ω)<∞X(\omega) < \infty, then for all nn beyond some n>X(ω)n > X(\omega) we have 0≤X(ω)−Xn(ω)≤2−n→00 \le X(\omega) - X_n(\omega) \le 2^{-n} \to 0. If X(ω)=∞X(\omega) = \infty, then Xn(ω)=n→∞=X(ω)X_n(\omega) = n \to \infty = X(\omega).

Convergence of the integrals. The sequence (Xn)(X_n) consists of nonnegative measurable functions increasing pointwise to XX, so Theorem 2.1 gives E[Xn]→E[X]E[X_n] \to E[X].

k=1k=2k=3k=4k=50ωX(ω)step function Xₙ (nonnegative simple)
The standard approximating sequence slices the range into steps of size 2⁻ⁿ and makes the function constant on the preimages. Where Riemann integration partitions the domain, Lebesgue integration partitions the range.

The expectation was defined as an integral over Ω\Omega, but Ω\Omega is an abstract set and nothing can be computed there directly. The theorem that makes every actual computation possible is the following. In statistics texts it is sometimes called the law of the unconscious statistician.

Theorem 4.5(Transfer formula)

Let XX be a random variable on a probability space (Ω,F,P)(\Omega,\mathcal{F},P) and let g:R→Rg : \mathbb{R} \to \mathbb{R} be Borel measurable.

  1. If g≥0g \ge 0, then as an identity in [0,∞][0,\infty], E[g(X)]=∫Rg(x) PX(dx).E[g(X)] = \int_{\mathbb{R}} g(x) \, P_X(dx).
  2. For general gg, integrability of g(X)g(X) with respect to PP is equivalent to integrability of gg with respect to PXP_X, and in that case the identity above holds.
Proof(Theorem 4.5)

We argue by the standard machine (indicator functions, then simple functions, then nonnegative functions, then the general case). Note first that g(X)=g∘Xg(X) = g \circ X is a random variable: for any Borel set BB we have (g∘X)−1(B)=X−1(g−1(B))(g\circ X)^{-1}(B) = X^{-1}(g^{-1}(B)), and measurability of gg gives g−1(B)∈B(R)g^{-1}(B) \in \mathcal{B}(\mathbb{R}) while measurability of XX gives X−1(g−1(B))∈FX^{-1}(g^{-1}(B)) \in \mathcal{F}.

Stage 1 (g=1Bg = \mathbf{1}_B). Let B∈B(R)B \in \mathcal{B}(\mathbb{R}). We have 1B(X(ω))=1\mathbf{1}_B(X(\omega)) = 1 exactly when X(ω)∈BX(\omega) \in B, that is, when ω∈X−1(B)\omega \in X^{-1}(B); hence 1B∘X=1X−1(B)\mathbf{1}_B \circ X = \mathbf{1}_{X^{-1}(B)}. So stage 1 of Definition 4.1 gives

E[1B(X)]=E[1X−1(B)]=P(X−1(B))=PX(B)=∫R1B dPX.E[\mathbf{1}_B(X)] = E[\mathbf{1}_{X^{-1}(B)}] = P(X^{-1}(B)) = P_X(B) = \int_{\mathbb{R}} \mathbf{1}_B \, dP_X .

The third equality is Definition 3.5, and the fourth is stage 1 of the definition of the integral with respect to PXP_X.

Stage 2 (nonnegative simple functions). Let g=∑i=1nai1Big = \sum_{i=1}^{n} a_i \mathbf{1}_{B_i} with ai≥0a_i \ge 0 and the BiB_i Borel sets partitioning R\mathbb{R}. Then g(X)=∑iai1X−1(Bi)g(X) = \sum_i a_i \mathbf{1}_{X^{-1}(B_i)}, and {X−1(Bi)}\{X^{-1}(B_i)\} is a partition of Ω\Omega. Hence

E[g(X)]=∑i=1naiP(X−1(Bi))=∑i=1naiPX(Bi)=∫Rg dPX.E[g(X)] = \sum_{i=1}^n a_i P(X^{-1}(B_i)) = \sum_{i=1}^n a_i P_X(B_i) = \int_{\mathbb{R}} g \, dP_X .

Here the outer equalities are independent of the chosen representation by Lemma 4.2.

Stage 3 (g≥0g \ge 0). Apply the standard approximating sequence of Proposition 4.4 to gg, obtaining an increasing sequence of nonnegative simple functions gn↑gg_n \uparrow g. Composing, gn(X(ω))↑g(X(ω))g_n(X(\omega)) \uparrow g(X(\omega)) for every ω\omega, so gn∘Xg_n \circ X is an increasing sequence of nonnegative simple functions as well. Applying Theorem 2.1 on both sides (with measure PP on the left and PXP_X on the right),

E[g(X)]=lim⁡n→∞E[gn(X)]=lim⁡n→∞∫Rgn dPX=∫Rg dPX,E[g(X)] = \lim_{n\to\infty} E[g_n(X)] = \lim_{n\to\infty} \int_{\mathbb{R}} g_n \, dP_X = \int_{\mathbb{R}} g \, dP_X ,

where the middle equality is the result of stage 2.

Stage 4 (general case). Decompose g=g+−g−g = g^+ - g^-. Since (g(X))+=g+(X)(g(X))^{+} = g^{+}(X) and (g(X))−=g−(X)(g(X))^{-} = g^{-}(X), applying stage 3 to ∣g∣=g++g−|g| = g^+ + g^- gives

E[∣g(X)∣]=∫R∣g∣ dPX,E[|g(X)|] = \int_{\mathbb{R}} |g| \, dP_X ,

so one side is finite exactly when the other is; this is the asserted equivalence of integrability. When gg is integrable, apply stage 3 separately to g+g^{+} and g−g^{-} and subtract; stage 4 of Definition 4.1 then yields the stated identity.

Corollary 4.6(Computational formulas in the discrete and continuous cases)

Let g:R→Rg : \mathbb{R} \to \mathbb{R} be Borel measurable.

  1. If XX is discrete with P(X=xk)=pkP(X = x_k) = p_k for k∈Nk \in \mathbb{N} and ∑kpk=1\sum_k p_k = 1, then whenever ∑k∣g(xk)∣pk<∞\sum_k |g(x_k)| p_k < \infty the variable g(X)g(X) is integrable and E[g(X)]=∑kg(xk) pk.E[g(X)] = \sum_{k} g(x_k)\, p_k .
  2. If XX is continuous with density ff, then whenever ∫R∣g(x)∣f(x) dx<∞\int_{\mathbb{R}} |g(x)| f(x) \, dx < \infty the variable g(X)g(X) is integrable and E[g(X)]=∫Rg(x)f(x) dx.E[g(X)] = \int_{\mathbb{R}} g(x) f(x) \, dx .
Proof(Corollary 4.6)

By Theorem 4.5, both reduce to computing ∫Rg dPX\int_{\mathbb{R}} g \, dP_X.

1. Put S:={x1,x2,…}S := \{x_1, x_2, \ldots\}, so that PX(S)=1P_X(S) = 1 and PX({xk})=pkP_X(\{x_k\}) = p_k. Suppose first that g≥0g \ge 0 and set gn:=g1{x1,…,xn}g_n := g \mathbf{1}_{\{x_1,\ldots,x_n\}}; then gng_n is simple and gn↑g1Sg_n \uparrow g\mathbf{1}_S. By the definition at stage 2, ∫gn dPX=∑k=1ng(xk)pk\int g_n \, dP_X = \sum_{k=1}^n g(x_k) p_k, and letting n→∞n \to \infty with Theorem 2.1 gives ∫g1SdPX=∑kg(xk)pk\int g \mathbf{1}_S dP_X = \sum_k g(x_k)p_k. Since PX(Sc)=0P_X(S^c) = 0, we have ∫g dPX=∫g1S dPX\int g\, dP_X = \int g\mathbf{1}_S \, dP_X. For general gg split into g+−g−g^{+} - g^{-}, run the same argument, and subtract under the hypothesis of absolute convergence.

2. The claim has the form “if dPX=f dxdP_X = f\,dx then ∫g dPX=∫gf dx\int g \, dP_X = \int g f \, dx”, and this too is proved by the standard machine: for g=1Bg = \mathbf{1}_B it is exactly the definition of a density in Definition 3.8; simple functions follow by linearity; nonnegative measurable functions follow from Theorem 2.1 (if gn↑gg_n \uparrow g then gnf↑gfg_n f \uparrow g f); and the general case follows by splitting into positive and negative parts.

Example 4.7(Means and second moments of standard distributions)

Poisson distribution X∼Po(λ)X \sim \mathrm{Po}(\lambda): by part 1 of Corollary 4.6,

E[X]=∑k=0∞k e−λλkk!=λe−λ∑k=1∞λk−1(k−1)!=λe−λeλ=λ.E[X] = \sum_{k=0}^{\infty} k \, e^{-\lambda}\frac{\lambda^k}{k!} = \lambda e^{-\lambda} \sum_{k=1}^{\infty} \frac{\lambda^{k-1}}{(k-1)!} = \lambda e^{-\lambda} e^{\lambda} = \lambda .

Here we used that the k=0k=0 term vanishes and that k/k!=1/(k−1)!k/k! = 1/(k-1)!. Similarly, for g(x)=x(x−1)g(x) = x(x-1),

E[X(X−1)]=∑k=2∞k(k−1)e−λλkk!=λ2e−λ∑k=2∞λk−2(k−2)!=λ2.E[X(X-1)] = \sum_{k=2}^{\infty} k(k-1) e^{-\lambda}\frac{\lambda^k}{k!} = \lambda^2 e^{-\lambda}\sum_{k=2}^{\infty}\frac{\lambda^{k-2}}{(k-2)!} = \lambda^2 .

Hence E[X2]=E[X(X−1)]+E[X]=λ2+λE[X^2] = E[X(X-1)] + E[X] = \lambda^2 + \lambda.

Exponential distribution X∼Exp(λ)X \sim \mathrm{Exp}(\lambda): by part 2 of Corollary 4.6, integrating by parts,

E[X]=∫0∞xλe−λxdx=[−xe−λx]0∞+∫0∞e−λxdx=0+1λ=1λ,E[X] = \int_0^\infty x \lambda e^{-\lambda x} dx = \Bigl[-x e^{-\lambda x}\Bigr]_0^\infty + \int_0^\infty e^{-\lambda x} dx = 0 + \frac{1}{\lambda} = \frac{1}{\lambda},E[X2]=∫0∞x2λe−λxdx=[−x2e−λx]0∞+∫0∞2xe−λxdx=2λ⋅1λ=2λ2.E[X^2] = \int_0^\infty x^2 \lambda e^{-\lambda x} dx = \Bigl[-x^2 e^{-\lambda x}\Bigr]_0^\infty + \int_0^\infty 2x e^{-\lambda x} dx = \frac{2}{\lambda}\cdot\frac{1}{\lambda} = \frac{2}{\lambda^2}.

In the last equality we used the value ∫0∞xλe−λxdx=1/λ\int_0^\infty x\lambda e^{-\lambda x}dx = 1/\lambda just computed.

Normal distribution X∼N(μ,σ2)X \sim N(\mu, \sigma^2): substituting z=(x−μ)/σz = (x-\mu)/\sigma,

E[X]=∫Rx2πσe−(x−μ)2/(2σ2)dx=∫R(μ+σz)12πe−z2/2dz=μE[X] = \int_{\mathbb{R}} \frac{x}{\sqrt{2\pi}\sigma} e^{-(x-\mu)^2/(2\sigma^2)} dx = \int_{\mathbb{R}} (\mu + \sigma z) \frac{1}{\sqrt{2\pi}} e^{-z^2/2} dz = \mu

(the function ze−z2/2z e^{-z^2/2} is odd and absolutely integrable, so its integral is 00). Next, E[(X−μ)2]=σ2∫Rz212πe−z2/2dzE[(X-\mu)^2] = \sigma^2 \int_{\mathbb{R}} z^2 \frac{1}{\sqrt{2\pi}}e^{-z^2/2}dz, and integrating by parts with u=zu = z and dv=ze−z2/2dzdv = z e^{-z^2/2}dz (so v=−e−z2/2v = -e^{-z^2/2}),

∫Rz2e−z2/22πdz=12π([−ze−z2/2]−∞∞+∫Re−z2/2dz)=0+1=1,\int_{\mathbb{R}} z^2 \frac{e^{-z^2/2}}{\sqrt{2\pi}} dz = \frac{1}{\sqrt{2\pi}}\Bigl(\Bigl[-z e^{-z^2/2}\Bigr]_{-\infty}^{\infty} + \int_{\mathbb{R}} e^{-z^2/2} dz\Bigr) = 0 + 1 = 1 ,

so E[(X−μ)2]=σ2E[(X-\mu)^2] = \sigma^2.

Example 4.8(A random variable with no expectation (the Cauchy distribution))

Consider a random variable XX with density f(x)=1π(1+x2)f(x) = \dfrac{1}{\pi(1+x^2)}. This really is a density, since ∫Rf=1π[arctan⁡x]−∞∞=1π(π2+π2)=1\int_{\mathbb{R}} f = \frac{1}{\pi}[\arctan x]_{-\infty}^{\infty} = \frac{1}{\pi}\bigl(\frac{\pi}{2} + \frac{\pi}{2}\bigr) = 1.

The density is symmetric about the origin, so one is tempted to say that the mean “ought to be 00”; but the integrability condition at stage 4 of Definition 4.1 fails. Indeed

E[∣X∣]=2π∫0∞x1+x2dx=1π[log⁡(1+x2)]0∞=∞.E[|X|] = \frac{2}{\pi}\int_0^{\infty} \frac{x}{1+x^2} dx = \frac{1}{\pi}\Bigl[\log(1+x^2)\Bigr]_0^{\infty} = \infty .

Thus E[X+]=E[X−]=∞E[X^{+}] = E[X^{-}] = \infty, and E[X]=∞−∞E[X] = \infty - \infty cannot be defined. The correct statement is that E[X]E[X] does not exist.

This is not a pathological example. The Cauchy distribution arises naturally as the distribution of a ratio Z1/Z2Z_1/Z_2 of independent standard normal variables, and moreover the sample mean Xˉn\bar{X}_n of independent Cauchy samples follows the same Cauchy distribution for every nn. In other words, increasing the sample size does not improve the precision. Here one sees what it means that the law of large numbers assumes the existence of the expectation.

The expectation is a single number describing the “location” of a distribution. The standard quantity measuring its “spread” is the variance.

Definition 5.1(Variance, covariance and correlation coefficient)

Write L2=L2(Ω,F,P)L^2 = L^2(\Omega,\mathcal{F},P) for the set of random variables with E[X2]<∞E[X^2] < \infty. For X,Y∈L2X, Y \in L^2, put μX:=E[X]\mu_X := E[X] and μY:=E[Y]\mu_Y := E[Y] and define

Var(X):=E[(X−μX)2],Cov(X,Y):=E[(X−μX)(Y−μY)],\mathrm{Var}(X) := E\bigl[(X - \mu_X)^2\bigr], \qquad \mathrm{Cov}(X,Y) := E\bigl[(X - \mu_X)(Y - \mu_Y)\bigr] ,

called the variance of XX and the covariance of XX and YY. The quantity σX:=Var(X)\sigma_X := \sqrt{\mathrm{Var}(X)} is the standard deviation. If moreover σX>0\sigma_X > 0 and σY>0\sigma_Y > 0, then

ρ(X,Y):=Cov(X,Y)σXσY\rho(X,Y) := \frac{\mathrm{Cov}(X,Y)}{\sigma_X \sigma_Y}

is the correlation coefficient. When Cov(X,Y)=0\mathrm{Cov}(X,Y) = 0 we say XX and YY are uncorrelated.

For this definition to make sense, XX and (X−μX)(Y−μY)(X-\mu_X)(Y-\mu_Y) must be integrable whenever X,Y∈L2X, Y \in L^2.

Proposition 5.2(On a probability space, L² ⊂ L¹)

On a probability space we have L2⊂L1L^2 \subset L^1, and if X,Y∈L2X, Y \in L^2 then XY∈L1XY \in L^1.

Proof(Proposition 5.2)

Expanding (∣a∣−∣b∣)2≥0(|a| - |b|)^2 \ge 0 for real a,ba, b gives ∣ab∣≤12(a2+b2)|ab| \le \frac{1}{2}(a^2 + b^2). Taking b=1b = 1 yields ∣a∣≤12(1+a2)|a| \le \frac{1}{2}(1 + a^2), so

E[∣X∣]≤12(1+E[X2])<∞E[|X|] \le \tfrac{1}{2}\bigl(1 + E[X^2]\bigr) < \infty

(we used E[1]=P(Ω)=1E[1] = P(\Omega) = 1; that this 11 is finite is exactly what a probability measure buys us). Taking a=X(ω)a = X(\omega) and b=Y(ω)b = Y(\omega) in the same inequality gives ∣XY∣≤12(X2+Y2)|XY| \le \frac{1}{2}(X^2 + Y^2), whose right-hand side is integrable, so XY∈L1XY \in L^1. Consequently (X−μX)(Y−μY)=XY−μXY−μYX+μXμY(X-\mu_X)(Y-\mu_Y) = XY - \mu_X Y - \mu_Y X + \mu_X\mu_Y is integrable as well.

Proposition 5.3(Basic properties of variance and covariance)

Let X,Y,X1,…,Xn∈L2X, Y, X_1, \ldots, X_n \in L^2 and a,b∈Ra, b \in \mathbb{R}.

  1. Var(X)=E[X2]−(E[X])2\mathrm{Var}(X) = E[X^2] - (E[X])^2 and Cov(X,Y)=E[XY]−E[X]E[Y]\mathrm{Cov}(X,Y) = E[XY] - E[X]E[Y].
  2. Var(aX+b)=a2Var(X)\mathrm{Var}(aX + b) = a^2 \mathrm{Var}(X). In particular the variance is invariant under translation by a constant.
  3. Cov\mathrm{Cov} is a symmetric bilinear form, and Cov(X,X)=Var(X)\mathrm{Cov}(X,X) = \mathrm{Var}(X).
  4. Var(∑i=1nXi)=∑i=1nVar(Xi)+2∑1≤i<j≤nCov(Xi,Xj)\mathrm{Var}\Bigl(\sum_{i=1}^{n} X_i\Bigr) = \sum_{i=1}^{n}\mathrm{Var}(X_i) + 2\sum_{1 \le i < j \le n} \mathrm{Cov}(X_i, X_j).
  5. Var(X)=0\mathrm{Var}(X) = 0 holds if and only if P(X=E[X])=1P(X = E[X]) = 1.
Proof(Proposition 5.3)

1. By linearity of the expectation (a basic property following from Definition 4.1),

E[(X−μX)(Y−μY)]=E[XY]−μXE[Y]−μYE[X]+μXμY=E[XY]−μXμY.E[(X-\mu_X)(Y-\mu_Y)] = E[XY] - \mu_X E[Y] - \mu_Y E[X] + \mu_X\mu_Y = E[XY] - \mu_X\mu_Y .

Setting Y=XY = X gives the formula for the variance. By Proposition 5.2 every term is finite, so the expansion is legitimate.

2. Since E[aX+b]=aμX+bE[aX+b] = a\mu_X + b, we get (aX+b)−E[aX+b]=a(X−μX)(aX+b) - E[aX+b] = a(X - \mu_X), whence Var(aX+b)=E[a2(X−μX)2]=a2Var(X)\mathrm{Var}(aX+b) = E[a^2(X-\mu_X)^2] = a^2\mathrm{Var}(X).

3. Symmetry holds because the defining expression is symmetric in XX and YY. Bilinearity follows by expanding Cov(aX1+X2,Y)=E[(a(X1−μ1)+(X2−μ2))(Y−μY)]\mathrm{Cov}(aX_1 + X_2, Y) = E[(a(X_1-\mu_1) + (X_2-\mu_2))(Y-\mu_Y)] using linearity of the expectation.

4. Put S:=∑iXiS := \sum_i X_i. Then S−E[S]=∑i(Xi−μi)S - E[S] = \sum_i (X_i - \mu_i), so by the bilinearity of part 3,

Var(S)=Cov(∑i(Xi−μi),∑j(Xj−μj))=∑i∑jCov(Xi,Xj).\mathrm{Var}(S) = \mathrm{Cov}\Bigl(\sum_i (X_i-\mu_i), \sum_j (X_j-\mu_j)\Bigr) = \sum_{i}\sum_{j} \mathrm{Cov}(X_i, X_j) .

The diagonal terms i=ji = j give Var(Xi)\mathrm{Var}(X_i), and by symmetry the off-diagonal terms amount to twice the terms with i<ji < j.

5. Put Z:=(X−μX)2≥0Z := (X - \mu_X)^2 \ge 0. If E[Z]=0E[Z] = 0, then for every ε>0\varepsilon > 0 the simple function ε1{Z≥ε}≤Z\varepsilon \mathbf{1}_{\{Z \ge \varepsilon\}} \le Z gives εP(Z≥ε)≤E[Z]=0\varepsilon P(Z \ge \varepsilon) \le E[Z] = 0, that is, P(Z≥ε)=0P(Z \ge \varepsilon) = 0. Since {Z>0}=⋃n{Z≥1/n}\{Z > 0\} = \bigcup_{n} \{Z \ge 1/n\} is a countable union, P(Z>0)=0P(Z > 0) = 0, i.e. P(X=μX)=1P(X = \mu_X) = 1. Conversely, if P(X=μX)=1P(X = \mu_X) = 1 then Z=0Z = 0 with probability 11 and hence E[Z]=0E[Z] = 0.

Example 5.4(Computing variances, and additivity)

From the results of Example 4.7 and part 1 of Proposition 5.3 we immediately obtain the following.

  • X∼Po(λ)X \sim \mathrm{Po}(\lambda): Var(X)=(λ2+λ)−λ2=λ\mathrm{Var}(X) = (\lambda^2 + \lambda) - \lambda^2 = \lambda. That the mean and the variance coincide is characteristic of the Poisson distribution.
  • X∼Exp(λ)X \sim \mathrm{Exp}(\lambda): Var(X)=2/λ2−1/λ2=1/λ2\mathrm{Var}(X) = 2/\lambda^2 - 1/\lambda^2 = 1/\lambda^2. The standard deviation equals the mean 1/λ1/\lambda.
  • X∼N(μ,σ2)X \sim N(\mu,\sigma^2): Var(X)=σ2\mathrm{Var}(X) = \sigma^2. The parameter is the variance itself.

For the binomial distribution it is quicker to decompose into an independent sum than to compute directly. Let Y1,…,YnY_1, \ldots, Y_n be independent with distribution Ber(p)\mathrm{Ber}(p), so that X:=∑iYi∼Bin(n,p)X := \sum_i Y_i \sim \mathrm{Bin}(n,p). Since Yi2=YiY_i^2 = Y_i,

Var(Yi)=E[Yi2]−(E[Yi])2=p−p2=p(1−p).\mathrm{Var}(Y_i) = E[Y_i^2] - (E[Y_i])^2 = p - p^2 = p(1-p) .

By independence and Proposition 7.5 (Appendix) we have Cov(Yi,Yj)=0\mathrm{Cov}(Y_i,Y_j) = 0 for i≠ji \ne j, so part 4 of Proposition 5.3 gives

E[X]=np,Var(X)=np(1−p).E[X] = np, \qquad \mathrm{Var}(X) = n p(1-p) .

No sum involving binomial coefficients has to be evaluated directly.

5.2. Uncorrelated is not the same as independent

Section titled “5.2. Uncorrelated is not the same as independent”

Example 5.5(Uncorrelated but not independent)

Let XX be uniformly distributed on the interval (−1,1)(-1,1), with density f(x)=121(−1,1)(x)f(x) = \frac{1}{2}\mathbf{1}_{(-1,1)}(x), and put Y:=X2Y := X^2. Since YY is completely determined by XX, intuitively the dependence is as strong as possible. Nevertheless

E[X]=∫−11x2dx=0,E[XY]=E[X3]=∫−11x32dx=0E[X] = \int_{-1}^{1} \frac{x}{2} dx = 0, \qquad E[XY] = E[X^3] = \int_{-1}^{1}\frac{x^3}{2}dx = 0

(the integrands are odd), so part 1 of Proposition 5.3 gives Cov(X,Y)=0−0⋅E[Y]=0\mathrm{Cov}(X,Y) = 0 - 0\cdot E[Y] = 0. They are uncorrelated.

Let us verify from the definition that they are not independent. Take B:=(−12,12)B := (-\tfrac{1}{2}, \tfrac{1}{2}) and C:=[0,19]C := [0, \tfrac{1}{9}]. Since Y∈CY \in C is equivalent to ∣X∣≤1/3|X| \le 1/3,

P(X∈B, Y∈C)=P(∣X∣≤13)=13,P(X∈B) P(Y∈C)=12⋅13=16,P(X \in B,\ Y \in C) = P(|X| \le \tfrac{1}{3}) = \tfrac{1}{3}, \qquad P(X \in B)\,P(Y \in C) = \tfrac{1}{2}\cdot\tfrac{1}{3} = \tfrac{1}{6} ,

and the two do not agree. Hence they are not independent in the sense of Definition 2.3.

The lesson is clear. The covariance detects only linear relationships; it is blind to even-function dependences such as Y=X2Y = X^2. Reading “uncorrelated” as “unrelated” is a mistake.

5.3. The Cauchy–Schwarz inequality and the meaning of the correlation coefficient

Section titled “5.3. The Cauchy–Schwarz inequality and the meaning of the correlation coefficient”

Theorem 5.6(Cauchy–Schwarz inequality for the covariance)

Let X,Y∈L2X, Y \in L^2. Then

∣Cov(X,Y)∣≤σX σY.\bigl|\mathrm{Cov}(X,Y)\bigr| \le \sigma_X \, \sigma_Y .

Moreover, when σX>0\sigma_X > 0 and σY>0\sigma_Y > 0, equality holds if and only if there exist real numbers b≠0b \ne 0 and aa with P(Y=a+bX)=1P(Y = a + bX) = 1.

Proof(Theorem 5.6)

Put U:=X−μXU := X - \mu_X and V:=Y−μYV := Y - \mu_Y, so that E[U]=E[V]=0E[U] = E[V] = 0, E[U2]=σX2E[U^2] = \sigma_X^2, E[V2]=σY2E[V^2] = \sigma_Y^2 and E[UV]=Cov(X,Y)E[UV] = \mathrm{Cov}(X,Y). All of these are finite by Proposition 5.2.

Case σX=0\sigma_X = 0: by part 5 of Proposition 5.3 we have P(U=0)=1P(U = 0) = 1, so UV=0UV = 0 with probability 11 and Cov(X,Y)=0\mathrm{Cov}(X,Y) = 0; the inequality holds with equality.

Now suppose σX>0\sigma_X > 0. For every t∈Rt \in \mathbb{R} we have (V+tU)2≥0(V + tU)^2 \ge 0, so by monotonicity of the expectation

φ(t):=E[(V+tU)2]=σY2+2t Cov(X,Y)+t2σX2≥0\varphi(t) := E\bigl[(V + tU)^2\bigr] = \sigma_Y^2 + 2t\,\mathrm{Cov}(X,Y) + t^2 \sigma_X^2 \ge 0

(the expansion uses linearity of the expectation). This is a quadratic in tt with leading coefficient σX2>0\sigma_X^2 > 0. Nonnegativity for all tt is equivalent to the discriminant being at most 00, so

4 Cov(X,Y)2−4σX2σY2≤0,4\,\mathrm{Cov}(X,Y)^2 - 4\sigma_X^2\sigma_Y^2 \le 0,

that is, ∣Cov(X,Y)∣≤σXσY|\mathrm{Cov}(X,Y)| \le \sigma_X\sigma_Y.

Equality. Equality holds exactly when the discriminant vanishes, i.e. when there is a (double) root t0t_0 with φ(t0)=0\varphi(t_0) = 0. From φ(t0)=E[(V+t0U)2]=0\varphi(t_0) = E[(V + t_0 U)^2] = 0 and the argument inside the proof of part 5 of Proposition 5.3 (a nonnegative random variable with expectation 00 vanishes with probability 11), we get P(V+t0U=0)=1P(V + t_0 U = 0) = 1. Rewriting,

P(Y=(μY+t0μX)−t0X)=1,P\bigl(Y = (\mu_Y + t_0\mu_X) - t_0 X\bigr) = 1 ,

so it suffices to set b:=−t0b := -t_0 and a:=μY+t0μXa := \mu_Y + t_0\mu_X. We do need b≠0b \ne 0, i.e. t0≠0t_0 \ne 0: if t0=0t_0 = 0 then φ(0)=σY2=0\varphi(0) = \sigma_Y^2 = 0, contradicting the assumption σY>0\sigma_Y > 0, so indeed t0≠0t_0 \ne 0. (In the degenerate case σY=0\sigma_Y = 0 the variable YY is constant, and although equality does hold, Cov(X,Y)=0=σXσY\mathrm{Cov}(X,Y) = 0 = \sigma_X\sigma_Y, one has b=0b = 0.) Conversely, if P(Y=a+bX)=1P(Y = a + bX) = 1 with b≠0b \ne 0, then parts 2 and 3 of Proposition 5.3 give Cov(X,Y)=b σX2\mathrm{Cov}(X,Y) = b\,\sigma_X^2 and σY=∣b∣σX\sigma_Y = |b|\sigma_X, so ∣Cov(X,Y)∣=∣b∣σX2=σXσY|\mathrm{Cov}(X,Y)| = |b|\sigma_X^2 = \sigma_X\sigma_Y and equality holds.

Corollary 5.7(Range of the correlation coefficient)

If σX>0\sigma_X > 0 and σY>0\sigma_Y > 0 then −1≤ρ(X,Y)≤1-1 \le \rho(X,Y) \le 1. Moreover ρ(X,Y)=±1\rho(X,Y) = \pm 1 holds if and only if there exist a,ba, b with P(Y=a+bX)=1P(Y = a + bX) = 1, the sign of bb agreeing with the sign of ρ\rho.

Proof(Corollary 5.7)

Dividing both sides in Theorem 5.6 by σXσY>0\sigma_X\sigma_Y > 0 gives ∣ρ∣≤1|\rho| \le 1, and the equality condition follows from the same theorem. As for the sign, when P(Y=a+bX)=1P(Y = a+bX) = 1 we have ρ=bσX2/(σX⋅∣b∣σX)=b/∣b∣=sgn(b)\rho = b\sigma_X^2/(\sigma_X \cdot |b|\sigma_X) = b/|b| = \mathrm{sgn}(b).

The statement that the correlation coefficient measures “the strength of a linear relationship” acquires a precise meaning through the following computation.

Example 5.8(The correlation coefficient determines the error of the best linear prediction)

Suppose we predict YY from XX by an expression of the form a+bXa + bX; we find the a,ba, b minimising the mean squared error, and the minimum value. Assume σX>0\sigma_X > 0 and σY>0\sigma_Y > 0.

First fix bb and minimise over aa. Put h(a,b):=E[(Y−a−bX)2]h(a,b) := E[(Y - a - bX)^2]. With W:=Y−bXW := Y - bX we have h=E[(W−a)2]=Var(W)+(E[W]−a)2h = E[(W - a)^2] = \mathrm{Var}(W) + (E[W] - a)^2 (apply part 1 of Proposition 5.3 to W−aW - a). So a∗=E[W]=μY−bμXa^{*} = E[W] = \mu_Y - b\mu_X is optimal, and the resulting value is

Var(Y−bX)=σY2−2b Cov(X,Y)+b2σX2\mathrm{Var}(Y - bX) = \sigma_Y^2 - 2b\,\mathrm{Cov}(X,Y) + b^2\sigma_X^2

(by parts 4, 2 and 3 of Proposition 5.3). This is a quadratic in bb; completing the square gives

σX2(b−Cov(X,Y)σX2)2+σY2−Cov(X,Y)2σX2,\sigma_X^2\left(b - \frac{\mathrm{Cov}(X,Y)}{\sigma_X^2}\right)^2 + \sigma_Y^2 - \frac{\mathrm{Cov}(X,Y)^2}{\sigma_X^2} ,

so the minimum is attained at

b∗=Cov(X,Y)σX2=ρ σYσX,min⁡a,bE[(Y−a−bX)2]=σY2(1−ρ2).b^{*} = \frac{\mathrm{Cov}(X,Y)}{\sigma_X^2} = \rho\,\frac{\sigma_Y}{\sigma_X}, \qquad \min_{a,b} E[(Y - a - bX)^2] = \sigma_Y^2\bigl(1 - \rho^2\bigr) .

Thus ρ2\rho^2 is “the fraction of the variance of YY explained by linear prediction from XX”. If ρ=±1\rho = \pm 1 the error is 00, that is, YY is an affine function of XX, exactly as in Corollary 5.7. If ρ=0\rho = 0, linear prediction cannot beat the constant μY\mu_Y. The coefficient of determination R2R^2 in regression analysis is a generalisation of this ρ2\rho^2. Handling more complicated dependences requires dropping the linearity constraint, which leads to the conditional expectation (see Conditional expectation, and in particular the conditional expectation as an orthogonal projection(Theorem 5.1)[条件付き期待値]).

Even with no knowledge whatever of the shape of a distribution, tail probabilities can be estimated from the mean and the variance alone. This is the content of the next two inequalities. Both proofs take two lines, yet they are among the most heavily used tools in probability.

Theorem 6.1(Markov's inequality)

Let XX be a nonnegative random variable, i.e. P(X≥0)=1P(X \ge 0) = 1. Then for every a>0a > 0,

P(X≥a)≤E[X]a.P(X \ge a) \le \frac{E[X]}{a} .
Proof(Theorem 6.1)

Put A:={X≥a}∈FA := \{X \ge a\} \in \mathcal{F} (measurability of XX). For every ω\omega,

a 1A(ω)≤X(ω).a\,\mathbf{1}_A(\omega) \le X(\omega) .

Indeed, if ω∈A\omega \in A the left-hand side is aa and by definition of AA we have X(ω)≥aX(\omega) \ge a; if ω∉A\omega \notin A the left-hand side is 00 and the right-hand side is nonnegative since X≥0X \ge 0.

The expectation is monotone (U≤VU \le V implies E[U]≤E[V]E[U] \le E[V], which follows at once from the supremum in stage 3 of Definition 4.1), so taking expectations of both sides,

a P(A)=E[a1A]≤E[X].a\,P(A) = E[a\mathbf{1}_A] \le E[X] .

Dividing by a>0a > 0 gives the claim.

Corollary 6.2(Chebyshev's inequality)

Let X∈L2X \in L^2, μ:=E[X]\mu := E[X] and σ2:=Var(X)\sigma^2 := \mathrm{Var}(X). Then for every a>0a > 0,

P(∣X−μ∣≥a)≤σ2a2.P\bigl(|X - \mu| \ge a\bigr) \le \frac{\sigma^2}{a^2} .

In particular, when σ>0\sigma > 0, taking a=kσa = k\sigma with k>0k > 0 gives

P(∣X−μ∣≥kσ)≤1k2.P\bigl(|X - \mu| \ge k\sigma\bigr) \le \frac{1}{k^2}.
Proof(Corollary 6.2)

Put Y:=(X−μ)2≥0Y := (X-\mu)^2 \ge 0; by Proposition 5.2 we have E[Y]=σ2<∞E[Y] = \sigma^2 < \infty. The events satisfy

{∣X−μ∣≥a}={(X−μ)2≥a2}={Y≥a2}\{|X - \mu| \ge a\} = \{(X-\mu)^2 \ge a^2\} = \{Y \ge a^2\}

(since t↦t2t \mapsto t^2 is strictly increasing on [0,∞)[0,\infty), the conditions ∣X−μ∣≥a>0|X-\mu| \ge a > 0 and (X−μ)2≥a2(X-\mu)^2 \ge a^2 are equivalent). Applying Theorem 6.1 to YY and a2>0a^2 > 0,

P(∣X−μ∣≥a)=P(Y≥a2)≤E[Y]a2=σ2a2.P(|X-\mu| \ge a) = P(Y \ge a^2) \le \frac{E[Y]}{a^2} = \frac{\sigma^2}{a^2} .

Taking a=kσa = k\sigma gives σ2/(kσ)2=1/k2\sigma^2/(k\sigma)^2 = 1/k^2.

Example 6.3(How loose is the Chebyshev bound?)

For k=2k = 2, Corollary 6.2 gives P(∣X−μ∣≥2σ)≤0.25P(|X-\mu| \ge 2\sigma) \le 0.25. Let us compare with the true values for concrete distributions.

  • X∼N(μ,σ2)X \sim N(\mu,\sigma^2): P(∣X−μ∣≥2σ)=2(1−Φ(2))≈0.0455P(|X-\mu| \ge 2\sigma) = 2\bigl(1 - \Phi(2)\bigr) \approx 0.0455.
  • X∼Exp(1)X \sim \mathrm{Exp}(1) (so μ=σ=1\mu = \sigma = 1): P(∣X−1∣≥2)=P(X≥3)=e−3≈0.0498P(|X - 1| \ge 2) = P(X \ge 3) = e^{-3} \approx 0.0498.

Both are about one fifth of the bound 0.250.25. If the distribution is known, far sharper estimates are available.

Chebyshev’s inequality is nonetheless important because it assumes nothing about the distribution. It applies where no distributional form can be posited: unknown populations, the outputs of complicated machine-learning models. Moreover the bound 1/k21/k^2 cannot be improved if one demands validity across all distributions, because there are distributions attaining equality (Exercise 7.3).

Example 6.4(Application to the weak law of large numbers)

Let X1,X2,…X_1, X_2, \ldots be independent and identically distributed with E[Xi]=μE[X_i] = \mu and Var(Xi)=σ2<∞\mathrm{Var}(X_i) = \sigma^2 < \infty, and put Xˉn:=1n∑i=1nXi\bar{X}_n := \frac{1}{n}\sum_{i=1}^n X_i. Linearity of the expectation gives E[Xˉn]=μE[\bar{X}_n] = \mu. Using parts 2 and 4 of Proposition 5.3 together with the vanishing of the covariance terms under independence (Proposition 7.5),

Var(Xˉn)=1n2∑i=1nVar(Xi)=σ2n.\mathrm{Var}(\bar{X}_n) = \frac{1}{n^2}\sum_{i=1}^{n}\mathrm{Var}(X_i) = \frac{\sigma^2}{n} .

Applying Corollary 6.2 to Xˉn\bar{X}_n, for every ε>0\varepsilon > 0,

P(∣Xˉn−μ∣≥ε)≤σ2nε2→n→∞0.P\bigl(|\bar{X}_n - \mu| \ge \varepsilon\bigr) \le \frac{\sigma^2}{n\varepsilon^2} \xrightarrow[n\to\infty]{} 0 .

This is the weak law of large numbers (the law of large numbers in the sense of convergence in probability). Versions dispensing with the variance assumption, and the strong law asserting almost sure convergence (the strong law of large numbers (Kolmogorov)(Theorem 4.5)[The Law of Large Numbers and the Central Limit Theorem]), are treated in The law of large numbers and the central limit theorem.

This estimate can be used directly to design a sample size. With σ=1\sigma = 1 and ε=0.1\varepsilon = 0.1, to keep the error probability at most 5%5\% it suffices to take n≥1/(0.05×0.01)=2000n \ge 1/(0.05 \times 0.01) = 2000. The central limit theorem shows that n≈385n \approx 385 is already enough, but that is an approximation valid for large nn, whereas the Chebyshev estimate is an inequality that is exactly correct for every nn.

Exercise 7.1Standard

Suppose X:Ω→RX : \Omega \to \mathbb{R} satisfies {X<q}∈F\{X < q\} \in \mathcal{F} for every rational qq. Show that XX is a random variable.

Solution

Apply Proposition 3.2 with E:={(−∞,q):q∈Q}\mathcal{E} := \{(-\infty, q) : q \in \mathbb{Q}\}. We must show σ(E)=B(R)\sigma(\mathcal{E}) = \mathcal{B}(\mathbb{R}).

First, σ(E)⊂B(R)\sigma(\mathcal{E}) \subset \mathcal{B}(\mathbb{R}) because each (−∞,q)(-\infty,q) is open.

For the converse, let aa be any real number. By density of the rationals there is a rational sequence qn↑aq_n \uparrow a, and

(−∞,a)=⋃n=1∞(−∞,qn)(-\infty, a) = \bigcup_{n=1}^{\infty} (-\infty, q_n)

(if x<ax < a then x<qnx < q_n for all large nn). Hence (−∞,a)∈σ(E)(-\infty,a) \in \sigma(\mathcal{E}).

Next, (−∞,a](-\infty, a] also lies in σ(E)\sigma(\mathcal{E}), since

(−∞,a]=⋂n=1∞(−∞, a+1n)(-\infty, a] = \bigcap_{n=1}^{\infty}\Bigl(-\infty,\ a + \tfrac{1}{n}\Bigr)

(if x≤ax \le a then x<a+1/nx < a + 1/n for every nn; conversely if x<a+1/nx < a+1/n for every nn then letting n→∞n\to\infty gives x≤ax \le a), and each set on the right lies in σ(E)\sigma(\mathcal{E}) by the previous step. Therefore, for any open interval,

(a,b)=(−∞,b)∖(−∞,a]∈σ(E).(a,b) = (-\infty,b) \setminus (-\infty,a] \in \sigma(\mathcal{E}) .

Every open subset of R\mathbb{R} is a countable union of open intervals (take intervals with rational endpoints around each point), so all open sets lie in σ(E)\sigma(\mathcal{E}), and hence B(R)⊂σ(E)\mathcal{B}(\mathbb{R}) \subset \sigma(\mathcal{E}).

This proves σ(E)=B(R)\sigma(\mathcal{E}) = \mathcal{B}(\mathbb{R}), and Proposition 3.2 shows that XX is a random variable. The point is that countably many conditions already imply measurability.

Exercise 7.2Standard

Let 0<p<10 < p < 1 and q:=1−pq := 1-p, and let XX have the geometric distribution, that is,

P(X=k)=qk−1p(k=1,2,3,…).P(X = k) = q^{k-1} p \qquad (k = 1, 2, 3, \ldots).

Compute E[X]E[X] and Var(X)\mathrm{Var}(X).

Solution

First we check that this is a probability mass function: ∑k≥1qk−1p=p⋅11−q=pp=1\sum_{k\ge1} q^{k-1}p = p \cdot \frac{1}{1-q} = \frac{p}{p} = 1, the geometric series converging because 0<q<10 < q < 1.

For ∣x∣<1|x| < 1, differentiating ∑k≥0xk=11−x\sum_{k \ge 0} x^k = \frac{1}{1-x} termwise gives ∑k≥1kxk−1=1(1−x)2\sum_{k\ge1} k x^{k-1} = \frac{1}{(1-x)^2}, and differentiating once more gives ∑k≥2k(k−1)xk−2=2(1−x)3\sum_{k \ge 2} k(k-1)x^{k-2} = \frac{2}{(1-x)^3} (a power series may be differentiated termwise inside its radius of convergence).

By part 1 of Corollary 4.6,

E[X]=∑k=1∞k qk−1p=p⋅1(1−q)2=pp2=1p.E[X] = \sum_{k=1}^{\infty} k\, q^{k-1} p = p \cdot \frac{1}{(1-q)^2} = \frac{p}{p^2} = \frac{1}{p}.

Next, for g(x)=x(x−1)g(x) = x(x-1),

E[X(X−1)]=∑k=2∞k(k−1)qk−1p=pq∑k=2∞k(k−1)qk−2=pq⋅2p3=2qp2.E[X(X-1)] = \sum_{k=2}^{\infty} k(k-1) q^{k-1} p = pq\sum_{k=2}^{\infty}k(k-1)q^{k-2} = pq \cdot \frac{2}{p^3} = \frac{2q}{p^2}.

Hence E[X2]=2qp2+1pE[X^2] = \frac{2q}{p^2} + \frac{1}{p}, and part 1 of Proposition 5.3 gives

Var(X)=2qp2+1p−1p2=2q+p−1p2=2q−qp2=qp2=1−pp2,\mathrm{Var}(X) = \frac{2q}{p^2} + \frac{1}{p} - \frac{1}{p^2} = \frac{2q + p - 1}{p^2} = \frac{2q - q}{p^2} = \frac{q}{p^2} = \frac{1-p}{p^2},

where we used p−1=−qp - 1 = -q. For example, with p=1/6p = 1/6 (the number of rolls until a die first shows a 11) we get E[X]=6E[X] = 6 and Var(X)=30\mathrm{Var}(X) = 30.

Exercise 7.3Standard

Fix k>1k > 1 and σ>0\sigma > 0. Construct a random variable XX with E[X]=0E[X] = 0, Var(X)=σ2\mathrm{Var}(X) = \sigma^2 and

P(∣X∣≥kσ)=1k2,P\bigl(|X| \ge k\sigma\bigr) = \frac{1}{k^2} ,

thereby showing that the bound 1/k21/k^2 in Corollary 6.2 cannot be improved.

Solution

Take the following three-point distribution.

P(X=kσ)=P(X=−kσ)=12k2,P(X=0)=1−1k2.P(X = k\sigma) = P(X = -k\sigma) = \frac{1}{2k^2}, \qquad P(X = 0) = 1 - \frac{1}{k^2}.

Since k>1k > 1 we have 1−1/k2>01 - 1/k^2 > 0, and the probabilities sum to 12k2+12k2+1−1k2=1\frac{1}{2k^2} + \frac{1}{2k^2} + 1 - \frac{1}{k^2} = 1.

By part 1 of Corollary 4.6,

E[X]=kσ⋅12k2+(−kσ)⋅12k2+0=0,E[X] = k\sigma \cdot \frac{1}{2k^2} + (-k\sigma)\cdot\frac{1}{2k^2} + 0 = 0,E[X2]=(kσ)2⋅12k2+(kσ)2⋅12k2+0=k2σ2⋅1k2=σ2.E[X^2] = (k\sigma)^2 \cdot \frac{1}{2k^2} + (k\sigma)^2\cdot\frac{1}{2k^2} + 0 = k^2\sigma^2 \cdot \frac{1}{k^2} = \sigma^2 .

Hence part 1 of Proposition 5.3 gives Var(X)=σ2−02=σ2\mathrm{Var}(X) = \sigma^2 - 0^2 = \sigma^2.

On the other hand ∣X∣≥kσ|X| \ge k\sigma holds exactly when X=±kσX = \pm k\sigma, so

P(∣X∣≥kσ)=12k2+12k2=1k2,P(|X| \ge k\sigma) = \frac{1}{2k^2} + \frac{1}{2k^2} = \frac{1}{k^2} ,

and Chebyshev’s inequality holds with equality. Therefore, among bounds of the form P(∣X−μ∣≥kσ)≤c/k2P(|X-\mu| \ge k\sigma) \le c/k^2 valid for all L2L^2 random variables, one cannot take cc smaller than 11. Note that the example above is symmetric about the origin, so imposing symmetry alone does not improve the bound; extra assumptions such as unimodality or boundedness are needed.

Exercise 7.4Hard

Let XX be a random variable with P(X≥0)=1P(X \ge 0) = 1. Show that

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

holds as an identity in [0,∞][0,\infty], the right-hand side being a Lebesgue integral.

Solution

On the product space (Ω×(0,∞), F⊗B((0,∞)), P⊗Leb)\bigl(\Omega \times (0,\infty),\ \mathcal{F}\otimes\mathcal{B}((0,\infty)),\ P \otimes \mathrm{Leb}\bigr) consider the function

H(ω,t):=1{X(ω)>t}.H(\omega, t) := \mathbf{1}_{\{X(\omega) > t\}} .

Measurability. The map (ω,t)↦X(ω)(\omega,t) \mapsto X(\omega) is the composition of the projection onto the first coordinate with XX, hence measurable with respect to the product σ\sigma-algebra; the same holds for (ω,t)↦t(\omega,t)\mapsto t. By the result on sums (differences) in Proposition 3.4, the map (ω,t)↦X(ω)−t(\omega,t)\mapsto X(\omega) - t is measurable, and

{(ω,t):H=1}={(ω,t):X(ω)−t>0}\{(\omega,t) : H = 1\} = \{(\omega,t) : X(\omega) - t > 0\}

is the preimage of (0,∞)(0,\infty) under that measurable function, hence a measurable set. Thus HH is nonnegative and measurable.

Applying Tonelli’s theorem. Since PP is a probability measure and Lebesgue measure on (0,∞)(0,\infty) is σ\sigma-finite, Tonelli’s theorem for nonnegative measurable functions (The Lebesgue integral and the convergence theorems) says that the two iterated integrals agree.

Integrating in tt first, with ω\omega fixed,

∫0∞1{X(ω)>t} dt=∫0X(ω)1 dt=X(ω)\int_0^{\infty} \mathbf{1}_{\{X(\omega) > t\}}\, dt = \int_0^{X(\omega)} 1 \, dt = X(\omega)

(since X(ω)≥0X(\omega) \ge 0, the integrand in tt is the indicator of the interval (0,X(ω))(0, X(\omega))). So this iterated integral equals E[X]E[X].

Integrating in ω\omega first, with t>0t > 0 fixed,

∫Ω1{X>t} dP=P(X>t),\int_{\Omega} \mathbf{1}_{\{X > t\}} \, dP = P(X > t),

so this iterated integral is ∫0∞P(X>t) dt\int_0^\infty P(X>t)\,dt.

By Tonelli’s theorem the two are equal in [0,∞][0,\infty], which proves the claim.

Check. For X∼Exp(λ)X \sim \mathrm{Exp}(\lambda) we have P(X>t)=e−λtP(X > t) = e^{-\lambda t}, so ∫0∞e−λtdt=1/λ\int_0^\infty e^{-\lambda t}dt = 1/\lambda, agreeing with the result of Example 4.7. The formula is especially useful when the density is unknown and only the survival probability P(X>t)P(X>t) is available, as in reliability engineering and survival analysis.

  • A. N. Kolmogorov, Grundbegriffe der Wahrscheinlichkeitsrechnung, Springer, 1933 (English translation: Foundations of the Theory of Probability, Chelsea, 1956) — the original source defining random variables as measurable functions. Chapter III.
  • Kiyosi Ito, Kakuritsuron (Probability Theory), Iwanami Shoten (Iwanami Foundations of Mathematics), 1991 (in Japanese) — Chapters 1 and 2. A standard Japanese reference on measure-theoretic probability.
  • Naohisa Funaki, Kakuritsuron (Probability Theory), Asakura Shoten (Ways of Mathematical Thinking 20), 2004 (in Japanese) — Chapter 2 organises random variables, expectation and the various inequalities.
  • P. Billingsley, Probability and Measure, 3rd ed., Wiley, 1995 — Sections 13, 15, 21. A careful treatment of the construction of the expectation and of the transfer formula.
  • R. Durrett, Probability: Theory and Examples, 5th ed., Cambridge University Press, 2019 — Chapter 1. Concise, with a wealth of exercises.
  • D. Williams, Probability with Martingales, Cambridge University Press, 1991 — Chapters 3–6. Makes the “standard machine” (from indicators to the general case) explicit as a method.

Appendix: independence and products of expectations

Section titled “Appendix: independence and products of expectations”

Here we prove the fact used in Example 5.4 and Example 6.4 in the main text, namely that independence implies uncorrelatedness.

Proposition 7.5(Expectation of a product of independent integrable random variables)

Let X,YX, Y be independent random variables, both integrable. Then XYXY is integrable and

E[XY]=E[X] E[Y].E[XY] = E[X]\,E[Y] .

In particular, if X,Y∈L2X, Y \in L^2 are independent then Cov(X,Y)=0\mathrm{Cov}(X,Y) = 0.

Proof(Proposition 7.5)

Write P(X,Y)P_{(X,Y)} for the joint distribution of (X,Y)(X,Y) on R2\mathbb{R}^2. Definition 2.3 says that

P(X,Y)(B×C)=PX(B) PY(C)P_{(X,Y)}(B \times C) = P_X(B)\,P_Y(C)

for all Borel sets B,CB, C. The rectangles {B×C}\{B\times C\} form a multiplicative family (closed under finite intersections) generating B(R2)\mathcal{B}(\mathbb{R}^2), and both sides are probability measures on R2\mathbb{R}^2, so Dynkin’s π\pi-λ\lambda theorem gives P(X,Y)=PX⊗PYP_{(X,Y)} = P_X \otimes P_Y (the product measure) everywhere.

Suppose first that X,Y≥0X, Y \ge 0. Apply the two-dimensional version of Theorem 4.5 (with g(x,y)=xyg(x,y) = xy, regarding (X,Y)(X,Y) as an R2\mathbb{R}^2-valued measurable map; the proof is the same standard machine as in the main text), and then Tonelli’s theorem for the product measure PX⊗PYP_X\otimes P_Y:

E[XY]=∫R2xy P(X,Y)(dx dy)=∫R ⁣ ⁣∫Rxy PX(dx)PY(dy)=(∫x PX(dx))(∫y PY(dy)),E[XY] = \int_{\mathbb{R}^2} xy \, P_{(X,Y)}(dx\,dy) = \int_{\mathbb{R}}\!\!\int_{\mathbb{R}} xy \, P_X(dx) P_Y(dy) = \Bigl(\int x\,P_X(dx)\Bigr)\Bigl(\int y \, P_Y(dy)\Bigr) ,

and by Theorem 4.5 again the right-hand side is E[X]E[Y]E[X]E[Y].

In the general case decompose X=X+−X−X = X^{+} - X^{-} and Y=Y+−Y−Y = Y^{+} - Y^{-}. Since X±X^{\pm} is a Borel measurable function of XX and Y±Y^{\pm} is a Borel measurable function of YY, and Borel measurable functions of independent random variables are again independent (because the events have the form {X+∈B}={X∈(⋅)−1(B)}\{X^{+} \in B\} = \{X \in (\cdot)^{-1}(B)\}), the nonnegative case applies to all four products X±Y±X^{\pm}Y^{\pm}. Integrability follows from E[∣XY∣]=E[∣X∣]E[∣Y∣]<∞E[|XY|] = E[|X|]E[|Y|] < \infty, and the identity from

E[XY]=E[X+Y+]−E[X+Y−]−E[X−Y+]+E[X−Y−]=(E[X+]−E[X−])(E[Y+]−E[Y−]).E[XY] = E[X^{+}Y^{+}] - E[X^{+}Y^{-}] - E[X^{-}Y^{+}] + E[X^{-}Y^{-}] = \bigl(E[X^+]-E[X^-]\bigr)\bigl(E[Y^+]-E[Y^-]\bigr) .

Finally, part 1 of Proposition 5.3 gives Cov(X,Y)=E[XY]−E[X]E[Y]=0\mathrm{Cov}(X,Y) = E[XY] - E[X]E[Y] = 0.

The converse fails: Example 5.5 is a counterexample.

Remark 7.6

The space L2L^2 is a Hilbert space under the inner product ⟨X,Y⟩:=E[XY]\langle X, Y\rangle := E[XY]; the variance is the squared norm ∥X−μX∥2\|X - \mu_X\|^2 of the centred variable, the covariance is the corresponding inner product, and the correlation coefficient is the cosine of the angle between them. This is why Theorem 5.6 is nothing but the Cauchy–Schwarz inequality in a Hilbert space. The viewpoint becomes essential when the conditional expectation is understood as an “orthogonal projection onto a subspace”. For L2L^2 as a Hilbert space see L² is a Hilbert space(Theorem 6.2)[L^p 空間と関数解析への導入] in L^p spaces and an introduction to functional analysis.

not audited

Report an error in this article ・Operated by: Mugen Giken LLC ・Pricing ・Terms ・Legal notice

© 2026 夢現技研合同会社 ・Code samples are MIT licensed.