Expectation: The Mean of a Random Variable
The expectation (or mean) of a random variable is the single number that says where its probability is centred — a weighted average of the values, each weighted by its probability. For a discrete variable this is (Definition 13.1), also called the first moment and written ; rolling a fair die gives (Example 13.1) — already a sign that the mean need not be a value can actually take. For a continuous variable the sum becomes an integral against the density, (Definition 13.2), which for returns the midpoint (Example 13.7). To average a function of you do not need the distribution of : the law of the unconscious statistician (Proposition 13.1) gives , and the choice produces the moments (Definition 13.3). Expectation is powerful but not automatic: it is well-defined only when its sum or integral settles on a value, finite or (Remark 13.1), and it can be infinite (Examples 13.5, 13.8) or even undefined (Example 13.6). (The means of the named distributions — Bernoulli, binomial, geometric — are developed in a later lesson; here we keep them light.)
Before you start — give these a try
Attempting first primes your brain for the lesson — even if you miss. Nothing is graded or saved; it's just a warm-up.
For a discrete random variable and a function , which formula is the law of the unconscious statistician for ?
Let . Find . Give your answer as a decimal to places.
What you’ll be able to do
- State Definition 13.1: the expectation of a discrete random variable is the weighted average (the first moment ), and compute it for a fair die (, Example 13.1) and for small p.m.f.s and payoff games.
- Apply Definition 13.2, , to average a continuous variable against its density, recovering the uniform mean for (Example 13.7).
- Use the law of the unconscious statistician (Proposition 13.1), , to compute — such as a second moment — without first finding the distribution of .
- Define the moments of a random variable (Definition 13.3) and recognise the mean as the first moment ().
- Explain when an expectation is well-defined (Remark 13.1), and recognise that can be a non-attained value, can be infinite (Examples 13.5, 13.8) or undefined (Example 13.6), and — being a mean, not a probability — need not lie in .
In your course
· MATH2015 · Linear Algebra & Probability- Definition 13.1Expectation (discrete), over all possible values ; the first moment .
- Remark 13.1Well-defined expectationis well-defined if its sum/integral has a definite value — finite, or , or .
- Example 13.1Mean of a fair die.
- Definition 13.2Expectation (continuous)for a density .
- Example 13.7Mean of a uniform variableFor , .
- Proposition 13.1Law of the unconscious statistician (LOTUS)For discrete , .
- Definition 13.3MomentsThe -th moment of is ; the first moment is the mean.
- Examples 13.5, 13.6, 13.8Infinite or undefined expectationA defining sum/integral can diverge to (Examples 13.5, 13.8) or fail to converge at all (Example 13.6), so may be infinite or undefined.
Expectation of a discrete random variable
The expectation (or mean) of a discrete random variable is the sum running over every possible value of (Definition 13.1). It is a weighted average of the outcomes, each value weighted by how likely it is, : the more probability sits at a value, the harder it pulls the average toward itself. The expectation is also called the first moment and is written . A fair die has (Example 13.1) — a decisive reminder that the mean need not be a value can take: no face shows . A useful special case is the indicator , equal to when the event occurs and otherwise; since , we get , so every probability is itself an expectation. Whether the defining sum actually produces a number becomes a genuine question once has infinitely many values — the subject of Remark 13.1 below.
Expectation of a continuous random variable
When is continuous with density , averaging is still 'value times weight', but the weights come from the density and the sum turns into an integral: (Definition 13.2), again written . A thin slice near carries probability , and is its contribution to the average — exactly mirroring the term in the discrete sum. The cleanest case is the uniform variable , whose density is the constant on : (Example 13.7) — the midpoint of the interval, just as symmetry suggests. The same integral can diverge: the density on is perfectly legitimate, yet , so that variable has infinite mean (Example 13.8).
LOTUS and the moments of $X$
Often we want the average not of but of a function — a squared value, a payoff, a cost. One route is to work out the distribution of the new variable and sum ; the law of the unconscious statistician (LOTUS, Proposition 13.1) says we may skip that step and weight directly against the distribution of : for discrete (and in the continuous case). The name is a joke — you use the p.m.f. of 'unconsciously', without re-deriving anything. Taking produces the moments of : the -th moment is (Definition 13.3). The first moment () is just the mean ; the second moment is the key ingredient of the variance, taken up in a later lesson. Beware that in general — for a fair die, LOTUS gives , well above .
When an expectation is infinite or undefined
An expectation is a sum or integral, and those do not always converge, so need not exist as a finite number. Remark 13.1 fixes the vocabulary: is well-defined if its defining sum or integral has a definite value — a finite number, or , or . Two failure modes are worth seeing. First, the value can be infinite: in a doubling-prize coin game you win with probability , so even though the prize is finite every single time you play (Example 13.5; the continuous Example 13.8 behaves similarly). Second, the value can be undefined: if the positive and negative parts each sum to infinity there is no consistent total — a net-reward game leads to , a series with no limit, so simply does not exist (Example 13.6). Finally, keep in mind that a mean is not a probability: it can be negative, and it need not lie in .
The expectation (or mean) of a discrete random variable is the sum taken over all possible values of . It is also called the first moment and is denoted .
The expectation (or mean) of a continuous random variable with density is also written .
Let be a real-valued function defined on the range of a random variable . If is discrete, then (For continuous with density , .)
For a positive integer , the -th moment of a random variable is . By LOTUS, for discrete this is . The first moment () is the mean .
Worked examples
Example 13.1 — a fair die. Let be the result of rolling a fair die, so takes each value in with . Compute the expectation , and say whether the mean is a possible value of .
- 1
Set up Definition 13.1. Every value shares the same weight , so the mean is the ordinary average of .
- 2
Add the values. , hence
- 3
Interpret. is the balance point of the six equally likely faces, but no face shows — the mean is a summary, not an outcome.
A payoff game (mean and a moment via LOTUS). You play a game whose net payoff (in dollars) has p.m.f. , , . Find the expected payoff , and then the second moment .
Example 13.7 — mean of a uniform variable. Let , with density on and elsewhere. Derive in general, then evaluate it for .