Variance measures spread around the mean:

Var(X) = Σ(x-μ)²·P(x)

Each squared deviation is weighted by its probability.

Example

Use weighted squared deviations from the mean.

highlighted = computed this step

Step 1 — Mean

Start with the mean.

μ=1\mu= \hl{1}

Step 2 — First weighted square

Compute deviation, square, and weighted term.

xPdevsqterm0141114112214\begin{array}{ccccc}\text{x} & \text{P} & \text{dev} & \text{sq} & \text{term} \\ 0 & \frac{1}{4} & \hlmath{-1} & \hlmath{1} & \hlmath{\frac{1}{4}} \\ 1 & \frac{1}{2} & \square & \square & \square \\ 2 & \frac{1}{4} & \square & \square & \square\end{array}

Step 3 — Second weighted square

Compute deviation, square, and weighted term.

xPdevsqterm0141114112000214\begin{array}{ccccc}\text{x} & \text{P} & \text{dev} & \text{sq} & \text{term} \\ 0 & \frac{1}{4} & -1 & 1 & \frac{1}{4} \\ 1 & \frac{1}{2} & \hlmath{0} & \hlmath{0} & \hlmath{0} \\ 2 & \frac{1}{4} & \square & \square & \square\end{array}

Step 4 — Third weighted square

Compute deviation, square, and weighted term.

xPdevsqterm01411141120002141114\begin{array}{ccccc}\text{x} & \text{P} & \text{dev} & \text{sq} & \text{term} \\ 0 & \frac{1}{4} & -1 & 1 & \frac{1}{4} \\ 1 & \frac{1}{2} & 0 & 0 & 0 \\ 2 & \frac{1}{4} & \hlmath{1} & \hlmath{1} & \hlmath{\frac{1}{4}}\end{array}

Step 5 — Variance

Add weighted square terms for variance.

Var(X)=14+0+14=12Var(X)= \frac{1}{4} + 0 + \frac{1}{4} = \hlmath{\frac{1}{2}}
variance-of-random-variable Var(X) = Σ(x-μ)²·P(x)