The mathematical expectation (or expected value, mean) of a random variable \(X\) is the long-run average value of \(X\) over many repetitions of the experiment.
Provided the sum / integral converges absolutely.
\(X\) has PMF \(p(0)=0.2,\; p(1)=0.5,\; p(2)=0.3\).
\(E(X) = 0(0.2) + 1(0.5) + 2(0.3) = 1.1\).
\(E(X^2) = 0 + 1(0.5) + 4(0.3) = 1.7\).
For \(f(x) = 2x,\; 0 \le x \le 1\):
\(E(X) = \int_0^1 x \cdot 2x \,dx = 2/3\).
\(E(X^2) = \int_0^1 x^2 \cdot 2x\,dx = 1/2\).
Variance = \(1/2 - (2/3)^2 = 1/2 - 4/9 = 1/18\).
The conditional expectation of \(Y\) given \(X = x\) is the mean of the conditional distribution:
Regarded as a function of the random variable \(X\), \(E(Y\mid X)\) is itself a random variable. Two fundamental identities follow:
The second (the "law of total variance") splits total variability into the average within-group variance plus the variance of the group means — the same idea that underlies ANOVA.
Joint pmf of \((X,Y)\): \(P(0,0)=0.10\), \(P(0,1)=0.20\), \(P(0,2)=0.10\), \(P(1,0)=0.20\), \(P(1,1)=0.30\), \(P(1,2)=0.10\). Then \(P(X=0)=0.4,\ P(X=1)=0.6\), and
\(E(Y\mid X=0) = (0\cdot0.10 + 1\cdot0.20 + 2\cdot0.10)/0.4 = 1.0\); \(E(Y\mid X=1) = (0\cdot0.20 + 1\cdot0.30 + 2\cdot0.10)/0.6 = 0.833\).
Check the tower property: \(E[E(Y\mid X)] = 0.4(1.0) + 0.6(0.833) = 0.90 = E(Y)\). ✓
The sum \(\sum x\,p(x)\) or the integral \(\int x f(x)\,dx\) defines \(E(X)\) only when it converges absolutely, that is, when
\[ \sum_x |x|\,p(x) < \infty \qquad\text{or}\qquad \int_{-\infty}^{\infty} |x|\,f(x)\,dx < \infty . \]The reason is that an expectation must not depend on the order in which the values are listed. A series that converges but not absolutely can be rearranged to give any total at all (Riemann's rearrangement theorem), so it cannot define a mean.
An example with no mean. \(f(x) = 1/x^2\) for \(x \ge 1\) is a density, since \(\int_1^\infty x^{-2}\,dx = \big[-x^{-1}\big]_1^\infty = 1\). But
\[ \int_1^\infty x \cdot \frac{1}{x^2}\,dx = \int_1^\infty \frac{dx}{x} = \big[\ln x\big]_1^\infty = \infty , \]so \(E(X)\) does not exist. A distribution can be perfectly proper and still have no mean.
Choosing \(g\) in \(E[g(X)]\) gives every average used in this course:
The expectation of a constant. If \(X = C\) with probability 1, then \(E(C) = C \cdot 1 = C\); in the continuous form, \(E(C) = \int C f(x)\,dx = C\int f(x)\,dx = C\).
The variance, skewness and kurtosis are special moments:
Write \(\mu = \mu_1' = E(X)\). Expand the square, then use the linearity of expectation (\(\mu\) is a constant):
\[ \begin{aligned} \mu_2 = E(X - \mu)^2 &= E\big(X^2 - 2\mu X + \mu^2\big) \\ &= E(X^2) - 2\mu\,E(X) + \mu^2 \\ &= \mu_2' - 2\mu_1'\mu_1' + \mu_1'^{\,2} = \mu_2' - \mu_1'^{\,2} . \end{aligned} \]The same steps with \((X - \mu)^3\) and \((X - \mu)^4\), expanded by the binomial theorem, give
\[ \mu_3 = \mu_3' - 3\mu_2'\mu_1' + 2\mu_1'^{\,3}, \] \[ \mu_4 = \mu_4' - 4\mu_3'\mu_1' + 6\mu_2'\mu_1'^{\,2} - 3\mu_1'^{\,4} . \]For \(\mu_3\): \(E(X - \mu)^3 = \mu_3' - 3\mu\,\mu_2' + 3\mu^2\mu_1' - \mu^3\), and with \(\mu = \mu_1'\) the last two terms combine to \(3\mu_1'^{\,3} - \mu_1'^{\,3} = 2\mu_1'^{\,3}\). These formulae are used again in Unit 5, where the cumulants are expressed through the moments.
The covariance of two random variables \(X\) and \(Y\) measures the joint variability:
The correlation coefficient is the standardized covariance:
From Unit 3 Sec 2 Ex 1: \(E(X) = 0(0.4)+1(0.6)=0.6\); \(E(Y) = 1(0.3)+2(0.5)+3(0.2)=1.9\).
The three cells with \(X = 0\) contribute 0, so
\[ E(XY) = 1\cdot 1\cdot 0.20 + 1\cdot 2\cdot 0.30 + 1\cdot 3\cdot 0.10 = 0.20 + 0.60 + 0.30 = 1.10 . \]Cov = \(1.10 - 0.6 \times 1.9 = 1.10 - 1.14 = -0.04\) (slight negative association).
If \(X,Y\) independent, then \(E(XY) = E(X)E(Y)\), hence Cov\(=0\). The converse is not always true.
Write \(\mu_X = E(X)\) and \(\mu_Y = E(Y)\), both constants. Multiply out and take expectations term by term:
\[ \begin{aligned} \operatorname{Cov}(X,Y) &= E\big[(X - \mu_X)(Y - \mu_Y)\big] \\ &= E\big(XY - \mu_Y X - \mu_X Y + \mu_X\mu_Y\big) \\ &= E(XY) - \mu_Y\mu_X - \mu_X\mu_Y + \mu_X\mu_Y = E(XY) - E(X)E(Y) . \end{aligned} \]A common slip is to call \(X\) and \(Y\) independent when \(E(XY) = E(X)E(Y)\), i.e. \(\operatorname{Cov}(X,Y) = 0\). That condition defines uncorrelated variables, not independent ones. Independence means that the joint distribution factorises, \(P(X = x, Y = y) = P(X = x)\,P(Y = y)\) for every pair. Independence implies zero covariance (§5); the converse is false.
Counterexample. Let \(X\) take the values \(-1, 0, 1\) with probability \(\tfrac13\) each, and let \(Y = X^2\). Then
\[ E(X) = 0, \qquad E(Y) = \tfrac23, \qquad E(XY) = E(X^3) = \tfrac13(-1 + 0 + 1) = 0, \] \[ \operatorname{Cov}(X,Y) = 0 - 0 \cdot \tfrac23 = 0 . \]Yet \(Y\) is a function of \(X\), as dependent as two variables can be: \(P(X = 0, Y = 0) = \tfrac13\), while \(P(X = 0)\,P(Y = 0) = \tfrac13 \cdot \tfrac13 = \tfrac19\). Covariance measures only linear association, and the relation here is a parabola.
For any random variables \(X\) and \(Y\) (independent or not),
\[ E(X + Y) \;=\; E(X) + E(Y) \]More generally, for constants \(a_1, \ldots, a_n\) and r.v.s \(X_1, \ldots, X_n\):
\[ E(a_1 X_1 + a_2 X_2 + \cdots + a_n X_n) \;=\; a_1 E(X_1) + \cdots + a_n E(X_n) \]Let \((X,Y)\) have joint density \(f(x,y)\) with marginals \(f_X\) and \(f_Y\). By the expectation of a function of \((X,Y)\),
\[ \begin{aligned} E(X + Y) &= \int_{-\infty}^{\infty}\!\!\int_{-\infty}^{\infty} (x + y)\, f(x,y)\, dx\, dy \\ &= \iint x\, f(x,y)\, dx\, dy \;+\; \iint y\, f(x,y)\, dx\, dy \\ &= \int_{-\infty}^{\infty} x \Big[\int_{-\infty}^{\infty} f(x,y)\, dy\Big] dx \;+\; \int_{-\infty}^{\infty} y \Big[\int_{-\infty}^{\infty} f(x,y)\, dx\Big] dy \\ &= \int_{-\infty}^{\infty} x\, f_X(x)\, dx \;+\; \int_{-\infty}^{\infty} y\, f_Y(y)\, dy \;=\; E(X) + E(Y). \end{aligned} \]No independence is assumed — linearity of expectation holds for any \(X, Y\). The discrete case is identical with sums replacing integrals.
\(X\) = score on first die, \(Y\) = score on second die. \(E(X) = E(Y) = 3.5\). So \(E(X+Y) = 7\).
\(X\) ~ Binomial(\(n,p\)) is the sum of \(n\) independent Bernoulli(\(p\)) trials. Each Bernoulli has mean \(p\); by linearity \(E(X) = np\).
Claim: \(E(X_1 + X_2 + \cdots + X_n) = E(X_1) + E(X_2) + \cdots + E(X_n)\) for every \(n\).
Nothing about independence is used at any step.
If \(X\) and \(Y\) are independent random variables, then
\[ E(XY) \;=\; E(X) \cdot E(Y). \]For \(n\) mutually independent r.v.: \(E(X_1 X_2 \cdots X_n) = \prod E(X_i)\).
Toss two independent dice. \(E(XY) = E(X) E(Y) = 3.5 \times 3.5 = 12.25\).
If two independent stocks have expected returns 8 % and 10 %, the expected return of their product (rare in practice) factorizes: \(E(R_1 R_2) = 0.08 \times 0.10 = 0.008\).
Let \(f(x, y)\) be the joint p.d.f. of \(X\) and \(Y\), and \(f(x)\), \(f(y)\) their marginal p.d.f.s, so that
\[ E(X) = \int_{-\infty}^{\infty} x\,f(x)\,dx, \qquad E(Y) = \int_{-\infty}^{\infty} y\,f(y)\,dy . \]Then
\[ \begin{aligned} E(XY) &= \int_{-\infty}^{\infty}\!\!\int_{-\infty}^{\infty} xy\,f(x, y)\,dx\,dy \\ &= \int_{-\infty}^{\infty}\!\!\int_{-\infty}^{\infty} xy\,f(x)\,f(y)\,dx\,dy \\ &\qquad [X, Y \text{ independent, so } f(x, y) = f(x)\,f(y)] \\ &= \left\{\int_{-\infty}^{\infty} x\,f(x)\,dx\right\}\left\{\int_{-\infty}^{\infty} y\,f(y)\,dy\right\} \\ &= E(X)\,E(Y) . \end{aligned} \]Hence \(E(XY) = E(X)\,E(Y)\). The double integral splits into a product only because the joint density is a product. For discrete variables the same steps run with sums and \(P(X = x_i, Y = y_j) = P(X = x_i)\,P(Y = y_j)\).
Statement. The expectation of the product of \(n\) independent random variables is the product of their expectations: \(E(X_1 X_2 \cdots X_n) = E(X_1)\,E(X_2) \cdots E(X_n)\), that is, \(E\!\left(\prod_{i=1}^{n} X_i\right) = \prod_{i=1}^{n} E(X_i)\).
Proof, by mathematical induction. For two independent random variables, \(E(X_1 X_2) = E(X_1)\,E(X_2)\) …(1). Suppose the theorem is true for \(n = r\): \(E\!\left(\prod_{i=1}^{r} X_i\right) = \prod_{i=1}^{r} E(X_i)\) …(2). For \(n = r + 1\),
\[ \begin{aligned} E\!\left(\prod_{i=1}^{r+1} X_i\right) &= E\!\left[\left(\prod_{i=1}^{r} X_i\right) X_{r+1}\right] = E\!\left(\prod_{i=1}^{r} X_i\right) E(X_{r+1}) && [\text{from (1)}] \\ &= \prod_{i=1}^{r} E(X_i)\cdot E(X_{r+1}) = \prod_{i=1}^{r+1} E(X_i) && [\text{from (2)}] . \end{aligned} \]So the theorem is true for \(n = r + 1\), and by induction for all \(n\).
Step (1) is applied to the two variables \(\prod_{i=1}^{r} X_i\) and \(X_{r+1}\), so they must be independent; that is what mutual independence of \(X_1, \ldots, X_n\) guarantees. Pairwise independence is not enough.
Example. Let \(X\) and \(Y\) be independent, each \(\pm1\) with probability \(\tfrac12\), and \(Z = XY\). Each pair among \(X, Y, Z\) is independent (every pair of signs has probability \(\tfrac14\)), and \(E(X) = E(Y) = E(Z) = 0\). But
\[ E(XYZ) = E(X^2Y^2) = 1 \ne 0 = E(X)E(Y)E(Z) . \]If Var\((X) = 4\), Var\((Y)=9\), Cov\((X,Y) = 2\). Then Var\((X + Y) = 4 + 9 + 2(2) = 17\).
For \(Z = 3X - 2Y\) with the above: Var\((Z) = 9(4) + 4(9) - 2(3)(2)(2) = 36 + 36 - 24 = 48\).
Let \(X\) be a continuous random variable with p.d.f. \(f(x)\) (for a discrete one, replace integrals by sums).
1. \(E(C) = C\). \(E(C) = \int_{-\infty}^{\infty} C\,f(x)\,dx = C\int_{-\infty}^{\infty} f(x)\,dx = C \cdot 1 = C\).
2. \(E(aX) = aE(X)\). \(E(aX) = \int_{-\infty}^{\infty} ax\,f(x)\,dx = a\int_{-\infty}^{\infty} x\,f(x)\,dx = a\,E(X)\).
3. \(E(aX + b) = aE(X) + b\).
\[ \begin{aligned} E(aX + b) &= \int_{-\infty}^{\infty} (ax + b)\,f(x)\,dx = a\int_{-\infty}^{\infty} x\,f(x)\,dx + b\int_{-\infty}^{\infty} f(x)\,dx \\ &= aE(X) + b \cdot 1 = aE(X) + b . \end{aligned} \]4. \(E(aX + bY) = aE(X) + bE(Y)\). With \(f(x, y)\) the joint p.d.f. and \(f(x)\), \(f(y)\) the marginals,
\[ \begin{aligned} E(aX + bY) &= \int_{-\infty}^{\infty}\!\!\int_{-\infty}^{\infty} (ax + by)\,f(x, y)\,dx\,dy \\ &= \iint ax\,f(x, y)\,dx\,dy + \iint by\,f(x, y)\,dx\,dy \\ &= a\int_{-\infty}^{\infty} x\left\{\int_{-\infty}^{\infty} f(x, y)\,dy\right\}dx + b\int_{-\infty}^{\infty} y\left\{\int_{-\infty}^{\infty} f(x, y)\,dx\right\}dy \\ &= a\int_{-\infty}^{\infty} x\,f(x)\,dx + b\int_{-\infty}^{\infty} y\,f(y)\,dy = aE(X) + bE(Y) . \end{aligned} \]5. For a function \(\psi(X)\) and a constant \(a\): (i) \(E[a\psi(X)] = aE[\psi(X)]\); (ii) \(E[\psi(X) + a] = E[\psi(X)] + a\).
\[ \text{(i)}\;\; E[a\psi(X)] = \int_{-\infty}^{\infty} a\,\psi(x)\,f(x)\,dx = a\int_{-\infty}^{\infty} \psi(x)\,f(x)\,dx = aE[\psi(X)] ; \] \[ \begin{aligned} \text{(ii)}\;\; E[\psi(X) + a] &= \int_{-\infty}^{\infty} [\psi(x) + a]\,f(x)\,dx = \int_{-\infty}^{\infty} \psi(x)\,f(x)\,dx + a\int_{-\infty}^{\infty} f(x)\,dx \\ &= E[\psi(X)] + a , \end{aligned} \]since \(\int_{-\infty}^{\infty} f(x)\,dx = 1\).
6. If \(X \ge 0\), then \(E(X) \ge 0\). \(f(x) = 0\) for \(x < 0\), so
\[ E(X) = \int_{-\infty}^{\infty} x\,f(x)\,dx = \int_{0}^{\infty} x\,f(x)\,dx \ge 0 , \]because \(x \ge 0\) on the range of integration and \(f(x) \ge 0\) always.
7. If \(X \le Y\), then \(E(X) \le E(Y)\). Since \(X \le Y\), \(X - Y \le 0\), that is, \(Y - X \ge 0\). Taking expectations (property 6 applied to \(Y - X\), then property 4),
\[ E(X - Y) \le 0 \;\Rightarrow\; E(X) - E(Y) \le 0 \;\Rightarrow\; E(X) \le E(Y) . \]8. \(|E(X)| \le E|X|\). Since \(X \le |X|\), property 7 gives \(E(X) \le E|X|\) …(1). Also, since \(-X \le |X|\), \(E(-X) \le E|X|\), that is, \(-E(X) \le E|X|\) …(2). From (1) and (2), \(|E(X)| \le E|X|\).
1. \(\operatorname{Var}(C) = 0\) for a constant \(C\). \(\operatorname{Var}(C) = E[C - E(C)]^2 = E[C - C]^2 = 0\), since \(E(C) = C\).
2. \(\operatorname{Var}(aX) = a^2\operatorname{Var}(X)\).
\[ \begin{aligned} \operatorname{Var}(aX) &= E[aX - E(aX)]^2 = E[aX - aE(X)]^2 = E\{a[X - E(X)]\}^2 \\ &= a^2E[X - E(X)]^2 = a^2\operatorname{Var}(X) . \end{aligned} \]3. \(\operatorname{Var}(aX + b) = a^2\operatorname{Var}(X)\).
\[ \begin{aligned} \operatorname{Var}(aX + b) &= E[aX + b - E(aX + b)]^2 = E[aX + b - aE(X) - b]^2 \\ &= E\{a[X - E(X)]\}^2 = a^2E[X - E(X)]^2 = a^2\operatorname{Var}(X) . \end{aligned} \]4. \(\operatorname{Var}(aX + bY) = a^2\operatorname{Var}(X) + b^2\operatorname{Var}(Y) + 2ab\operatorname{Cov}(X, Y)\).
\[ \begin{aligned} \operatorname{Var}(aX + bY) &= E[aX + bY - E(aX + bY)]^2 = E[aX + bY - aE(X) - bE(Y)]^2 \\ &= E\{a[X - E(X)] + b[Y - E(Y)]\}^2 \\ &= a^2E[X - E(X)]^2 + b^2E[Y - E(Y)]^2 \\ &\quad + 2ab\,E\{[X - E(X)][Y - E(Y)]\} \\ &= a^2\operatorname{Var}(X) + b^2\operatorname{Var}(Y) + 2ab\operatorname{Cov}(X, Y) , \end{aligned} \]where the third line squares the bracket, \((u + v)^2 = u^2 + v^2 + 2uv\), and takes the expectation of each term (property 4 of expectation).
5. \(\operatorname{Var}(aX - bY) = a^2\operatorname{Var}(X) + b^2\operatorname{Var}(Y) - 2ab\operatorname{Cov}(X, Y)\). The same steps with \(-b\) in place of \(b\): the deviation is \(a[X - E(X)] - b[Y - E(Y)]\), and squaring gives the cross term \(-2ab[X - E(X)][Y - E(Y)]\).
6. Variance is independent of change of origin but not of scale. Let \(U = (X - a)/h\), where \(a\) is the change of origin and \(h\) the change of scale; then \(X = a + hU\) and
\[ \begin{aligned} \operatorname{Var}(X) &= \operatorname{Var}(a + hU) = E[a + hU - E(a + hU)]^2 = E[a + hU - a - hE(U)]^2 \\ &= E\{h[U - E(U)]\}^2 = h^2E[U - E(U)]^2 = h^2\operatorname{Var}(U) . \end{aligned} \]The origin \(a\) has dropped out, but the scale \(h\) has not.
1. \(\operatorname{Cov}(aX, bY) = ab\operatorname{Cov}(X, Y)\).
\[ \begin{aligned} \operatorname{Cov}(aX, bY) &= E\{[aX - E(aX)][bY - E(bY)]\} = E\{[aX - aE(X)][bY - bE(Y)]\} \\ &= E\{a[X - E(X)]\,b[Y - E(Y)]\} = ab\,E\{[X - E(X)][Y - E(Y)]\} \\ &= ab\operatorname{Cov}(X, Y) . \end{aligned} \]2. \(\operatorname{Cov}(X + a, Y + b) = \operatorname{Cov}(X, Y)\). Since \(E(a) = a\) and \(E(b) = b\),
\[ \begin{aligned} \operatorname{Cov}(X + a, Y + b) &= E\{[X + a - E(X + a)][Y + b - E(Y + b)]\} \\ &= E\{[X + a - E(X) - a][Y + b - E(Y) - b]\} \\ &= E\{[X - E(X)][Y - E(Y)]\} = \operatorname{Cov}(X, Y) . \end{aligned} \]3. \(\operatorname{Cov}(aX + b, cY + d) = ac\operatorname{Cov}(X, Y)\).
\[ \begin{aligned} \operatorname{Cov}(aX + b, cY + d) &= E\{[aX + b - E(aX + b)][cY + d - E(cY + d)]\} \\ &= E\{[aX + b - aE(X) - b][cY + d - cE(Y) - d]\} \\ &= E\{a[X - E(X)]\,c[Y - E(Y)]\} \\ &= ac\,E\{[X - E(X)][Y - E(Y)]\} = ac\operatorname{Cov}(X, Y) . \end{aligned} \]4. \(\operatorname{Cov}(aX + bY, cX + dY) = ac\operatorname{Var}(X) + bd\operatorname{Var}(Y) + (ad + bc)\operatorname{Cov}(X, Y)\).
\[ \begin{aligned} &\operatorname{Cov}(aX + bY, cX + dY) \\ &\quad = E\{[aX + bY - E(aX + bY)][cX + dY - E(cX + dY)]\} \\ &\quad = E\{(a[X - E(X)] + b[Y - E(Y)])(c[X - E(X)] + d[Y - E(Y)])\} \\ &\quad = ac\,E[X - E(X)]^2 + bc\,E\{[X - E(X)][Y - E(Y)]\} \\ &\qquad + ad\,E\{[X - E(X)][Y - E(Y)]\} + bd\,E[Y - E(Y)]^2 \\ &\quad = ac\operatorname{Var}(X) + bc\operatorname{Cov}(X, Y) + ad\operatorname{Cov}(X, Y) + bd\operatorname{Var}(Y) \\ &\quad = ac\operatorname{Var}(X) + bd\operatorname{Var}(Y) + (ad + bc)\operatorname{Cov}(X, Y) . \end{aligned} \]With \(-b\) and \(-d\) in place of \(b\) and \(d\) this gives \(\operatorname{Cov}(aX - bY, cX - dY) = ac\operatorname{Var}(X) + bd\operatorname{Var}(Y) - (ad + bc)\operatorname{Cov}(X, Y)\).
5. Covariance is independent of change of origin but not of scale. Let \(U = (X - a)/h\) and \(V = (Y - b)/K\), where \(a, b\) are changes of origin and \(h, K\) changes of scale; then \(X = a + hU\), \(Y = b + KV\), and
\[ \begin{aligned} \operatorname{Cov}(X, Y) &= E\{[X - E(X)][Y - E(Y)]\} \\ &= E\{[a + hU - E(a + hU)][b + KV - E(b + KV)]\} \\ &= E\{[a + hU - a - hE(U)][b + KV - b - KE(V)]\} \\ &= E\{h[U - E(U)]\,K[V - E(V)]\} \\ &= hK\,E\{[U - E(U)][V - E(V)]\} = hK\operatorname{Cov}(U, V) . \end{aligned} \]If \(X\) is any r.v. with mean \(\mu\) and finite variance \(\sigma^2\), then for any \(k > 0\):
Equivalently: \(P(|X - \mu| < k\sigma) \ge 1 - \dfrac{1}{k^2}\).
This is a distribution-free bound — it holds for any distribution with finite variance.
For \(k = 2\): \(P(|X - \mu| \ge 2\sigma) \le 1/4\). At least 75 % of any distribution lies within 2 SDs of mean.
Let \(X\) have \(\mu = 50,\; \sigma = 4\). Find a lower bound for \(P(40 < X < 60)\).
\(|X - 50| < 10\) means \(k\sigma = 10 \Rightarrow k = 2.5\).
\(P(|X - 50| < 10) \ge 1 - 1/6.25 = 0.84\). At least 84 % of values lie in (40, 60).
For a non-negative random variable \(X\) with finite mean and any \(a > 0\),
Markov's inequality is the one-sided ancestor of Chebyshev's inequality: applying it to \((X-\mu)^2\) with \(a = k^2\sigma^2\) immediately yields Chebyshev's \(P(|X-\mu|\ge k\sigma) \le 1/k^2\).
Let \(X\) be a continuous random variable with p.d.f. \(f(x)\), mean \(\mu\) and variance \(\sigma^2\), and let \(K > 0\). (For a discrete random variable, change integration to summation.) By the definition of variance,
\[ \begin{aligned} \sigma^2 = E[X - \mu]^2 &= \int_{-\infty}^{\infty} (x - \mu)^2 f(x)\,dx \\ &= \int_{-\infty}^{\mu - K\sigma} (x - \mu)^2 f(x)\,dx + \int_{\mu - K\sigma}^{\mu + K\sigma} (x - \mu)^2 f(x)\,dx \\ &\quad + \int_{\mu + K\sigma}^{\infty} (x - \mu)^2 f(x)\,dx \\ &\ge \int_{-\infty}^{\mu - K\sigma} (x - \mu)^2 f(x)\,dx + \int_{\mu + K\sigma}^{\infty} (x - \mu)^2 f(x)\,dx , \end{aligned} \]since the middle integral, \(\int_{\mu - K\sigma}^{\mu + K\sigma} (x - \mu)^2 f(x)\,dx\), is \(\ge 0\).
For the first integral, \(x \le \mu - K\sigma\), so \(x - \mu \le -K\sigma\), that is, \(-(x - \mu) \ge K\sigma\), and \((x - \mu)^2 \ge K^2\sigma^2\). For the second integral, \(x \ge \mu + K\sigma\), so \(x - \mu \ge K\sigma\) and \((x - \mu)^2 \ge K^2\sigma^2\). So in both integrals \((x - \mu)^2 \ge K^2\sigma^2\), and
\[ \begin{aligned} \sigma^2 &\ge \int_{-\infty}^{\mu - K\sigma} K^2\sigma^2 f(x)\,dx + \int_{\mu + K\sigma}^{\infty} K^2\sigma^2 f(x)\,dx \\ &= K^2\sigma^2\left\{\int_{-\infty}^{\mu - K\sigma} f(x)\,dx + \int_{\mu + K\sigma}^{\infty} f(x)\,dx\right\} \\ &= K^2\sigma^2\{P(X \le \mu - K\sigma) + P(X \ge \mu + K\sigma)\} \\ &= K^2\sigma^2\{P(X - \mu \le -K\sigma) + P(X - \mu \ge K\sigma)\} \\ &= K^2\sigma^2\,P[|X - \mu| \ge K\sigma] . \end{aligned} \]Dividing by \(\sigma^2\), \(1 \ge K^2\,P[|X - \mu| \ge K\sigma]\), so
\[ P[|X - \mu| \ge K\sigma] \le \frac{1}{K^2} . \]This can also be written \(P[|X - \mu| < K\sigma] \ge 1 - \dfrac{1}{K^2}\). \(\square\)
Putting \(c = k\sigma\),
\[ P\big(|X - \mu| \ge c\big) \le \frac{\sigma^2}{c^2}, \qquad P\big(|X - \mu| < c\big) \ge 1 - \frac{\sigma^2}{c^2} . \]The bound tells us something only if \(\sigma^2/c^2 < 1\), that is \(c > \sigma\) (\(k > 1\)). For a band narrower than one standard deviation, any probability at all is possible in the tails, and the inequality is true but empty. Worked Problem 11 below meets exactly this case.
To prove \(\beta_2 \ge \beta_1 + 1\), first prove \(\beta_2 \ge \beta_1 - (K^2 + 2K)\) for every constant \(K\). Take \(E(X) = 0\) without loss of generality (moments about the mean do not change with the origin); then \(\mu_r = E(X^r)\). Consider the real-valued function of \(t\)
\[ \begin{aligned} & Z(t) = E[X^2 + tX + K\mu_2]^2 \ge 0 \quad \text{for all } t \\ \Rightarrow\; & E[X^4 + t^2X^2 + K^2\mu_2^2 + 2tX^3 + 2K\mu_2X^2 + 2K\mu_2tX] \ge 0 \\ \Rightarrow\; & E(X^4) + t^2E(X^2) + K^2\mu_2^2 + 2tE(X^3) + 2K\mu_2E(X^2) + 2K\mu_2t\,E(X) \ge 0 \\ \Rightarrow\; & \mu_4 + t^2\mu_2 + K^2\mu_2^2 + 2t\mu_3 + 2K\mu_2^2 \ge 0 \qquad [E(X) = 0] \\ \Rightarrow\; & t^2\mu_2 + 2t\mu_3 + \mu_4 + K^2\mu_2^2 + 2K\mu_2^2 \ge 0 . \end{aligned} \]\(Z(t)\) is a quadratic expression in \(t\), and \(Z(t) \ge 0\) for all \(t\) is possible only if its discriminant is \(\le 0\):
\[ (2\mu_3)^2 - 4\mu_2\,[\mu_4 + K^2\mu_2^2 + 2K\mu_2^2] \le 0 . \]Divide by \(4\mu_2^3\) (\(> 0\)):
\[ \begin{aligned} \frac{\mu_3^2}{\mu_2^3} - \left[\frac{\mu_4}{\mu_2^2} + K^2 + 2K\right] &\le 0 \; \Rightarrow \; \beta_1 - [\beta_2 + K^2 + 2K] \le 0 \; \Rightarrow \; \beta_2 \\ &\ge \beta_1 - (K^2 + 2K) . \end{aligned} \]Let \(K = -1\) (the value that makes \(K^2 + 2K = (K + 1)^2 - 1\) smallest, namely \(-1\)):
\[ \beta_2 \ge \beta_1 - (-1) , \qquad\text{that is,}\qquad \beta_2 \ge \beta_1 + 1 . \]Notes. (1) With \(K = 0\) we get \(\beta_2 \ge \beta_1\). (2) Since \(\beta_1 \ge 0\), \(\beta_2 \ge \beta_1 + 1\) shows \(\beta_2 \ge 1\). Equality \(\beta_2 = \beta_1 + 1\) holds only for a distribution on two points (a Bernoulli variable with \(p = \tfrac14\) has \(\beta_1 = \tfrac43\), \(\beta_2 = \tfrac73\)).
For any two r.v. \(X, Y\) with finite second moments,
Equivalently using deviations:
\[ \big[\text{Cov}(X,Y)\big]^2 \;\le\; \text{Var}(X)\, \text{Var}(Y) \]This implies the correlation coefficient \(|\rho_{XY}| \le 1\).
If \(\text{Var}(X) = 16,\; \text{Var}(Y) = 25\), then by Cauchy-Schwarz, \(\text{Cov}(X,Y)^2 \le 400\), i.e., \(|\text{Cov}(X,Y)| \le 20\).
Equality holds when \(Y = aX + b\) (linear relationship), giving \(\rho = \pm 1\).
Consider the real-valued function of \(t\), \(z(t) = E(X + tY)^2\). For all real \(X\), \(Y\) and \(t\), \((X + tY)^2 \ge 0\), so
\[ z(t) = E[(X + tY)^2] \ge 0 \;\;\forall\, t \;\Rightarrow\; E(X^2) + t^2E(Y^2) + 2t\,E(XY) \ge 0 . \]\(z(t)\) is a quadratic expression in \(t\): \(\phi(t) = At^2 + Bt + C \ge 0\) with \(A = E(Y^2)\), \(B = 2E(XY)\), \(C = E(X^2)\). When \(A = E(Y^2) > 0\), \(\phi(t) \ge 0\) for every \(t\) is possible only when the discriminant \(B^2 - 4AC \le 0\):
\[ \begin{aligned} [2E(XY)]^2 - 4E(Y^2)\,E(X^2) &\le 0 \; \Rightarrow \; [E(XY)]^2 - E(X^2)\,E(Y^2) \le 0 \; \Rightarrow \; [E(XY)]^2 \\ &\le E(X^2)\,E(Y^2) . \end{aligned} \]If \(E(Y^2) = 0\), then \(Y = 0\) with probability 1, \(E(XY) = 0\), and both sides are 0.
Equality holds exactly when the discriminant is zero: then \(Z(t_0) = 0\) for some \(t_0\), so \(X + t_0Y = 0\) with probability 1, and \(X\) is a constant multiple of \(Y\). Applied to \(X - \mu_X\) and \(Y - \mu_Y\), the same argument gives the covariance form, with equality when \(Y\) is a linear function \(aX + b\) of \(X\).
Fourteen problems: seven that find an expectation from a stated distribution, one on a linear change of variable, four applications of Chebyshev's inequality and two checks of the Cauchy–Schwarz inequality, followed by exercises with answers. Every one uses the same two moves: write down the distribution, then weight each value by its probability (a sum) or by its density (an integral). Answers are exact fractions or closed forms, with decimals only at the end, and each Chebyshev bound is set beside the exact probability it bounds.
Two dice are thrown. Find the expected number of sixes.
Let \(X\) = number of sixes. Of the 36 equally likely pairs, 25 show no six, 10 show exactly one (a six on one die and one of five other faces on the other, either way round) and 1 shows two:
| \(x\) | 0 | 1 | 2 |
|---|---|---|---|
| \(p(x)\) | \(\tfrac{25}{36}\) | \(\tfrac{5}{18}\) | \(\tfrac{1}{36}\) |
One die alone gives a six with probability \(\tfrac16\), so two dice give \(\tfrac16 + \tfrac16 = \tfrac13\) on average: the addition theorem of §4 in action. An expectation is a long-run average; no single throw shows a third of a six.
\(X\) takes the values \(-2, 4, 7\) with probabilities \(\tfrac14, \tfrac12, \tfrac14\). Find \(E(X)\), \(E(X^2)\) and \(E(3X - 2)^2\).
\[ E(X) = -2 \cdot \tfrac14 + 4 \cdot \tfrac12 + 7 \cdot \tfrac14 = -\tfrac12 + 2 + \tfrac74 = \frac{13}{4} = 3.25, \] \[ E(X^2) = 4 \cdot \tfrac14 + 16 \cdot \tfrac12 + 49 \cdot \tfrac14 = 1 + 8 + 12.25 = \frac{85}{4} = 21.25 . \]For the third, expand the square and use linearity rather than squaring each value:
\[ \begin{aligned} E(3X - 2)^2 &= E(9X^2 - 12X + 4) = 9(21.25) - 12(3.25) + 4 = 191.25 - 39 + 4 \\ &= 156.25 . \end{aligned} \]Check directly: \(3X - 2\) takes \(-8, 10, 19\), and \(64 \cdot \tfrac14 + 100 \cdot \tfrac12 + 361 \cdot \tfrac14 = 16 + 50 + 90.25 = 156.25\).
Two dice are thrown. Find the expected value of the larger of the two numbers shown.
The larger is at most \(k\) when both dice are at most \(k\), in \(k^2\) of the 36 pairs; so it equals \(k\) in \(k^2 - (k-1)^2 = 2k - 1\) pairs:
| \(x\) | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| \(36\,p(x)\) | 1 | 3 | 5 | 7 | 9 | 11 |
A second route, useful for any variable on \(1, 2, 3, \ldots\): \(E(X) = \sum_{k \ge 1} P(X \ge k)\), and \(P(X \ge k) = 1 - \left(\tfrac{k-1}{6}\right)^2\), giving \(\tfrac{36 + 35 + 32 + 27 + 20 + 11}{36} = \frac{161}{36}\). The larger die averages well above the 3.5 of a single die, as it should.
Five coins are tossed. Find the mean and variance of the number of heads.
\(P(X = x) = \binom5x/32\), giving \(\tfrac1{32}, \tfrac5{32}, \tfrac{10}{32}, \tfrac{10}{32}, \tfrac5{32}, \tfrac1{32}\) for \(x = 0, 1, \ldots, 5\).
\[ \begin{gathered} E(X) = \frac{0 + 5 + 20 + 30 + 20 + 5}{32} = \frac{80}{32} = \frac{5}{2}, \\ E(X^2) = \frac{0 + 5 + 40 + 90 + 80 + 25}{32} = \frac{240}{32} = \frac{15}{2}, \end{gathered} \] \[ \operatorname{Var}(X) = E(X^2) - [E(X)]^2 = \frac{15}{2} - \frac{25}{4} = \frac{5}{4} . \]These agree with the binomial formulae \(np = 5 \cdot \tfrac12 = \tfrac52\) and \(npq = 5 \cdot \tfrac12 \cdot \tfrac12 = \tfrac54\).
\(X\) takes the values \(0, 1, 2, 3\) with probabilities \(\tfrac16, \tfrac12, \tfrac14, \tfrac1{12}\). Find \(E(X)\), \(E(X^2)\) and \(E(X - 2)^2\).
First check that the probabilities add to 1: \(\tfrac{2 + 6 + 3 + 1}{12} = 1\). In twelfths,
\[ E(X) = \frac{0 + 6 + 6 + 3}{12} = \frac{5}{4}, \qquad E(X^2) = \frac{0 + 6 + 12 + 9}{12} = \frac{9}{4}, \] \[ E(X - 2)^2 = E(X^2) - 4E(X) + 4 = \frac{27 - 60 + 48}{12} = \frac{5}{4} = 1.25 . \]Directly: \((X - 2)^2\) is \(4, 1, 0, 1\), and \(\tfrac46 + \tfrac12 + 0 + \tfrac1{12} = \tfrac{8 + 6 + 1}{12} = \tfrac{15}{12}\). Keep the fractions: rounding \(E(X^2)\) and \(4E(X)\) to a few places before subtracting is the easy way to get the third decimal wrong.
A die is thrown until a six appears. Find the expected number of throws.
The first six comes on throw \(x\) when the first \(x - 1\) throws are not sixes and throw \(x\) is: \(P(X = x) = (\tfrac56)^{x-1}\tfrac16\), \(x = 1, 2, 3, \ldots\). So
\[ S = E(X) = \tfrac16\left(1 + 2\cdot\tfrac56 + 3\left(\tfrac56\right)^2 + 4\left(\tfrac56\right)^3 + \cdots\right) . \]Multiply by \(\tfrac56\), which shifts every term one place:
\[ \tfrac56 S = \tfrac16\left(\tfrac56 + 2\left(\tfrac56\right)^2 + 3\left(\tfrac56\right)^3 + \cdots\right) . \]Subtract term by term: each coefficient drops by exactly 1,
\[ S - \tfrac56 S = \tfrac16\left(1 + \tfrac56 + \left(\tfrac56\right)^2 + \cdots\right) = \tfrac16 \cdot \frac{1}{1 - 5/6} = 1 \quad\Longrightarrow\quad \tfrac16 S = 1, \quad S = 6 . \]In general the wait for an event of probability \(p\) averages \(1/p\) trials. The series converges absolutely, so the rearrangement is legitimate (§1).
\(X\) has density \(f(x) = 4x^3\), \(0 \le x \le 1\). Find \(E(X)\).
First, \(\int_0^1 4x^3\,dx = [x^4]_0^1 = 1\), so \(f\) is a density. Then
\[ E(X) = \int_0^1 x \cdot 4x^3\,dx = \Big[\frac{4x^5}{5}\Big]_0^1 = \frac45 . \]The density rises steeply towards 1, so the mean sits well to the right of the midpoint \(\tfrac12\).
\(E(X) = 50\) and \(\operatorname{Var}(X) = 16\). Find positive constants \(a, b\) such that \(Y = aX - b\) has mean 0 and variance 1.
By the properties of §6,
\[ E(Y) = aE(X) - b = 50a - b = 0, \qquad \operatorname{Var}(Y) = a^2\operatorname{Var}(X) = 16a^2 = 1 . \]The second gives \(a = \tfrac14\) (taking the positive root), and then the first gives \(b = 50a = 12.5\). So \(Y = \tfrac14X - 12.5 = \dfrac{X - 50}{4}\): subtract the mean, divide by the standard deviation. That is exactly how any variable is standardised.
A fair die is thrown 1080 times. Use Chebyshev's inequality to find a lower bound for the probability of getting between 150 and 210 sixes.
\(X\) = number of sixes \(\sim B(n, p)\) with \(n = 1080\), \(p = \tfrac16\):
\[ \mu = np = 180, \qquad \sigma^2 = npq = 1080 \cdot \tfrac16 \cdot \tfrac56 = 150, \qquad \sigma = 12.247 . \]The range 150 to 210 is \(180 \pm 30\), so with \(c = 30\),
\[ P(150 \le X \le 210) \ge P\big(|X - 180| < 30\big) \ge 1 - \frac{\sigma^2}{c^2} = 1 - \frac{150}{900} = \frac56 = 0.8333 . \]The exact binomial probability is \(0.9873\): the bound is true and far from sharp.
A coin is tossed 1600 times. Show, using Chebyshev's inequality, that the probability of between 720 and 880 heads is at least \(\tfrac{15}{16}\).
\(X \sim B(1600, \tfrac12)\): \(\mu = 800\), \(\sigma^2 = 1600 \cdot \tfrac12 \cdot \tfrac12 = 400\), \(\sigma = 20\). The range is \(800 \pm 80\), i.e. \(k = 80/20 = 4\) standard deviations:
\[ P(720 \le X \le 880) \ge P\big(|X - 800| < 80\big) \ge 1 - \frac{1}{4^2} = \frac{15}{16} . \](The exact probability is \(0.999944\).)
\(X\) takes the values \(-3, 1, 3, 7\) with probabilities \(\tfrac18, \tfrac18, \tfrac12, \tfrac14\). Use Chebyshev's inequality to find an upper bound for \(P(|X - 3| \ge 1)\).
\[ \begin{gathered} \mu = -\tfrac38 + \tfrac18 + \tfrac32 + \tfrac74 = 3, \qquad E(X^2) = \tfrac98 + \tfrac18 + \tfrac92 + \tfrac{49}{4} = 18, \\ \sigma^2 = 18 - 9 = 9, \quad \sigma = 3 . \end{gathered} \]With \(c = 1\), \(P\big(|X - 3| \ge 1\big) \le \sigma^2/c^2 = 9\).
A probability cannot exceed 1, so a bound of 9 carries no information at all. It happens because \(c = 1\) is smaller than \(\sigma = 3\) (§7: the inequality is informative only for \(c > \sigma\), i.e. \(k > 1\); here \(k = \tfrac13\)). The honest conclusion is that Chebyshev gives no useful bound for this band. The exact answer is easy, since only \(X = 3\) lies within 1 of the mean:
\[ P\big(|X - 3| \ge 1\big) = 1 - P(X = 3) = 1 - \frac12 = \frac12 . \]\(X\) has density \(f(x) = 2e^{-2x}\), \(x \ge 0\). Use Chebyshev's inequality to bound \(P(|X - \tfrac12| < \tfrac34)\), and compare with the exact value.
Integrating by parts, \(\mu = \int_0^\infty 2xe^{-2x}\,dx = \tfrac12\), and \(E(X^2) = \int_0^\infty 2x^2e^{-2x}\,dx = \tfrac12\). Hence \(\sigma^2 = \tfrac12 - \tfrac14 = \tfrac14\), \(\sigma = \tfrac12\).
With \(c = \tfrac34\) (\(k = 1.5\)),
\[ P\big(|X - \tfrac12| < \tfrac34\big) = P(-\tfrac14 < X < \tfrac54) \ge 1 - \frac{1/4}{9/16} = 1 - \frac49 = \frac59 = 0.5556 . \]Since \(X \ge 0\), the event is \(0 \le X < \tfrac54\), with exact probability \(\int_0^{5/4} 2e^{-2x}\,dx = 1 - e^{-2.5} = 0.9179\). The tail Chebyshev allows is \(0.4444\); the real tail is \(e^{-2.5} = 0.0821\).
Verify the Cauchy–Schwarz inequality for the joint distribution
| \(Y = 0\) | \(Y = 2\) | \(p_X\) | |
|---|---|---|---|
| \(X = 1\) | \(\tfrac16\) | \(\tfrac13\) | \(\tfrac12\) |
| \(X = 3\) | \(\tfrac14\) | \(\tfrac14\) | \(\tfrac12\) |
| \(p_Y\) | \(\tfrac5{12}\) | \(\tfrac7{12}\) | 1 |
From the margins, \(E(X^2) = 1 \cdot \tfrac12 + 9 \cdot \tfrac12 = 5\) and \(E(Y^2) = 4 \cdot \tfrac7{12} = \tfrac{7}{3}\); from the four cells (two of which have \(Y = 0\) and contribute nothing),
\[ E(XY) = 1 \cdot 2 \cdot \tfrac13 + 3 \cdot 2 \cdot \tfrac14 = \tfrac23 + \tfrac32 = \frac{13}{6} . \] \[ \big[E(XY)\big]^2 = \frac{169}{36} = 4.694 \;\le\; E(X^2)\,E(Y^2) = \frac{35}{3} = 11.667 . \]The inequality holds, and is strict: \(X\) is not a multiple of \(Y\).
Verify the Cauchy–Schwarz inequality for \(f(x, y) = 6e^{-(2x + 3y)}\), \(x, y \ge 0\).
The density factorises, \(6e^{-(2x+3y)} = 2e^{-2x} \cdot 3e^{-3y}\), so \(X\) and \(Y\) are independent exponentials with rates 2 and 3. For rate \(\lambda\), \(E(X) = 1/\lambda\) and \(E(X^2) = 2/\lambda^2\) (Worked Problem 12 has \(\lambda = 2\)). So \(E(X^2) = \tfrac12\), \(E(Y^2) = \tfrac29\), and the double integral splits:
\[ \begin{gathered} E(XY) = E(X)\,E(Y) = \tfrac12 \cdot \tfrac13 = \tfrac16, \\ \big[E(XY)\big]^2 = \tfrac{1}{36} \;<\; E(X^2)\,E(Y^2) = \tfrac12 \cdot \tfrac29 = \tfrac19 . \end{gathered} \]