Lesson 4 of 8 · 15 min
Expected value of a continuous random variable
Calculate the mean of a continuous random variable by integrating , use symmetry as a shortcut, and interpret the mean as the balance point of the density.
What you will be able to do
- Explain as the continuous version of .
- Calculate for a pdf given by a rule on an interval.
- Use symmetry to write down the mean, and the uniform mean .
- Compare the mean and median of a skewed distribution.
For a discrete random variable you found the mean as a weighted average, : each value times its probability, added up. For a continuous variable, slice the -axis into thin strips of width . The strip at has probability about , so it contributes about . Adding infinitely many thin strips is exactly what an integral does.
Discrete
Each value is weighted by its probability.
Continuous
Each value is weighted by its density, over the support.
Definition
Expected value (mean)
If has pdf , the expected value of is
In practice, integrate over the support only. is the long-run average of many observations of , and it is the balance point of the region under the pdf: if you cut the shape out of cardboard, it would balance on a pivot at .
This family blends the uniform density with the triangular density on . As grows, more area moves to the right. Watch the mean follow it: here .
Worked example
Mean and median of
has pdf for , and elsewhere.
(a) Find .
(b) The median of is . Explain why the mean is less than the median.
Step 1: Multiply by x and integrate over the support
Step 2: Evaluate
Step 3: Check it is reasonable
The density increases towards 2, so most of the area is on the right, and is right of the midpoint 1. Good.
Step 4: Compare with the median
The density has a long, thin tail to the left (near 0). The mean is the balance point, and that tail pulls it left, to 1.5. The median only splits the area in half, so it is less affected and sits at 1.59.
Try it yourself first, then check the working one step at a time.
Answer
(a) (b) The distribution is negatively skewed: its long left tail pulls the mean below the median.
Method
over the support.
Check the mean lies inside the support, towards the heavier side.
Watch out for
Integrating instead of , which always gives 1.
Find when for , and 0 elsewhere.
Tip
Symmetry shortcut
If the pdf is symmetric about (its graph is a mirror image either side of ), then . So for the uniform distribution on ,
and for on , , with no integral needed. State the symmetry as your reason.
Why the uniform mean is (a + b)/2
With on :
The pdf on is an upside-down parabola. What is ?
The mean and the median measure the centre in different ways. The median splits the area in half; the mean is the balance point, which a long tail pulls towards it. For on the mean is 1.5 but the median is : the long tail to the left drags the mean below the median. For a symmetric density they are equal.
The time customers spend in a bank queue has a density that is high near 0 minutes and has a long tail to the right. Which is most likely true?
Common mistake
Forgetting the x
for every pdf, so if your "mean" is 1 you probably forgot to multiply by . Check every mean you find: it must lie inside the support, and on the side where most of the area is.
Summary
; integrate over the support only.
The mean is the long-run average and the balance point of the density.
If the density is symmetric about , then ; the uniform mean is .
Skewness separates the mean from the median: a long tail pulls the mean towards it.
Check: the mean lies inside the support, towards the heavier side.
Finished the lesson?
Try the 3 quick checks above and the lesson completes itself, or mark it complete now.