The mathematical expectation (or expected value, mean) of a random variable X is the weighted average of all possible values that X can take, with the weights being their respective probabilities.
It represents the long-run average value of X if the experiment were repeated many times. It is often denoted as μ (mu).
Sum of (value * probability of value) for all possible values x.
Integral of (value * density at value) over the entire range of x.
We often need the expectation of a function of X, say Y = g(X). We can find E[Y] *without* first finding the p.d.f. of Y, using the Law of the Unconscious Statistician (LOTUS).
Example: Let X be a discrete RV with p.m.f. p(0)=0.5, p(1)=0.3, p(2)=0.2.
Find E[X] and E[X²].
- E[X] = (0 * p(0)) + (1 * p(1)) + (2 * p(2)) = (0 * 0.5) + (1 * 0.3) + (2 * 0.2) = 0 + 0.3 + 0.4 = 0.7
- E[X²] = (0² * p(0)) + (1² * p(1)) + (2² * p(2)) = (0 * 0.5) + (1 * 0.3) + (4 * 0.2) = 0 + 0.3 + 0.8 = 1.1
Expectation has several key properties that make it a powerful tool.
The expected value of a constant (c) is just the constant itself. (e.g., E[5] = 5).
Constants can be factored out of an expectation.
Expectation is a linear operator.
The expectation of a sum is the sum of the expectations. This is known as the Linearity of Expectation.
The expectation of a product is the product of the expectations *only if* the variables are independent.
While expectation tells us the "center" of a distribution, variance tells us about its "spread" or "dispersion." A small variance means data points are clustered tightly around the mean. A large variance means they are spread out.
Covariance measures the joint variability of two random variables, (X, Y). It describes the direction of the linear relationship between them.
Using covariance, we can state the general formula for the variance of a sum:
If X and Y are independent, then Cov(X, Y) = 0, and the formulas simplify:
Var(X + Y) = Var(X) + Var(Y) (if independent)
Var(X - Y) = Var(X) + Var(Y) (if independent)
This is simply an application of the Law of the Unconscious Statistician (LOTUS) for a function of two variables, g(X, Y).
The formulas for E[X+Y], E[XY], and Cov(X,Y) are all special cases of this.
Example: Let (X, Y) have the joint p.d.f. f(x, y) = 2 for 0 < x < y < 1, and 0 otherwise.Find E[X] and E[Y].
1. Find Marginal PDFs first:
- fX(x): We integrate over y. The bounds for y are from x to 1.
fX(x) = ∫x1 2 dy = [2y] from x to 1 = 2(1) - 2(x) = 2(1-x), for 0 < x < 1.- fY(y): We integrate over x. The bounds for x are from 0 to y.
fY(y) = ∫0y 2 dx = [2x] from 0 to y = 2(y) - 2(0) = 2y, for 0 < y < 1.2. Calculate Expectations using Marginals:
- E[X] = ∫01 x * fX(x) dx = ∫01 x * 2(1-x) dx = 2 ∫01 (x - x²) dx
= 2 [x²/2 - x³/3] from 0 to 1 = 2 * ( (1/2 - 1/3) - 0 ) = 2 * (1/6) = 1/3.- E[Y] = ∫01 y * fY(y) dy = ∫01 y * (2y) dy = 2 ∫01 y² dy
= 2 [y³/3] from 0 to 1 = 2 * ( 1/3 - 0 ) = 2/3.Alternative (using joint p.d.f.):
- E[X] = ∫01 ∫0y x * (2) dx dy = ∫01 [x²] from 0 to y dy = ∫01 y² dy = [y³/3] from 0 to 1 = 1/3.