## Definition ==Variance== measures the spread of a random variable around its mean. For a random variable $X$ with mean $\mu = E[X]$: $ \text{Var}(X) = E[(X - \mu)^2] = E[X^2] - (E[X])^2 $ A larger variance indicates more dispersion; variance is always non-negative and has units that are the square of the original variable's units. > [!example]- A random variable takes value 2 with probability 0.5 and value 8 with probability 0.5. What is its variance? > $E[X] = 2(0.5) + 8(0.5) = 5$ > $E[X^2] = 4(0.5) + 64(0.5) = 34$ > $ \text{Var}(X) = E[X^2] - (E[X])^2 = 34 - 25 = 9 $