Practice: Random Variables, Expectation and Variance

Recognition · Error diagnosis

A student computes E [ X ] = 3.5 for a fair six-sided die and concludes: "So 3.5 is the value to expect. The most typical roll."

What is wrong?

2 hints available, least help first.

Hint 1: Retrieval cue

Can a die ever show 3.5? What is P ( X = 3.5 ) ?

Hint 2: Concept cue

Expectation is a weighted average of the values. Must a weighted average be one of the values being averaged?

Direct application

A fair six-sided die has E [ X ] = 3.5 .

Let Y = 2 X + 3 . What is E [ Y ] ?

Enter the value. It is checked against the answer and the precision this task asks for.

2 hints available, least help first.

Hint 1: Retrieval cue

Expectation passes through multiplication by a constant and addition of a constant.

Hint 2: Concept cue

E [ 2 X + 3 ] = 2 E [ X ] + 3 . Substitute E [ X ] = 3.5 .

Direct application

A fair four-sided die shows 1 , 2 , 3 , 4 , each with probability 1 4 .

Compute Var ⁡ ( X ) . Give your answer to four decimal places.

Enter the value. It is checked against the answer and the precision this task asks for.

2 hints available, least help first.

Hint 1: Retrieval cue

Compute E [ X ] first, then either average the squared deviations or use E [ X 2 ] − E [ X ] 2 .

Hint 2: Concept cue

E [ X ] = 2.5 and E [ X 2 ] = 7.5 . Now subtract the square of the first from the second.

Construction · Direct application · Explanation

(a) For a fair six-sided die, compute E [ X ] and Var ⁡ ( X ) by both the definition and E [ X 2 ] − E [ X ] 2 , and say why the average deviation E [ X − E [ X ] ] would not serve as a measure of spread.

(b) Let Y = 2 X + 3 . Give E [ Y ] and Var ⁡ ( Y ) , stating which rule you use for each and why the + 3 affects one and not the other.

(c) Compute E [ X 2 ] and compare it with ( E [ X ] ) 2 . Say what the difference between them equals, and what that tells you about applying a non-linear function inside an expectation.

Write your answer, then compare it with the worked solution.

3 hints available, least help first.

Hint 1: Retrieval cue

In (a), compute the deviations from 3.5 and add them before squaring anything.

Hint 2: Concept cue

In (b), ask what a shift does to a deviation from the mean, and what a scaling does to a squared deviation.

Hint 3: Strategy cue

In (c), compute both numbers and subtract before trying to name the difference.

Compare with the worked solution

Comparing does not record a result. Judging your own written answer cannot show that you can do this without help.

(a) Expectation and variance of a fair die.

E [ X ] = 1 6 ( 1 + 2 + 3 + 4 + 5 + 6 ) = 21 6 = 7 2 = 3.5 .

Variance by the definition. The deviations from 3.5 are − 2.5 , − 1.5 , − 0.5 , 0.5 , 1.5 , 2.5 , and

Var ⁡ ( X ) = 1 6 [ 6.25 + 2.25 + 0.25 + 0.25 + 2.25 + 6.25 ] = 17.5 6 = 35 12 ≈ 2.916667 .

By the shortcut. E [ X 2 ] = 1 6 ( 1 + 4 + 9 + 16 + 25 + 36 ) = 91 6 , so

E [ X 2 ] − E [ X ] 2 = 91 6 − 49 4 = 182 − 147 12 = 35 12   ✓

Both exact in rational arithmetic. The standard deviation is 35 / 12 ≈ 1.707825 , in pips rather than squared pips.

Why not the average deviation. E [ X − E [ X ] ] = E [ X ] − E [ X ] = 0 by linearity, and this is zero for every distribution, not just this one. The mean is precisely the point about which deviations cancel, so any measure permitting cancellation measures nothing. Here the deviations − 2.5 − 1.5 − 0.5 + 0.5 + 1.5 + 2.5 sum to exactly 0. Squaring removes the signs, at the cost of squared units, which the standard deviation then restores.

(b) The linear transformation.

E [ Y ] = 2 ( 3.5 ) + 3 = 10 , Var ⁡ ( Y ) = 2 2 ⋅ 35 12 = 35 3 ≈ 11.666667 .

Verified directly over Y 's values 5 , 7 , 9 , 11 , 13 , 15 , which average to 60 6 = 10 ✓. The rules are E [ a X + b ] = a E [ X ] + b and Var ⁡ ( a X + b ) = a 2 Var ⁡ ( X ) ; neither carries a condition, both holding for any random variable.

Why the + 3 affects one and not the other. Adding 3 shifts every value, and therefore shifts the balance point by 3 as well, so the mean moves. But it moves every value and the mean together, so no deviation from the mean changes, and a variance is built entirely from deviations. The × 2 multiplies every deviation by 2 and hence every squared deviation by 4, which is why the multiplier is squared and the shift disappears. In standard deviations the scaling is gentler: σ Y = 2 σ X ≈ 3.415650 .

(c) The non-linear case.

E [ X 2 ] = 91 6 ≈ 15.166667 , ( E [ X ] ) 2 = 3.5 2 = 12.25 .

The difference is 91 6 − 49 4 = 35 12 = Var ⁡ ( X ) , exactly. That identity is Var ⁡ ( X ) = E [ X 2 ] − E [ X ] 2 read backwards, and it says the gap is not an accident of this die: for any random variable the average of the squares exceeds the square of the average by precisely the variance, with equality only when X is constant and the variance is zero.

The general lesson is that E [ g ( X ) ] ≠ g ( E [ X ] ) for non-linear g , and the linear rules in (b) worked only because the transformation was linear. Practically: an average of squared errors is not the square of the average error, and a return computed at an expected value is not an expected return.

A complete answer does each of these:

  • computes expectation
  • computes variance
  • separates distribution from sample
Practice data

Your practice record is stored in this browser only. Clearing it removes every answer and every scheduled review, and cannot be undone.

Results update as you type. Use the up and down arrow keys to move between results, Enter to open one, and Escape to close.

Type to search.

Settings

Appearance

Interface density

Your record

Your progress is stored in this browser and nowhere else: an identifier, the answers you have given, the mastery states and review schedule derived from them, and the lesson you last opened. Clearing it makes you a new learner on this device. It cannot be undone, and it will not affect your appearance or density settings.

Focus timer

Focus--minutes remaining

Phase

Kept in this browser only, and used to label the session in your own history.

Today

Nothing recorded yet. Finish a focus session and it will appear here.

Settings

Focus sessions between long breaks.

Sessions you are aiming for in a day.

Notifications

Your history

Sessions are stored in this browser and nowhere else. They are not evidence and never reach your mastery record.