# Question Video: The Formula for Calculating the Variance of a Discrete Random Variable Mathematics

Which of the following is the formula we use to calculate the variance of a discrete random variable 𝑋? [A] Var (𝑋) = 𝐸(𝑋)² − 𝐸(𝑋²) [B] Var (𝑋) = 𝐸(𝑋²) + 𝐸(𝑋)² [C] Var (𝑋) = 𝐸(𝑋²) − 𝐸(𝑋)² [D] Var (𝑋) = 𝐸(𝑋) − 𝐸(𝑋)² [E] Var (𝑋) = 𝐸(𝑋) + 𝐸(𝑋)²

04:56

### Video Transcript

Which of the following is the formula we use to calculate the variance of a discrete random variable 𝑋? (a) The variance of 𝑋 equals the expected value of 𝑋 squared minus the expected value of 𝑋 squared. (b) The variance of 𝑋 equals the expected value of 𝑋 squared plus the expected value of 𝑋 squared. (c) The variance of 𝑋 equals the expected value of 𝑋 squared minus the expected value of 𝑋 squared. (d) The variance of 𝑋 equals the expected value of 𝑋 minus the expected value of 𝑋 squared. Or (e) the variance of 𝑋 equals the expected value of 𝑋 plus the expected value of 𝑋 squared.

Before we discuss the formula for finding the variance, let’s just be clear on the different notation used in the five options given. 𝐸 of 𝑋 squared means we find the expected value of 𝑋 first, and then we square this value, whereas 𝐸 of 𝑋 squared means we find the squared values of 𝑋 first and then calculate their expectation. It’s sometimes helpful to think of these as the square of the expectation and the expectation of the squares.

Now we’re asked to determine the formula we use to calculate the variance of a discrete random variable. Now the variance is a measure of the extent to which values of that variable differ from their expected value, which we denote as 𝜇. We can denote this either as Var of 𝑋 or as 𝜎 squared or sometimes 𝜎 sub 𝑋 squared if there are multiple variables in the same problem. The formula for calculating the variance from first principles is the variance of 𝑋 is equal to the expected value of 𝑋 minus 𝜇 squared, where 𝜇 is the expected value of 𝑋, which we calculate using the formula the sum of each 𝑥-value in the range of the discrete random variable multiplied by the probability that 𝑋 is equal to that value.

Another way of writing this is as the sum of 𝑥 minus 𝜇 squared multiplied by the probability that 𝑋 is equal to 𝑥. This means that we subtract the expected value 𝜇 from each value that the discrete random variable can take, square these values, multiply by the probability that 𝑋 is equal to that value, and then add them all up. Returning to the formula we first wrote down though, we can manipulate this. We’ll begin by distributing the inner parentheses, so we square 𝑋 minus 𝜇. This gives the expected value of 𝑋 squared minus two 𝜇𝑋 plus 𝜇 squared. As the expectation is linear, this can be distributed over the brackets. So we have the expected value of 𝑋 squared minus the expected value of two 𝜇𝑋 plus the expected value of 𝜇 squared.

Now 𝜇 is just a constant. So the expected value of 𝜇 squared is just 𝜇 squared. And in the second term, we can bring two 𝜇 outside the front of the expectation. So we have the expected value of 𝑋 squared minus two 𝜇 multiplied by the expected value of 𝑋 plus 𝜇 squared. But 𝜇, remember, is the expected value of 𝑋, so we can replace 𝜇 with 𝐸 of 𝑋. And we have 𝐸 of 𝑋 squared minus two 𝐸 of 𝑋 𝐸 of 𝑋 plus 𝐸 of 𝑋 squared. The term in the center becomes negative two multiplied by the expected value of 𝑋 squared, and we can then group the like terms. Negative two multiplied by 𝐸 of 𝑋 squared plus 𝐸 of 𝑋 squared is negative 𝐸 of 𝑋 squared. So the formula simplifies to the expected value of 𝑋 squared minus the expected value of 𝑋 squared.

Using the descriptions we wrote down earlier, we can think of this as the expectation of the squares minus the square of the expectation. Looking carefully at the five options we were given, it’s this one here: the variance of 𝑋 is equal to the expected value of 𝑋 squared minus the expected value of 𝑋 squared. The other options we were given do highlight various common mistakes. For example, in the first option, the terms have been subtracted in the wrong order. In the second option, the terms have been added instead of subtracted. In fact, the most common error isn’t actually given, which is to forget to square the second term. So the most common incorrect formula used in practice is the expected value of 𝑋 squared minus the expected value of 𝑋.

The correct answer is that the formula we use to calculate the variance of a discrete random variable 𝑋 is the variance of 𝑋 is equal to the expected value of 𝑋 squared minus the expected value of 𝑋 squared.