# What makes a deviation standard? There are numerous ways to measure the spread of a distribution. In the notes provided below we look at two of them: (1) the variance of a distribution, which is the expected squared distance from its mean value; and (2) the standard deviation of a distribution, which is the square root of its variance. For mathematical reasons, the variance is easier to compute, but from a scientific perspective, variance has the wrong units: if your random variable models something that can be measured in meters, then its variance will be expressed in terms of square-meters. If we decide that average squared-distance from the mean is good, then we need to take its square root to get something measured in the original units.. >[!QUOTE] Definition: Variance and Standard Deviation >Let $X$ be a discrete random variable with state space $\mathcal{S}$. The *variance* of $X$ is its average squared distance from its mean $\mu_X$. >$ >\begin{aligned} >\mathrm{Var}(X) &\coloneqq \sum_{x \in \mathcal{S}} (x - \mu_X)^2 P(X = x)\\ >&= \mathbb{E}\big((X - \mu_X)^2\big). >\end{aligned} >$ >Its *standard deviation* is $\sigma_X = \mathbb{SD}(X) \coloneqq \sqrt{\mathrm{Var}(X)}.$ We often use the notation $\sigma_X^2$ for the variance of $X$. While the definition of variance is good for intuition, it is sometimes cumbersome to work with. Therefore, in practice, we commonly use the following equivalent formula >[!NOTE] Computational formula for variance >Let $X$ be a discrete random variable with state space $S$ with mean $\mu_X$. Then >$ >\mathrm{Var}(X) = \mathbb{E}(X^2) - \mu_X^2. >$ The proof is relatively simple, so we include it here. The idea is to use the FOIL method and simplify carefully. The most challenging part for beginners is to remember that the expected value of a deterministic quantity is the quantity itself. For example, if $a$ is a real number, then $\mathbb{E}(a) = a$. Even though $\mu_X$ is derived from a random variable, the value itself is deterministic. So, $\mathbb{E}(\mu_X) = \mu_X$. We this in mind, we can proceed. *Proof.* $ \begin{aligned} \mathrm{Var}(X) &= \mathbb{E}\big((X - \mu_X)^2\big) \\ &= \mathbb{E}\big(X^2 - 2 X \mu_X + \mu_X^2\big) & \mathrm{FOIL} \\ &= \mathbb{E}(X^2) - \mathbb{E}(2 X \mu_X) + \mathbb{E}(\mu_X^2) & \text{Linearity of expectation} \\ &= \mathbb{E}(X^2) - 2 \mu_X \mathbb{E}(X) + \mu_X^2 & \text{Expectation of constants} \\ &= \mathbb{E}(X^2) - 2 \mu_X^2 + \mu_X^2 & \text{Definition of } \mu_X \\ &= \mathbb{E}(X^2) - \mu_X^2 & \sim\sim\sim \end{aligned} $ In the following worksheets we develop these ideas in detail. ![[Companion_2_2.pdf]]