Expectation & Variance

Understanding the center and spread of data. The two most important numbers in statistics.

1. Expectation (The Mean)

The Expectation, or expected value, \( E[X] \), is the weighted average of all possible values. It represents the "center of mass" of the distribution.

$$ E[X] = \sum_{x} x \cdot P(X=x) $$

Visualizing the Mean as a Balance Point

Drag the weights (blue circles) along the number line. The fulcrum (triangle) moves to the center of mass (the mean).

Mean: 5.0
010

2. Variance & Standard Deviation

Variance measures how spread out the data is. It is the average squared distance from the mean.

Variance

$$ \text{Var}(X) = E[(X - \mu)^2] $$ $$ \text{Var}(X) = E[X^2] - (E[X])^2 $$

Standard Deviation

$$ \sigma = \sqrt{\text{Var}(X)} $$

Same units as X!

Visualizing Spread

Move the points. Notice how points further from the mean increase the variance much more than points close to it (due to squaring).

Mean
0.0
Variance
0.0
Std Dev
0.0

3. Key Properties

Linearity of Expectation

Expectation is a linear operator. This is incredibly useful!

E[aX + b] = aE[X] + b
E[X + Y] = E[X] + E[Y]

Properties of Variance

Variance is NOT linear. Constants disappear, and scaling is squared.

Var(X + c) = Var(X)
Var(aX) = a²Var(X)