The Central Idea

Let \(X\) be a random variable with mean

\[ \mu=\mathbb{E}[X]. \]

The variance of \(X\) is the expected squared distance from the mean:

\[ \boxed{\operatorname{Var}(X)=\mathbb{E}\left[(X-\mu)^2\right]}. \]

The standard deviation is the positive square root of the variance:

\[ \boxed{\sigma_X=\sqrt{\operatorname{Var}(X)}}. \]

Why We Need a Measure of Spread

Two random variables can have the same expected value while behaving very differently.

Suppose

\[ P(X=10)=1 \]

while

\[ P(Y=0)=\frac12,\qquad P(Y=20)=\frac12. \]

Both have expected value \(10\), but \(X\) never moves away from the mean while \(Y\) is always \(10\) units away.

Variance distinguishes these distributions.

Deviation from the Mean

The quantity

\[ X-\mu \]

is the deviation from the mean.

If \(X>\mu\), the deviation is positive. If \(X<\mu\), the deviation is negative.

Why Ordinary Deviations Do Not Work

The expected deviation from the mean is always zero:

\[ \mathbb{E}[X-\mu] = \mathbb{E}[X]-\mu = \mu-\mu = 0. \]

Positive and negative deviations cancel, so they cannot directly measure spread.

Why We Square the Deviations

Squaring makes every deviation nonnegative:

\[ (X-\mu)^2\ge0. \]

Larger deviations also receive greater weight because squaring magnifies their contribution.

Discrete Variance Formula

For a discrete random variable,

\[ \boxed{ \operatorname{Var}(X) = \sum_x (x-\mu)^2P(X=x) }. \]

Example: A Simple Discrete Distribution

Suppose

\[ P(X=0)=0.25,\qquad P(X=2)=0.50,\qquad P(X=4)=0.25. \]

First find the mean:

\[ \mu = 0(0.25)+2(0.50)+4(0.25) = 2. \]

Compute the Squared Deviations

\[ (0-2)^2=4,\qquad (2-2)^2=0,\qquad (4-2)^2=4. \]

Weight them by their probabilities:

\[ \operatorname{Var}(X) = 4(0.25)+0(0.50)+4(0.25) = \boxed{2}. \]

Standard Deviation of the Example

Since \(\operatorname{Var}(X)=2\),

\[ \boxed{\sigma_X=\sqrt2\approx1.414}. \]

The Computational Variance Formula

Expanding the squared deviation leads to a second useful formula:

\[ \boxed{ \operatorname{Var}(X) = \mathbb{E}[X^2]-\bigl(\mathbb{E}[X]\bigr)^2 }. \]

Why the Computational Formula Is Useful

Instead of calculating every deviation from the mean directly, compute \(\mathbb{E}[X]\) and \(\mathbb{E}[X^2]\), then subtract the square of the mean.

Example Using \(\mathbb{E}[X^2]\)

For the preceding distribution,

\[ \mathbb{E}[X^2] = 0^2(0.25)+2^2(0.50)+4^2(0.25) = 6. \]

Therefore,

\[ \operatorname{Var}(X)=6-2^2=\boxed{2}. \]

Variance Is Always Nonnegative

Because variance is the expectation of a squared quantity,

\[ \boxed{\operatorname{Var}(X)\ge0}. \]

A negative variance is impossible.

When Variance Is Zero

Variance is zero exactly when the random variable is constant with probability \(1\).

If \(P(X=c)=1\), then

\[ \boxed{\operatorname{Var}(X)=0}. \]

Variance and Units

Variance is measured in the square of the original units.

Why Standard Deviation Is Easier to Interpret

Standard deviation removes the squared units:

\[ \sigma_X=\sqrt{\operatorname{Var}(X)}. \]

It therefore has the same units as the random variable and provides a natural scale for spread.

Variance for Continuous Random Variables

If \(X\) is continuous with density \(f_X(x)\), then

\[ \boxed{ \operatorname{Var}(X) = \int_{-\infty}^{\infty}(x-\mu)^2f_X(x)\,dx }. \]

Equivalently,

\[ \boxed{ \operatorname{Var}(X) = \int_{-\infty}^{\infty}x^2f_X(x)\,dx-\mu^2 }. \]

Example: Uniform Distribution on \([0,4]\)

Suppose

\[ f_X(x)= \begin{cases} \frac14, & 0\le x\le4,\\ 0, & \text{otherwise}. \end{cases} \]

We know \(\mu=2\). Also,

\[ \mathbb{E}[X^2] = \int_0^4x^2\left(\frac14\right)\,dx = \frac{16}{3}. \]

Therefore,

\[ \boxed{\operatorname{Var}(X)=\frac43} \]

and

\[ \boxed{\sigma_X=\sqrt{\frac43}=\frac{2}{\sqrt3}}. \]

Effect of Adding a Constant

If \(Y=X+b\), every value and the mean shift by the same amount, so the deviations do not change.

\[ \boxed{\operatorname{Var}(X+b)=\operatorname{Var}(X)}. \]

Effect of Multiplying by a Constant

If \(Y=aX\), every deviation is multiplied by \(a\). Squaring multiplies variance by \(a^2\):

\[ \boxed{\operatorname{Var}(aX)=a^2\operatorname{Var}(X)}. \]

Standard Deviation Under Scaling

\[ \boxed{\sigma_{aX}=|a|\sigma_X}. \]

The absolute value appears because standard deviation cannot be negative.

General Linear Transformation

For \(Y=aX+b\),

\[ \boxed{\operatorname{Var}(Y)=a^2\operatorname{Var}(X)} \]

and

\[ \boxed{\sigma_Y=|a|\sigma_X}. \]

The shift \(b\) affects center but not spread.

Example: Linear Transformation

Suppose \(\operatorname{Var}(X)=9\) and \(Y=4X-7\). Then

\[ \operatorname{Var}(Y)=4^2(9)=\boxed{144} \]

and

\[ \boxed{\sigma_Y=12}. \]

Variance of a Sum

Variance is not generally linear. For two random variables,

\[ \operatorname{Var}(X+Y) = \operatorname{Var}(X) + \operatorname{Var}(Y) + 2\operatorname{Cov}(X,Y). \]

The covariance term measures how the variables vary together.

Variance of Sums of Independent Random Variables

If \(X\) and \(Y\) are independent with finite variances, then

\[ \boxed{ \operatorname{Var}(X+Y) = \operatorname{Var}(X)+\operatorname{Var}(Y) }. \]

Variance of a Difference

If \(X\) and \(Y\) are independent, then

\[ \boxed{ \operatorname{Var}(X-Y) = \operatorname{Var}(X)+\operatorname{Var}(Y) }. \]

The minus sign disappears after squaring.

Bernoulli Variance

If \(X\) is Bernoulli with success probability \(p\), then \(\mathbb{E}[X]=p\) and \(X^2=X\).

Therefore,

\[ \boxed{\operatorname{Var}(X)=p(1-p)}. \]

Binomial Variance

If

\[ X\sim\operatorname{Binomial}(n,p), \]

then

\[ \boxed{\operatorname{Var}(X)=np(1-p)} \]

and

\[ \boxed{\sigma_X=\sqrt{np(1-p)}}. \]

Variance Measures Dispersion Around the Mean

Larger variance generally means more probability is located farther from the mean. Smaller variance indicates tighter concentration near the mean.

Standard Deviation as a Characteristic Scale

Standard deviation provides a characteristic scale for spread around the mean.

It does not mean that every outcome lies exactly one standard deviation from the mean.

Comparing Spread Across Distributions

When two random variables use the same units, their standard deviations provide a direct comparison of the scale of variation.

Variance Does Not Determine the Distribution

Different distributions can have the same mean and variance.

Mean and variance are important summaries, but they do not completely specify a probability distribution.

Variance and Tail Behavior

Variance is sensitive to large deviations because those deviations are squared.

Rare outcomes far from the mean can therefore make substantial contributions to variance.

Finite Mean Does Not Guarantee Finite Variance

Some distributions have finite expected value but infinite variance.

This can happen when the tails are heavy enough that \(\mathbb{E}[X^2]\) diverges.

Common Error: Averaging Unsquared Deviations

The expected ordinary deviation from the mean is zero:

\[ \mathbb{E}[X-\mu]=0. \]

Variance uses squared deviations to prevent cancellation.

Common Error: Forgetting the Probability Weights

For a discrete random variable, use

\[ \operatorname{Var}(X)=\sum_x(x-\mu)^2P(X=x). \]

Squared deviations should not be averaged equally unless the outcomes are equally likely.

Common Error: Using \(\mathbb{E}[X^2]\) as the Variance

The correct formula is

\[ \operatorname{Var}(X) = \mathbb{E}[X^2]-\bigl(\mathbb{E}[X]\bigr)^2. \]

Common Error: Confusing \(\mathbb{E}[X^2]\) with \((\mathbb{E}[X])^2\)

These are generally different quantities and should be computed separately.

Common Error: Letting Variance Be Negative

Variance cannot be negative. A negative result signals an arithmetic or algebraic error.

Common Error: Treating Standard Deviation as Variance

Variance and standard deviation are related by

\[ \sigma_X=\sqrt{\operatorname{Var}(X)}. \]

Variance uses squared units; standard deviation uses original units.

Common Error: Adding Standard Deviations

Even for independent variables, standard deviations generally do not add.

Independent variances add instead.

Common Error: Forgetting the Square on a Scale Factor

If \(Y=aX+b\), then

\[ \operatorname{Var}(Y)=a^2\operatorname{Var}(X), \]

not \(a\operatorname{Var}(X)\).

A Reliable Procedure Using Squared Deviations

  1. Find \(\mu=\mathbb{E}[X]\).
  2. Compute each deviation \(x-\mu\).
  3. Square each deviation.
  4. Weight by the corresponding probability or density.
  5. Add or integrate across the full distribution.
  6. Take the square root if standard deviation is required.
  7. Interpret variance in squared units and standard deviation in original units.

A Reliable Procedure Using the Computational Formula

  1. Compute \(\mathbb{E}[X]\).
  2. Compute \(\mathbb{E}[X^2]\).
  3. Square the mean.
  4. Subtract \((\mathbb{E}[X])^2\) from \(\mathbb{E}[X^2]\).
  5. Check that the result is nonnegative.
  6. Take the positive square root for standard deviation.

Practice 1: Two-Point Distribution

Suppose

\[ P(X=0)=\frac12,\qquad P(X=4)=\frac12. \]

Find \(\mathbb{E}[X]\), \(\operatorname{Var}(X)\), and \(\sigma_X\).

Practice 2: Use the Computational Formula

Suppose

\[ \mathbb{E}[X]=3,\qquad \mathbb{E}[X^2]=13. \]

Find \(\operatorname{Var}(X)\).

Practice 3: Standard Deviation

Suppose \(\operatorname{Var}(X)=25\). Find \(\sigma_X\).

Practice 4: Constant Random Variable

Suppose \(P(X=7)=1\). Find the variance and standard deviation.

Practice 5: Linear Transformation

Suppose \(\operatorname{Var}(X)=4\) and \(Y=3X+10\). Find \(\operatorname{Var}(Y)\) and \(\sigma_Y\).

Practice 6: Independent Sum

Suppose independent random variables satisfy

\[ \operatorname{Var}(X)=5,\qquad \operatorname{Var}(Y)=7. \]

Find \(\operatorname{Var}(X+Y)\).

Practice 7: Bernoulli Variance

Let \(X\) be Bernoulli with \(p=0.4\). Find \(\operatorname{Var}(X)\).

Practice 8: Binomial Variance

Let

\[ X\sim\operatorname{Binomial}(20,0.3). \]

Find the mean, variance, and standard deviation.

Practice 9: Continuous Variance

Let \(X\) be uniform on \([0,2]\), so

\[ f_X(x)= \begin{cases} \frac12, & 0\le x\le2,\\ 0, & \text{otherwise}. \end{cases} \]

Find \(\operatorname{Var}(X)\).

Practice 10: Identify the Error

A student calculates \(\operatorname{Var}(X)=-2\) and reports the answer.

Explain why the result cannot be correct.

Practice Answers

Practice 1

\[ \mathbb{E}[X] = 0\left(\frac12\right) + 4\left(\frac12\right) = 2. \] \[ \operatorname{Var}(X) = (0-2)^2\left(\frac12\right) + (4-2)^2\left(\frac12\right) = \boxed{4}. \] \[ \boxed{\sigma_X=2}. \]

Practice 2

\[ \operatorname{Var}(X) = 13-3^2 = \boxed{4}. \]

Practice 3

\[ \boxed{\sigma_X=5}. \]

Practice 4

\[ \boxed{\operatorname{Var}(X)=0},\qquad \boxed{\sigma_X=0}. \]

Practice 5

\[ \operatorname{Var}(Y) = 3^2(4) = \boxed{36}. \] \[ \boxed{\sigma_Y=6}. \]

Practice 6

\[ \operatorname{Var}(X+Y)=5+7=\boxed{12}. \]

Practice 7

\[ \operatorname{Var}(X)=0.4(0.6)=\boxed{0.24}. \]

Practice 8

\[ \mathbb{E}[X]=np=20(0.3)=6. \] \[ \operatorname{Var}(X)=np(1-p)=20(0.3)(0.7)=4.2. \] \[ \sigma_X=\sqrt{4.2}\approx2.049. \]

Practice 9

For the uniform distribution on \([0,2]\), \(\mathbb{E}[X]=1\). Also,

\[ \mathbb{E}[X^2] = \int_0^2x^2\left(\frac12\right)\,dx = \frac43. \]

Therefore,

\[ \boxed{\operatorname{Var}(X)=\frac13}. \]

Practice 10

Variance is an expected squared deviation and therefore cannot be negative. A value of \(-2\) indicates an arithmetic or algebraic error.

What to Remember

Variance measures average squared distance from the mean:

\[ \boxed{ \operatorname{Var}(X) = \mathbb{E}\left[(X-\mu)^2\right] }. \]

The computational formula is

\[ \boxed{ \operatorname{Var}(X) = \mathbb{E}[X^2]-\bigl(\mathbb{E}[X]\bigr)^2 }. \]

Standard deviation is

\[ \boxed{\sigma_X=\sqrt{\operatorname{Var}(X)}}. \]

Under a linear transformation,

\[ \boxed{\operatorname{Var}(aX+b)=a^2\operatorname{Var}(X)} \]

and

\[ \boxed{\sigma_{aX+b}=|a|\sigma_X}. \]

The central interpretation is: variance measures squared spread around the mean, while standard deviation expresses that spread on the original scale of the random variable.

Where We Go Next

Mean and variance summarize a probability distribution, but many important applications depend on recognizable distribution families with specific structural assumptions.

The next lesson, Bernoulli and Binomial Distributions, develops the basic probability models for single successes and repeated independent trials.