Expectation, variance, and moments
A probability distribution can list many values, and for most purposes a reader wants it reduced to a few numbers, as a data set is reduced to its average [1]. This article covers the two that Grinstead and Snell start with, mean and variance. It works through the discrete case [1] and then the continuous one [21]. It closes with the moments of chapter 10, of which the first two already give the mean and the variance [12]. The named families (normal, exponential and the rest) are described in Probability distributions: the essential families and The normal distribution and the bell curve. Their means and variances are worked out here.
Expected value
The idea, on a game of our own. An urn holds ten tickets: one pays 5 dollars, two pay 2 dollars, and seven pay nothing. A draw is made and the ticket put back. Over many draws each kind of ticket turns up in about its share of the draws (a tenth, two tenths, seven tenths), so the payout per draw should settle near 5·(1/10) + 2·(2/10) + 0·(7/10) = 0.9 dollars. The rule is the one the book arrives at with its own game: weight each possible value by its probability and add [1].
Definition. If X is discrete, with m(x) = P(X = x), its expected value is defined as
E(X) = Σₓ x·m(x),
“provided this sum converges absolutely” [2]. The book adds: “We often refer to the expected value as the mean, and denote E(X) by μ for short. If the above sum does not converge absolutely, then we say that X does not have an expected value” [2]. For the urn payout above, E(X) = 0.9.
Waiting for a first success. If each trial succeeds with probability p, independently, and T is the trial that brings the first success, T has mean 1/p; the book gets this by differentiating the geometric series [4]. Our case: waiting for a paying ticket from the urn (p = 3/10) takes 10/3 draws on average.
When the sum diverges. The St. Petersburg game pays 2ⁿ dollars if a fair coin first shows heads on toss n. Each term of the sum for E(Y) is 2ⁿ·(1/2ⁿ) = 1, so the sum diverges and the payment Y has no expected value. An infinite expectation would justify any entry fee, but, as the book puts it, “It is unlikely that the reader’s answer is more than 10 dollars; therein lies the paradox” [3]. It reports two early answers [3]:
| Change to the game | Effect | Proposed by |
|---|---|---|
| the world’s money is finite, so the payment stops growing at some toss n | the expected payment is finite | G. Cramer |
| a payment is valued through a utility function of it, such as √ or log | the expected utility is finite | Daniel Bernoulli and Cramer |
An average is an expected value. Take the data 3, 3, 5, 9, with average 5. If X is one entry chosen at random, X is 3 with probability 1/2 and 5 or 9 with probability 1/4 each, and E(X) = 3/2 + 5/4 + 9/4 = 5, the average again [5]. The reverse reading needs a theorem: the book promises to prove “that the average will usually be close to E(X) if we repeat the experiment a large number of times”, which is the law of large numbers [5].
A function of X. For a function φ, E(φ(X)) = Σₓ φ(x)·m(x), when Σ |φ(x)|·m(x) is finite [6]. The distribution of φ(X) is never needed. For the urn payout, E(X²) = 25·(1/10) + 4·(2/10) + 0·(7/10) = 3.3, read straight off the distribution of X. The proof only regroups the terms of the sum by the value of φ [6].
Expectation is linear, whether or not the variables are independent
The rule. For random variables X and Y with finite expected values and any constant c, E(X + Y) equals E(X) + E(Y), and E(cX) equals c·E(X) [7]. Induction extends the first rule to any finite sum [8]. Nothing in it asks for independence; the book’s words are that independence “was not needed as a hypothesis”, and the fact “is sometimes referred to as the First Fundamental Mystery of Probability” [8].
Why it is used so much. Many counts break into indicators, variables equal to 1 when something happens and 0 otherwise; adding their probabilities then gives the expected count. The book calls this way of computing “frequently very useful” [8]. Our example: drop three balls at random into three boxes and count the empty boxes. Each box is empty with probability (2/3)³ = 8/27, so the expected number of empty boxes is 3·8/27 = 8/9. The indicators are dependent (all three boxes cannot be empty at once), and the sum rule holds anyway.
| Count | Written as | Expected value | Source |
|---|---|---|---|
| successes Sₙ in n Bernoulli trials | n indicators, each with mean p | np | [9] |
| a Poisson variable, parameter λ (the limit of binomials with np = λ) | λ, left to the reader as an exercise | [9] |
Products need more. For independent X and Y, E(XY) equals E(X)E(Y) [9]. Without independence this can fail [10]. Our case: let X be 1 if a fair coin shows heads and 0 otherwise, and take Y = X. Then X·Y = X² = X, so E(XY) = 1/2, but the product of the means is 1/4.
Splitting by cases. The conditional expectation of X given an event F is E(X|F) = Σⱼ xⱼ·P(X = xⱼ|F). If the events F₁, …, Fᵣ are disjoint and together cover the sample space, then E(X) = Σⱼ E(X|Fⱼ)P(Fⱼ) [11]. Our example: pick one of two coins at random, a fair one or one that shows heads a quarter of the time, and toss it until heads. Given the coin, the wait is geometric, with means 2 and 4, so E(T) = (2 + 4)/2 = 3. The book applies the same split to the length of a craps game, counted in rolls [11].
Variance and standard deviation
Two games can have the same expected value and very different spreads: a sure 0.9 dollars, and a draw from the urn above. The variance measures that spread as an average squared distance from the mean [13].
Definition. With μ = E(X), the variance is V(X) = E((X − μ)²) = Σₓ (x − μ)²·m(x). The standard deviation is D(X) = √V(X), commonly written σ, so that σ² stands for V(X) [13].
The urn again. The book’s shortcut V(X) = E(X²) − μ² [14] needs only the E(X²) = 3.3 found above: V(X) = 3.3 − 0.9² = 2.49, so σ ≈ 1.58 dollars, against 0 for the sure 0.9 dollars.
Rules. Unlike the expected value, the variance is not linear:
| Change | Variance | Source |
|---|---|---|
| X → cX | c²·V(X) | [15] |
| X → X + c | V(X), unchanged | [15] |
| X + Y, X and Y independent | V(X) + V(Y) | [15] |
The independent case works because the expansion of V(X + Y) contains the term 2E(XY), and independence turns it into 2E(X)E(Y), which cancels [15]. Without independence the sum rule can fail; take Y = X: V(X + X) = V(2X) = 4V(X), not 2V(X).
Sums and averages. For an independent trials process X₁, …, Xₙ with mean μ and variance σ², write Sₙ for the sum and Aₙ = Sₙ/n for the average [16]:
| mean | variance | standard deviation | |
|---|---|---|---|
| Sₙ | nμ | nσ² | σ√n |
| Aₙ | μ | σ²/n | σ/√n |
The book’s reading of the Aₙ row is that “for large n, we can expect the average to be very near the expected value”, a claim chapter 8 makes exact (the law of large numbers) [17].
Bernoulli trials. With q = 1 − p [18]:
| mean | variance | standard deviation | |
|---|---|---|---|
| one indicator Xⱼ | p | p − p² = pq | √(pq) |
| successes Sₙ | np | npq | √(npq) |
| proportion Aₙ | p | pq/n | √(pq/n) |
The variance of the proportion, pq/n, goes to 0; in the book’s words, “This suggests that the frequency interpretation of probability is a correct one” [18]. The waiting time T for the first success has E(T²) = (1 + q)/p², so V(T) = q/p² [19]. With p = 1/4 that is 12; with p = 1/10 it is 90. In the book’s words, “as p decreases, the variance increases rapidly” [19]. The Poisson variance λ is left to the reader as Exercise 29, with the hint that in the binomial limit “npq = λq approaches λ, since q goes to 1” [20].
Continuous random variables
For a variable with a density, integrals replace sums, and the properties above carry over [21].
| Quantity | Formula, density f | Condition | Source |
|---|---|---|---|
| mean | μ = E(X) = ∫ x·f(x) dx | ∫ |x|·f(x) dx finite | [21] |
| sums and multiples | E(X + Y) equals E(X) + E(Y); E(cX) equals cE(X) | [22] | |
| a function of X | E(φ(X)) = ∫ φ(x)·f(x) dx, φ continuous | the integral exists | [23] |
| products | E(XY) equals E(X)E(Y) | X, Y independent, finite expected values | [23] |
| variance | σ² = V(X) = ∫ (x − μ)² f(x) dx = E(X²) − μ² | [24] |
For the product rule the book gives a proof only for bounded variables, in its words “the case that the ranges of X and Y are contained in the intervals [a, b] and [c, d], respectively”, and omits the general case [23]. Scaling and additivity for independent variables hold as in the discrete case [24].
| density | E(X) | V(X) | source |
|---|---|---|---|
| uniform on [0, 1] | 1/2 | 1/12 | [22], [24] |
| exponential, parameter λ > 0 | 1/λ | 1/λ² | [25] |
| normal, parameters μ, σ | μ | σ² | [26] |
With these rules the table extends without new integrals. Our example: if U is uniform on [0, 1], then 2U is uniform on [0, 2], with mean 2·(1/2) = 1 and variance 4·(1/12) = 1/3.
The exponential row is computed by integration by parts [25]. For the normal row, start from the standard normal Z [26]:
- its mean is 0, since the density is symmetric about 0, after checking that ∫ |x| f(x) dx is finite;
- its variance is 1: after integrating x·x f(x) by parts, the first summand “can be shown to equal 0”, and “The second summand is just the standard normal density integrated over its domain”;
- a normal X with parameters μ and σ is σZ + μ, so the scaling rules give E(X) = μ and V(X) = σ².
This is the computation that The normal distribution and the bell curve and the distributions article refer to.
No mean at all. Some densities have no variance, and the book warns that they “behave quite differently in a number of important respects” [27]. The Cauchy density f(x) = (a/π)·1/(a² + x²) lacks even a mean: ∫ |x| f(x) dx diverges [27].
Independent trials. The table for Sₙ and Aₙ above holds unchanged when the Xᵢ have densities: the sum has mean nμ and variance nσ², the average mean μ and variance σ²/n [28].
Moments
For k = 1, 2, 3, …, X has the moment μₖ = E(Xᵏ) = Σⱼ (xⱼ)ᵏ p(xⱼ), provided the sum converges [12]. The mean is μ₁ and the variance is μ₂ − μ₁². Mean and variance alone do not fix a distribution [12]. Our example: let X be −1 or 1 with probability 1/2 each, and let Y be −2 or 2 with probability 1/8 each and 0 with probability 3/4.
| μ₁ | μ₂ | μ₃ | μ₄ | |
|---|---|---|---|---|
| X | 0 | 1 | 0 | 1 |
| Y | 0 | 1 | 0 | 4 |
The first three moments agree and the fourth separates them. For a variable with finite range, the book’s answer is that “a knowledge of the first two moments of X gives us its mean and variance. But a knowledge of all the moments of X determines its distribution function p completely” [12]. The generating function that packages the moments, and the proof for finite ranges, are the rest of that chapter and not covered here.
Where the idea came from
The book’s historical remarks note: “The concept of expected value was used before it was formally defined; and when it was used, it was considered not as an average value but rather as the appropriate value for a gamble” [29].
| Pascal | Huygens | |
|---|---|---|
| Problem | a stake of 64 pistoles; the series is called off when one player is a game ahead | the value of an equal chance at a or b |
| Key step, quoted | Pascal “reduced the problem to a symmetric bet” | the value is found “by assuming that the answer is obvious for certain symmetric situations” |
| Result | 48 to the leader, 16 to the other | (a + b)/2 (his Proposition I) |
| Source | [29] | [30] |
In the passage the book quotes, Pascal has the leader say: “I am certain to get 32 pistoles, even if I lose I still get them” [29]. Huygens proves Proposition I with a two-player game whose winner must hand the loser b [30]. His Proposition II, for three equally likely values a, b and c, gives (a + b + c)/3 [30].
Not covered here
The law of large numbers that makes the average interpretation rigorous (the source’s chapter 8), the Chebyshev inequality, the central limit theorem (chapter 9), covariance and correlation, the queueing example of section 6.3, and the moment generating function and its uniqueness theorem (chapter 10). Any claim about how expectation is used in statistics, finance or machine learning is not in these pages and is not made.
Sources
- [1]Grinstead, C. M. and Snell, J. L., Introduction to Probability, §6.1, pp. 225–226 (descriptive quantities; the dice game, Table 6.1, −.57 and −.4949). View at source ↗
- [2]Same, §6.1, pp. 226–227 (Definition 6.1; Examples 6.1 and 6.2). View at source ↗
- [3]Same, §6.1, p. 227 (Example 6.3, the St. Petersburg Paradox; Cramer; Bernoulli and utility). View at source ↗
- [4]Same, §6.1, p. 228 (Example 6.4, E(T) = 1/p). View at source ↗
- [5]Same, §6.1, pp. 228–229 (Interpretation of Expected Value; Example 6.5; the law of large numbers named on p. 229). View at source ↗
- [6]Same, §6.1, p. 230 (Theorem 6.1). View at source ↗
- [7]Same, §6.1, p. 231 (Theorem 6.2 and its proof). View at source ↗
- [8]Same, §6.1, p. 232 (induction to finite sums; “First Fundamental Mystery of Probability”; Example 6.8, fixed points). View at source ↗
- [9]Same, §6.1, p. 233 (Theorem 6.3, E(Sₙ) = np; Poisson expectation; Theorem 6.4). View at source ↗
- [10]Same, §6.1, p. 234 (Examples 6.9 and 6.10). View at source ↗
- [11]Same, §6.1, pp. 239–240 (Definition 6.2, Theorem 6.5; Example 6.14, craps, 557/165). View at source ↗
- [12]Same, §10.1, pp. 365–366 (two distributions with equal mean and variance; definition of the kth moment; μ = μ₁, σ² = μ₂ − μ₁²; all moments determine p). View at source ↗
- [13]Same, §6.2, pp. 257–258 (Definition 6.3, equation (6.1); standard deviation). View at source ↗
- [14]Same, §6.2, p. 258 (Theorem 6.6; E(X²) = 91/6). View at source ↗
- [15]Same, §6.2, p. 259 (Properties of Variance; Theorems 6.7 and 6.8; the Y = −X example). View at source ↗
- [16]Same, §6.2, p. 260 (Theorem 6.9). View at source ↗
- [17]Same, §6.2, p. 261 (Example 6.18, n rolls of a die). View at source ↗
- [18]Same, §6.2, pp. 261–262 (Bernoulli trials: pq, npq, pq/n; frequency interpretation). View at source ↗
- [19]Same, §6.2, p. 262 (Example 6.19, V(T) = q/p²; “as p decreases, the variance increases rapidly”). View at source ↗
- [20]Same, §6.2, p. 263 (Poisson variance λ, left as Exercise 29). View at source ↗
- [21]Same, §6.3, p. 268 (Definition 6.4). View at source ↗
- [22]Same, §6.3, p. 269 (Theorem 6.10; Example 6.20). View at source ↗
- [23]Same, §6.3, p. 270 (Theorems 6.11 and 6.12). View at source ↗
- [24]Same, §6.3, pp. 271–272 (Definition 6.5; Theorems 6.13–6.16; Example 6.25, 1/12). View at source ↗
- [25]Same, §6.3, p. 273 (Example 6.26, exponential: 1/λ and 1/λ²). View at source ↗
- [26]Same, §6.3, pp. 273–274 (Example 6.27, standard normal 0 and 1; X = σZ + μ). View at source ↗
- [27]Same, §6.3, p. 274 (Example 6.28, Cauchy). View at source ↗
- [28]Same, §6.3, p. 275 (Corollary 6.1). View at source ↗
- [29]Same, §6.1, pp. 242–243 (Historical Remarks; Pascal’s division, 48 and 16). View at source ↗
- [30]Same, §6.1, pp. 243–244 (Huygens’ Propositions I and II and their proofs; 2 or 8 worth 5). View at source ↗
Wikipedia was not used as a source.
Works cited
- Charles M. Grinstead and J. Laurie Snell, Introduction to Probability, 2nd revised edition, version dated 4 July 2006 (Dartmouth CHANCE Project). math.dartmouth.edu/~prob/prob/prob.pdf. License: GNU Free Documentation License.