Difficulty: Intermediate | Prerequisites: Chapter 3 (probability distributions, PMFs, PDFs, joint distributions)
This is Part 1 of 3 covering STAT 3021 Chapter 4. It handles expected value (the mean) for single and joint random variables, including the Law of the Unconscious Statistician (LOTUS). Parts 2 and 3 cover variance/covariance and linear combinations, respectively. If you are not comfortable with probability mass functions, density functions, and integration, review Chapter 3 first.
The expected value (mean) of a random variable is its long-run weighted average, computed by summing each outcome times its probability (discrete) or integrating the same product (continuous). LOTUS lets you find the expected value of any function of a random variable, g(X), without first deriving g(X)'s own distribution. These ideas extend naturally to functions of two random variables through joint distributions.
Expected value / mean / E(X) / µ
The long-run weighted average of a random variable, calculated by multiplying each possible value by its probability and summing (discrete) or integrating (continuous). Think of it as the "centre of gravity" of the probability distribution.
Weighted average / long-run average
Alternate names for E(X). "Weighted" because outcomes with higher probability contribute more to the mean than outcomes with lower probability.
Balance point
A graphical interpretation of E(X). If you cut out the shape of the probability distribution and placed it on a fulcrum, E(X) is the point where it would balance perfectly.
Median
The value x where F(x) = P(X ≤ x) = 0.5, splitting the distribution in half. In simple terms, the median is the "middle number" of the distribution. It is not the same as the mean, except in symmetric distributions.
Law of the Unconscious Statistician (LOTUS)
A theorem that lets you compute E[g(X)] directly from the original distribution f(x), without first finding the distribution of g(X). In simple terms, you can find the average of any function of X by plugging that function into the expectation formula with the original PMF or PDF.
Joint expected value / E[g(X,Y)]
The expected value of a function of two random variables, computed using the joint probability distribution f(x,y). Think of it as LOTUS extended to two dimensions.
The mean is computed as E(X) = Σ x·f(x), summing over all possible values of X.
Each value x is weighted by its probability f(x). Values with higher probability pull the mean toward them.
The mean is not simply the average of the possible values. If the probabilities are not equal, the simple average gives the wrong answer.
Example: X takes values {4,5,6,7,8,9} with probabilities {1/12, 1/12, 1/4, 1/4, 1/6, 1/6}. The simple average (4+5+6+7+8+9)/6 = 6.5 is wrong. The correct mean is E(X) = 4(1/12) + 5(1/12) + 6(1/4) + 7(1/4) + 8(1/6) + 9(1/6) = 6.833.
The mean is computed as E(X) = ∫ x·f(x) dx, integrated from −∞ to +∞.
In practice, you integrate only over the region where f(x) ≠ 0.
Example: Profit X has density f(x) = 2(1−x) for 0 < x < 1. Then E(X) = ∫ from 0 to 1 of x·2(1−x) dx = ∫ (2x − 2x²) dx = [x² − (2/3)x³] from 0 to 1 = 1/3. In units of $5,000, the average profit is $5,000/3 ≈ $1,666.67.
LOTUS says: E[g(X)] = Σ g(x)·f(x) (discrete) or ∫ g(x)·f(x) dx (continuous).
You do not need to derive the distribution of g(X) first. You use the original distribution f(x) and just replace x with g(x) inside the sum or integral.
Key example: With the car wash distribution (X in {4,...,9}), let g(X) = 2X − 1 (dollars paid to the attendant). Then E(2X−1) = Σ (2x−1)·f(x) = 12.667. This matches 2·E(X) − 1 = 2(6.833) − 1 = 12.667 (a fact formalised later as the linearity property).
A common trap: you cannot pull a non-linear function outside the expectation.
E(X²) ≠ [E(X)]² in general. In fact, for any non-degenerate random variable, E(X²) > [E(X)]².
Using the car wash example: E(X²) = Σ x²·f(x) = 48.833, but [E(X)]² = (6.833)² = 46.694. These are not equal.
This inequality only holds for non-linear functions. For linear functions g(X) = aX + b, the equality E(aX+b) = aE(X)+b does hold.
For random variables X and Y with joint distribution f(x,y), E[g(X,Y)] = ΣΣ g(x,y)·f(x,y) (discrete) or ∫∫ g(x,y)·f(x,y) dx dy (continuous).
Example (discrete): X in {2,4}, Y in {1,3,5} with given joint PMF. For g(X,Y) = XY², compute E(XY²) = ΣΣ xy²·f(x,y) = 35.2.
Example (continuous): f(x,y) = 4xy for 0 < x < 1, 0 < y < 1. Then E(X+Y) = ∫∫ (x+y)·4xy dx dy = 4/3.
\mu = E(X) = \sum_x x \, f(x) \quad \text{(discrete)}\mu = E(X) = \int_{-\infty}^{\infty} x \, f(x) \, dx \quad \text{(continuous)}E[g(X)] = \sum_x g(x) \, f(x) \quad \text{(LOTUS, discrete)}E[g(X)] = \int_{-\infty}^{\infty} g(x) \, f(x) \, dx \quad \text{(LOTUS, continuous)}E[g(X,Y)] = \sum_x \sum_y g(x,y) \, f(x,y) \quad \text{(joint, discrete)}E[g(X,Y)] = \int_{-\infty}^{\infty} \int_{-\infty}^{\infty} g(x,y) \, f(x,y) \, dx \, dy \quad \text{(joint, continuous)}Expected value is the foundation of decision-making under uncertainty. Insurance companies set premiums by computing the expected payout across all policyholders. A car dealer estimating long-run profit per vehicle (as in the chapter's examples) uses E(X) to plan inventory and staffing. In finance, the expected return of a portfolio is simply the weighted average of individual asset returns, using portfolio weights as probabilities.
Students often think E(X) is the simple average of the possible values. It is not. Each value is weighted by its probability, so unequal probabilities shift the mean away from the midpoint.
Students often assume E[g(X)] = g[E(X)] for any function g. This is only true when g is linear (g(X) = aX + b). For non-linear functions like X², log(X), or sqrt(X), the two sides are not equal.
Students sometimes confuse the mean and the median. The mean is the balance point of the distribution; the median is the value that splits the area in half. They are equal only for symmetric distributions.
When applying LOTUS, students sometimes try to derive the distribution of g(X) first and then take its expected value. LOTUS exists precisely so you do not have to do this. Use the original f(x) directly.
⚠️ Computing E(X) for both discrete and continuous distributions is a staple exam question. Be sure you can set up the sum or integral from a given PMF or PDF.
⚠️ LOTUS problems appear frequently. The exam may give you f(x) and a function g(X) and ask for E[g(X)]. Do not waste time deriving the distribution of g(X).
⚠️ Expect a question testing whether E(X²) = [E(X)]². The answer is no (unless X is a constant). This distinction is foundational for variance (Section 4.2).
⚠️ Joint expected value problems (two variables) may ask you to compute E[g(X,Y)] using the joint PMF or PDF. Watch the limits of integration carefully for continuous joint distributions, especially non-rectangular supports.
True or False: E(X) is always one of the possible values X can take. (False. E(X) = 6.833 in the car wash example, which is not one of the outcomes {4,5,6,7,8,9}.)
True or False: E(X²) = [E(X)]² for any random variable. (False. Equality holds only if X is a constant, i.e. has zero variance.)
Fill in the blank: LOTUS stands for the Law of the ______ Statistician. (Unconscious.)
True or False: To compute E[g(X)] using LOTUS, you must first find the probability distribution of g(X). (False. You use the original distribution f(x) directly.)
Fill in the blank: For a continuous random variable, the median is the value x where F(x) = ______. (0.5.)
Q: A discrete random variable X has the following distribution: x = {1, 2, 3} with f(x) = {0.2, 0.5, 0.3}. What is E(X)?
A: E(X) = 1(0.2) + 2(0.5) + 3(0.3) = 0.2 + 1.0 + 0.9 = 2.1.
Q: Using the distribution above, what is E(X²)?
A: E(X²) = 1²(0.2) + 2²(0.5) + 3²(0.3) = 0.2 + 2.0 + 2.7 = 4.9. Note this is not equal to [E(X)]² = (2.1)² = 4.41.
Q: A continuous random variable X has density f(x) = 3x² for 0 < x < 1, and 0 elsewhere. Find E(X).
A: E(X) = ∫ from 0 to 1 of x·3x² dx = ∫ 3x³ dx = (3/4)x⁴ evaluated from 0 to 1 = 3/4.
Q: Using the density above, find E(2X + 5) without computing a new integral.
A: By the linearity shortcut, E(2X+5) = 2·E(X) + 5 = 2(3/4) + 5 = 6.5. (This property is proved in Section 4.3, but the shortcut works here.)
Q: X and Y have joint PDF f(x,y) = 4xy for 0 < x < 1, 0 < y < 1. Find E(XY).
A: E(XY) = ∫∫ xy·4xy dx dy = ∫ from 0 to 1 ∫ from 0 to 1 4x²y² dx dy = 4 · (1/3) · (1/3) = 4/9.
Expected value is the building block for variance (Section 4.2), since Var(X) = E[(X − µ)²]. The linearity of expectation (Section 4.3) extends the ideas here to sums and linear combinations of random variables. If you go on to named distributions (binomial, Poisson, normal), their means are all derived using these same formulas.
Related Terms / Search Tags
expected value, mean, E(X), mu, µ, weighted average, long-run average, balance point, median, LOTUS, Law of the Unconscious Statistician, joint expected value, E[g(X)], E[g(X,Y)], discrete mean, continuous mean, probability-weighted average, mathematical expectation, STAT 3021, Chapter 4