# Lesson Video: Variance of Discrete Random Variables Mathematics

In this video, we will learn how to calculate the variance of discrete random variables.

15:25

### Video Transcript

In this video, we will learn how to calculate the variance of discrete random variables. We will begin by recalling what we mean by a discrete random variable.

A discrete random variable has a countable number of possible values. The probability of each value lies between zero and one, and the sum of all the probabilities is equal to one. This can be summarized as shown, where the discrete random variable has probability values equal to 𝑓 of 𝑥 sub 𝑖.

We often set out these questions in tabular form. If we have a discrete random variable 𝑥 with four possible values, 𝑥 sub one to 𝑥 sub four, where the probability of each of the outcomes is equal to 𝑝 sub one to 𝑝 sub four, respectively, we know that the expected value or mean can be calculated by summing all the 𝑥-values multiplied by their associated probabilities. This can be rewritten as the general formula 𝐸 of 𝑋, the expected value, is equal to the sum of 𝑥 sub 𝑖 multiplied by 𝑝 sub 𝑖, where 𝑖 takes values from one to 𝑛. This expected value or mean is also sometimes denoted by the Greek letter 𝜇.

Before moving on to the variance, it is also important to recall that the 𝐸 of 𝑋 squared is equal to the sum of 𝑥 sub 𝑖 squared multiplied by 𝑝 sub 𝑖, where once again 𝑖 takes values between one and 𝑛. This is true as if we consider a different random variable 𝑦, which takes values which are the square of our random variable 𝑥, then the probability of each value for our new variable will be the same as the probability of each 𝑥-value for our original variable. This means that we follow the same pattern when calculating 𝐸 of 𝑋, 𝐸 of 𝑋 squared, 𝐸 of 𝑋 cubed, and so on. We will now look at a definition of the variance and a formula we can use to calculate it.

The variance of a discrete random variable measures the amount of dispersion of the discrete random variable from its expected value. This variance is often written Var of 𝑋 or 𝜎 squared, where 𝜎 is the standard deviation of the discrete random variable. There are a couple of formulae that we can use to calculate this variance. In this video, we will focus on the formula that the variance of 𝑋 is equal to the 𝐸 of 𝑋 squared minus the 𝐸 of 𝑋 all squared. This is also sometimes referred to as the mean of the squares minus the square of the means, where 𝐸 of 𝑋 represents the mean 𝜇. We will now look at a question where we can use this formula to calculate the variance.

Let 𝑋 denote a discrete random variable which can take the values two, three, five, and eight. Given that the probability that 𝑋 equals two is one twenty-fourth, the probability that 𝑋 equals three is equal to five twelfths, the probability that 𝑋 equals five is three-eighths, and the probability that 𝑋 equals eight is one-sixth, find the variance of 𝑋. Give your answer to two decimal places.

We can begin by drawing a table with two rows. The top row will contain the values that the discrete random variable 𝑥 can take, in this case, two, three, five, and eight. In the bottom row, we have the corresponding probabilities. We are asked to calculate the variance of 𝑋, and we know this is equal to 𝐸 of 𝑋 squared minus 𝐸 of 𝑋 all squared. We can therefore begin by calculating the expected value or mean of 𝑋. 𝐸 of 𝑋 is equal to the sum of 𝑥 sub 𝑖 multiplied by 𝑝 sub 𝑖, where 𝑖 takes values from one to 𝑛. In this question, 𝑛 is equal to four as there are four possible values of 𝑥. 𝐸 of 𝑋 is therefore equal to two multiplied by one twenty-fourth plus three multiplied by five twelfths plus five multiplied by three-eighths plus eight multiplied by one-sixth. This is equal to 109 over 24.

We will now clear some space and recall how we can calculate 𝐸 of 𝑋 squared. To calculate 𝐸 of 𝑋 squared, we simply square each of our 𝑥-values and then multiply them by the corresponding probabilities. We then sum each of these values once again. 𝐸 of 𝑋 squared is equal to the calculation shown. This gives us an answer of 575 over 24. The mean of the squares 𝐸 of 𝑋 squared is equal to 575 over 24. We can now substitute in both of these values to calculate the variance. The variance of 𝑋 is equal to 575 over 24 minus 109 over 24 squared. This is equal to 1919 over 576. We are asked to give our answer to two decimal places. Therefore, the variance of the discrete random variable 𝑋 is equal to 3.33.

We will now look at some key rules that we need to remember when calculating the mean and variance of linear functions of discrete random variables. In the next section of the video, we will consider how we can calculate the expected value and variance of the following linear functions: 𝑋 plus 𝑎, 𝑋 minus 𝑎, and 𝑎𝑋, where 𝑎 is a constant or scalar value. We will consider these scenarios using a practical example. Suppose that the discrete random variable 𝑋 refers to the distance between the top of a person’s head and the ground. A group of three people is illustrated as shown. The mean or expected value of the heights above the ground is shown.

Now let’s assume that the three people stand on a platform that is 20 centimeters high. Since they are all standing on the platform, the value of 𝑋 for each person has increased by 20 centimeters. And therefore, the average value has also increased by 20 centimeters. However, the new values of 𝑋 are no more variable than the old ones, since the individual distances from the mean height are the same as they were before. This means that the 𝐸 of 𝑋 plus 𝑎 will be equal to the 𝐸 of 𝑋 plus the constant 𝑎, whereas the variance of 𝑋 plus 𝑎 will be the same as the variance of 𝑋. Adding a positive constant increases the mean but doesn’t affect the variance.

Let’s now consider a similar scenario where this time the three people stand in a ditch that is 10 centimeters deep. This time, each value of 𝑋 has decreased by 10 centimeters. Therefore, the average of 𝑋 has also decreased by 10 centimeters. Once again, though, the variability of the values of 𝑋 is unaffected. We can therefore conclude that the 𝐸 of 𝑋 minus 𝑎 is equal to 𝐸 of 𝑋 minus the constant 𝑎, and the variance of 𝑋 minus 𝑎 is equal to the variance of 𝑋.

The third scenario is slightly more complex and requires some out-of-the-box thinking. For simplicity here, we will assume that 𝑎 is equal to two and that each of the people shown in the first diagram was one of a pair of identical twins. If we assume that they were very good gymnasts as shown, we can let the distance between the top of the twins’ feet and the ground be the variable 𝑌. This means that 𝑌 is equal to two 𝑋, where 𝑋 was the height of one of the twins. This means that the average of the 𝑌-values must be double the average of the 𝑋-values. This leads us to the general rule that 𝐸 of 𝑎𝑋 is equal to 𝑎 multiplied by the 𝐸 of 𝑋. It also holds that the 𝐸 of 𝑎 squared 𝑋 squared is equal to 𝑎 squared multiplied by the 𝐸 of 𝑋 squared.

We can now use both of these equations to help us work out the general rule for the variance of 𝑎𝑋. We will let 𝑌 equal 𝑎𝑋 and denote 𝐸 of 𝑋 by 𝜇. We know that the variance of 𝑋 is equal to 𝐸 of 𝑋 squared minus 𝜇 squared. We also know that the 𝐸 of 𝑌 must be equal to 𝑎 multiplied by 𝜇. The variance of 𝑌 is equal to 𝐸 of 𝑌 squared minus 𝐸 of 𝑌 all squared. The right-hand side simplifies to 𝐸 of 𝑎 squared 𝑋 squared minus 𝑎𝜇 all squared. This in turn can be written as 𝑎 squared multiplied by 𝐸 of 𝑋 squared minus 𝑎 squared multiplied by 𝜇 squared.

We can then factor out 𝑎 squared, so we have 𝑎 squared multiplied by 𝐸 of 𝑋 squared minus 𝜇 squared. The expression in the square bracket is equal to the variance of 𝑋. The variance of 𝑌 is therefore equal to 𝑎 squared multiplied by the variance of 𝑋. This leads us to the general rule that the variance of 𝑎𝑋 is equal to 𝑎 squared multiplied by the variance of 𝑋. Before considering our next example, we will quote two formulae that can be used when dealing with two different discrete random variables. If 𝑋 and 𝑌 are two independent discrete random variables, then 𝐸 of 𝑋 plus 𝑌 is equal to 𝐸 of 𝑋 plus 𝐸 of 𝑌, and the variance of 𝑋 plus 𝑌 is equal to the variance of 𝑋 plus the variance of 𝑌.

We will now look at an example that uses a combination of these rules.

Suppose 𝑋 and 𝑌 are independent, the variance of 𝑋 equals 24, and the variance of 𝑌 equals 30. Determine the variance of seven 𝑋 plus nine 𝑌.

In this question, we are given information about the variance of two independent random variables 𝑋 and 𝑌. We can answer this question by recalling two key formulae. Firstly, the variance of 𝑋 plus 𝑌 is equal to the variance of 𝑋 plus the variance of 𝑌. This holds when 𝑋 and 𝑌 are independent. The variance of the sum is equal to the sum of the variances. Secondly, we have that the variance of 𝑎𝑋 is equal to 𝑎 squared multiplied by the variance of 𝑋, where 𝑎 is a constant.

Using the first formula, we can rewrite our expression, the variance of seven 𝑋 plus nine 𝑌, as the variance of seven 𝑋 plus the variance of nine 𝑌. Each of the terms on the right-hand side can be rewritten using the second formula. The variance of seven 𝑋 is equal to seven squared multiplied by the variance of 𝑋, and the variance of nine 𝑌 is equal to nine squared multiplied by the variance of 𝑌. Substituting in the values for the variance of 𝑋 and variance of 𝑌, we have 49 multiplied by 24 plus 81 multiplied by 30. This is equal to 3606. If the variance of 𝑋 equals 24 and the variance of 𝑌 equals 30, where 𝑋 and 𝑌 are independent, then the variance of seven 𝑋 plus nine 𝑌 is 3606.

We will now summarize the key points from this video. We saw in this video that the variance of a discrete random variable measures the amount of dispersion of the discrete random variable from its expected value and is denoted as Var of 𝑋 or 𝜎 squared. We can calculate the variance of 𝑋 using the formula shown. It is the 𝐸 of 𝑋 squared minus the 𝐸 of 𝑋 all squared. This is often referred to as the mean of the squares minus the square of the mean. We also saw that the variance of 𝑋 plus or minus some constant 𝑎 is equal to the variance of 𝑋. The variance of 𝑎𝑋, where once again 𝑎 is some constant, is equal to 𝑎 squared multiplied by the variance of 𝑋. Finally, when 𝑋 and 𝑌 are independent discrete random variables, the variance of 𝑋 plus 𝑌 is equal to the variance of 𝑋 plus the variance of 𝑌.