01 / 20

Variance of a
Random Variable

Understand how variance measures the spread of a probability distribution and why it matters for predicting outcomes in statistics.

College Statistics

What Is a Random Variable?

A random variable assigns a numerical value to each outcome of a random experiment. We typically denote it with a capital letter like \( X \).

Discrete
Takes countable values: rolling a die gives \( X \in \{1,2,3,4,5,6\} \)
Continuous
Takes any value in an interval: heights, temperatures, or wait times

The Expected Value \( \mu \)

Before we can talk about spread, we need the center. The expected value (or mean) of a discrete random variable \( X \) is:

Variance measures how far outcomes spread away from this center \( \mu \). Without a center, we cannot measure spread.

What Is Variance?

Variance measures the average squared distance of each value from the mean. It tells us how spread out the distribution is.

μ Low Variance High Variance spread from μ

The Variance Formula

For a discrete random variable \( X \) with mean \( \mu = E(X) \):

1
Subtract the mean from each value: \( x_i - \mu \)
2
Square each deviation: \( (x_i - \mu)^2 \)
3
Multiply by probability: \( (x_i - \mu)^2 \cdot P(x_i) \)
4
Sum all terms to get \( \sigma^2 \)

The Shortcut Formula

An equivalent formula that is often easier to compute:

\( E(X^2) \)
\( \displaystyle\sum_i x_i^2 \cdot P(x_i) \): Weight each squared value by its probability
\( [E(X)]^2 \)
Simply take the mean \( \mu \) and square it

Variance vs. Standard Deviation

Variance \( \sigma^2 \) Std. Deviation \( \sigma \)
Formula \( \sum (x_i - \mu)^2 P(x_i) \) \( \sqrt{\sigma^2} \)
Units Squared units Same units as \( X \)
Interpretation Average squared deviation Typical distance from \( \mu \)
Always \( \geq 0 \)? Yes Yes
Equals 0 when All probability on one value (no spread)

Key Properties of Variance

1
\( \text{Var}(X) \geq 0 \) always. Squared deviations cannot be negative.
2
\( \text{Var}(c) = 0 \) for any constant \( c \). A constant has no spread.
3
\( \text{Var}(aX + b) = a^2 \cdot \text{Var}(X) \). Adding \( b \) shifts the distribution but does not change spread. Multiplying by \( a \) scales spread by \( a^2 \).
4
If \( X \) and \( Y \) are independent: \( \text{Var}(X + Y) = \text{Var}(X) + \text{Var}(Y) \). Variances add.

How to Compute Variance

1
List all values \( x_i \) and their probabilities \( P(x_i) \). Confirm they sum to 1.
2
Compute the mean: \( \mu = \sum x_i \cdot P(x_i) \).
3
For each value, compute \( (x_i - \mu)^2 \cdot P(x_i) \).
4
Sum all products to get \( \sigma^2 = \text{Var}(X) \).
5
Take the square root if you need \( \sigma \).

Example 1: Coin Flip

Let \( X = \) number of heads in 1 flip. Then \( X \in \{0, 1\} \) with \( P(0) = 0.5 \) and \( P(1) = 0.5 \).

1
Mean: \( \mu = 0(0.5) + 1(0.5) = \) \( 0.5 \)
2
Squared deviations: \( (0 - 0.5)^2(0.5) = 0.125 \) and \( (1 - 0.5)^2(0.5) = 0.125 \)
3
Variance: \( \sigma^2 = 0.125 + 0.125 = \) \( 0.25 \)

Example 2: Rolling a Die

Let \( X = \) outcome of a fair six-sided die. Each value has probability \( \frac{1}{6} \).

1
Mean: \( \mu = \frac{1+2+3+4+5+6}{6} = \) \( 3.5 \)
2
Using the shortcut: \( E(X^2) = \frac{1+4+9+16+25+36}{6} = \frac{91}{6} \approx 15.167 \)
3
Variance: \( \sigma^2 = 15.167 - (3.5)^2 = 15.167 - 12.25 = \) \( \frac{35}{12} \approx 2.917 \)

Example 3: Custom Distribution

A random variable \( X \) has the following distribution:

\( x \) 1 3 5
\( P(X=x) \) 0.2 0.5 0.3
1
Mean: \( \mu = 1(0.2) + 3(0.5) + 5(0.3) = 0.2 + 1.5 + 1.5 = \) \( 3.2 \)
2
Squared deviations: \( (1-3.2)^2(0.2) = 0.968 \), \( (3-3.2)^2(0.5) = 0.02 \), \( (5-3.2)^2(0.3) = 0.972 \)
3
Variance: \( \sigma^2 = 0.968 + 0.02 + 0.972 = \) \( 1.96 \)

Visualizing Variance

x P(x) Low σ² High σ² μ

Linear Transform Rule

If you transform a random variable \( X \) by multiplying by \( a \) and adding \( b \):

Adding a constant
\( \text{Var}(X + 5) = \text{Var}(X) \). Shifting all values does not change spread.
Multiplying by a constant
\( \text{Var}(3X) = 9 \cdot \text{Var}(X) \). Scaling by \( a \) scales variance by \( a^2 \).

For standard deviation: \( \text{SD}(aX + b) = |a| \cdot \text{SD}(X) \). The square root removes the squaring.

Variance of Sums

When we add two independent random variables:

Variances add
Even for \( X - Y \): \( \text{Var}(X - Y) = \text{Var}(X) + \text{Var}(Y) \) when independent
SDs do NOT add
\( \sigma_{X+Y} = \sqrt{\sigma_X^2 + \sigma_Y^2} \neq \sigma_X + \sigma_Y \)

Common Mistakes

✕ Adding Standard Deviations
Students write \( \sigma_{X+Y} = \sigma_X + \sigma_Y \). Wrong: variances add, not standard deviations.
✕ Forgetting to Square \( a \)
In \( \text{Var}(aX) = a^2 \text{Var}(X) \), some forget to square \( a \) and write \( a \cdot \text{Var}(X) \).
✕ Subtracting Variances
For \( X - Y \), students subtract variances. But \( \text{Var}(X-Y) = \text{Var}(X) + \text{Var}(Y) \) when independent.

Question 1 of 5

If \( X \) has \( \text{Var}(X) = 4 \), what is \( \text{Var}(3X) \)?

Question 2 of 5

A random variable \( X \) takes value 2 with probability 0.5 and value 6 with probability 0.5. What is \( \text{Var}(X) \)?

Question 3 of 5

If \( X \) and \( Y \) are independent with \( \text{Var}(X) = 5 \) and \( \text{Var}(Y) = 3 \), what is \( \text{Var}(X - Y) \)?

Question 4 of 5

What is \( \text{Var}(X + 10) \) if \( \text{Var}(X) = 7 \)?

Question 5 of 5

Which formula correctly computes the variance of a discrete random variable using the shortcut method?