Lesson Video: Expected Values of Discrete Random Variables Mathematics

In this video, we will learn how to calculate the expected value from both a table and a graph and learn how to calculate the variance for a probability distribution.

16:00

Video Transcript

In this video, we’re going to learn how to calculate the expected value or the mean of discrete random variables from both their table and a graph. Let’s begin though by recalling what we mean by a discrete random variable of a probability distribution. A probability distribution describes the likelihood of obtaining the possible values that a random variable can assume. This can be given as a function, a table of values, or even in graph form. Then a discrete variable is a variable which can only take a countable number of values. In this example, 𝑥 is a discrete variable as it only takes the values one, two, three, four, five, and six.

In this video, we’re interested in finding a formula that can help us to find the expected value, denoted as 𝐸 of 𝑥, in other words to find the mean of a discrete random variable. To help us develop this formula, we’re going to look at an example.

An experiment produces the discrete random variable 𝑋 that has the probability distribution shown. If a very high number of trials were carried out, what would be the likely mean of all the outcomes?

Let’s imagine the experiment is spinning a spinner with the numbers two, three, four, and five on it. The table tells us the probability of achieving each score on a single spin. And so we see it’s much more likely, for instance, that the spinner lands on the five than it does on the two. Let’s add another table, showing the number of times we spin the spinner versus the number of times we expect it to land on each number. Let’s say we were to spin the spinner 10 times; 0.1 of those times we would expect the spinner to land on two. Well, 0.1 of 10 — in other words 0.1 times 10 — is one. Then 0.3 of the times, we would expect the spinner to land on three. 0.3 of 10 or 0.3 times 10 is three. 0.2 of the times, we expect the spinner to land on four, so that’s twice. And 0.4 of the times, that’s four times, we would expect the spinner to land on five.

Next, let’s think about what would happen if we were to spin it 20 times. 0.1 of those times, we would expect it to land on two, so that’s twice. Six times we expect the spinner to land on three, that’s 0.3 times 20. Four times, which is 0.2 times 20, we’d expect it to land on four. And 0.4 times 20 which is eight would be the number of times we’d expect it to land on five. But let’s imagine there are a very high number of trials, say 1000 trials. 0.1 times 1000 is 100. So we’d roughly expect the spinner to land on two 100 times. We’d expect it to land on three 300 times, we’d expect it to land on four 200 times, and we’d expect it to land on five 400 times.

Now, this is really useful as we can use these values to calculate the mean by using the rules for finding the mean from a frequency table. The formula we use to calculate the mean from a frequency table is the sum of 𝑓 times 𝑥 divided by the sum of 𝑥. The sum of 𝑥 is 1000. We’ve carried out 1000 trials. 𝑓 times 𝑥 will be two times 100, three times 300, four times 200, and five times 400. And so the sum of 𝑓𝑥 is the sum of all these products. And so we’re able to calculate the mean, which we call the expected value 𝐸 of 𝑥, as shown.

Now we will calculate this value in a moment, but we’re looking to find a rule for finding the expected value. So we’re going to split the fraction up a little bit. By reversing the process we perform when adding fractions, we can write it as two times 100 over 1000 plus three times 300 over 1000 and so on. And then we notice something. 100 divided by 1000 is 0.1. 300 divided by 1000 is 0.3. 200 divided by 1000 is 0.2. And 400 divided by 1000 is 0.4. And so another way to write our calculation for the mean is as two times 0.1 plus three times 0.3 plus four times 0.2 plus five times 0.4, and that’s equal to 3.9. And so, if a very high number of trials were carried out, the likely mean of all of our outcomes would actually be 3.9.

And by this stage, you might be spotting a pattern. Two times 0.1 is the product of 𝑥 and its corresponding 𝑝 of 𝑥. Three times 0.3 is also the product of 𝑥 and its corresponding 𝑝 of 𝑥. And so we notice that this is simply the sum of the product of the numbers in each column.

And so we’re able to generalize.

The expected value, sometimes called the mean of 𝑥, is denoted 𝐸 of 𝑥 or 𝜇 or 𝜇 sub 𝑥. It can be found by calculating the sum of the product of the variable 𝑥 and the probability of that variable occurring, 𝑃 of 𝑥 equals 𝑥. We write this as shown. 𝐸 of 𝑥 is the sum of 𝑥 times 𝑃 of 𝑥 equals 𝑥. Now that we have a formula, let’s see how we can apply this to finding the expected value of a discrete random variable given a graph.

Work out the expected value of the random variable 𝑋 whose probability distribution is shown.

The expected value denoted 𝐸 of 𝑥 can be found by calculating the sum of the product of the variable 𝑋 and the probability of that variable occurring. That’s represented as shown. And so a nice way to work out the expected value when given a graph is actually to construct a table. We see by looking at the 𝑥-axis that the random variable 𝑋 can take the values one, two, three, four, and five. We also see that every single one of the bars in our diagram has a height of 0.2. So the associated probability for each variable is in fact 0.2. Now, a quick way that we can check whether what we’ve done is likely to be correct is to check that the sum of the probabilities is indeed one. And 0.2 plus 0.2 plus 0.2 plus 0.2 plus 0.2 is one, and so we can move on.

To find the expected value then, we find the sum of the products of the numbers in each column. So that’s one times 0.2 plus two times 0.2 plus three times 0.2 plus four times 0.2. And finally, we add five times 0.2. Evaluating each of our products, and we get 0.2 plus 0.4 plus 0.6 plus 0.8 plus one, which is equal to three. And so the expected value 𝐸 of 𝑥 is equal to three. Now, in fact, this makes a lot of sense. We saw that the probability of each variable occurring was equal; it was 0.2 every time. And so the expected value and the likely mean would actually be the mean of all of our numbers. That’s five plus four plus three plus two plus one divided by five, which is also equal to three.

Now, this only worked because the probabilities were equal. It wouldn’t be a general rule that we could follow. Let’s look at an example where we have a graph and the probabilities are not equal.

Work out the expected value of the random variable 𝑋 whose probability distribution is shown.

The formula we use to calculate the expected value of a discrete random variable 𝑋 is shown. It’s the sum of the product of 𝑋 and the probability that 𝑥 occurs. And so a nice way to calculate the expected value when given a probability distribution in graph form is to transfer that into a table. The 𝑥-axis on our graph tells us the values our discrete random variable can take. They are one, two, three, and four. The first bar then has a height of 0.1. So the probability that 𝑋 is equal to one is 0.1. We see that our second bar has a height of 0.3. So the probability that 𝑋 is equal to two is 0.3. And then we continue in this manner. The height of our third bar, and that’s the probability that 𝑋 is equal to three, is 0.4. And the height of our fourth bar, which tells us the probability that 𝑋 is equal to four, is 0.2.

To find the expected value from our graph then, we need to find the sum of the products of the numbers in each column. So that’s one times 0.1 plus two times 0.3 plus three times 0.4 plus four times 0.2. This becomes 0.1 plus 0.6 plus 1.2 plus 0.8, which is equal to 2.7. And so the expected value of the random variable 𝑋 is 2.7. Now, we can always check whether our answer is likely to be correct, or at least in the right range. When we’re finding the expected value, we’re finding the weighted mean. According to our table and our graph, it’s much more likely that 𝑥 is equal to three than it is to one. The mean is more likely to be weighted then in this direction. And since 2.7 is roughly between one and four, though not exactly, we know that we’re likely to have performed the calculations correctly.

In our next example, we’ll look at how we can apply some of the other rules for working with probabilities to find the expected value of a discrete random variable.

The function in the given table is the probability function of a discrete random variable 𝑋. Find the expected value of 𝑋.

We know that we can find the expected value of a discrete random variable by calculating the sum of the products of the variable 𝑋 and the probability of that variable occurring. And we write it using this 𝛴 notation as shown. Now in this case, 𝑓 is a probability function. So we can say that this is like saying the probability that 𝑥 is equal to 𝑥 sub 𝑖. And so to find the expected value, we’re going to begin by finding the products of the numbers in each column. But of course, there is a number missing. And that’s this value here.

We’re told that the probability that 𝑥 is equal to one is 𝑎. So how do we calculate 𝑎? Well, we know that the sum of the probabilities in our table must be equal to one, and so we can set up and solve an equation for 𝑎. Our equation is 0.1 plus 𝑎 plus 0.1 plus 0.4 plus 0.2 equals one. In other words, we’ve added the respective probabilities and set it equal to one. 0.1 plus 0.1 plus 0.4 plus 0.2 is 0.8. So our equation becomes 𝑎 plus 0.8 equals one. If we subtract 0.8 from both sides, we find 𝑎 is equal to 0.2. And so we’re ready to calculate the expected value of 𝑋. It’s zero times 0.1 plus one times 0.2 plus two times 0.1. And we repeat this process with the numbers in our final two columns. This gives us zero plus 0.2 plus 0.2 plus 1.2 plus 0.8, which is equal to 2.4. The expected value of 𝑋 then in this case is 2.4.

In our final example, we’re going to look at how to use the expected value formula to find missing values.

The function in the given table is a probability function of a discrete random variable 𝑥. Given that the expected value of 𝑥 is 254 over 57, find the value of 𝐵.

And then we have a table with values for 𝑥 sub 𝑖 and 𝑓 of 𝑥 sub 𝑖. We begin by recalling how we calculate the expected value of a discrete random variable. It’s the sum of the values that the variable can take multiplied by the probability of that variable occurring. Now, in this question, we’re told that the function is a probability function of the discrete random variable. So we’re essentially saying that 𝑓 of 𝑥 sub 𝑖 is the same as the probability that 𝑥 is equal to 𝑥 sub 𝑖. And so eventually, we’re going to multiply the values in each of our columns.

But we do have a bit of a problem. At the moment, our values for probability are in terms of a variable 𝑎. And so we’re going to use the fact that we know that the sum of these probabilities must be equal to one. In other words, eight 𝑎 plus three 𝑎 plus a third plus eight 𝑎 must be equal to one. Eight 𝑎 plus three 𝑎 plus eight 𝑎 is 19𝑎. So we get 19𝑎 plus a third equals one. We can solve for 𝑎 by first subtracting a third from both sides to get 19𝑎 equals two-thirds. And then when we divide both sides by 19, we get 𝑎 is equal to two over 57. So now that we know the value of 𝑎, we need to go back to our table and calculate the relevant probabilities.

The probability that 𝑥 is equal to one is eight 𝑎. So that’s eight times two over 57, which is 16 over 57. Then the probability that 𝑥 is equal to two is three 𝑎. So that’s three times two over 57, which is six over 57. We’re told the probability 𝑥 is equal to 𝐵 is a third. And finally, the probability that 𝑥 is equal to seven is eight 𝑎 again. So that’s 16 over 57. Now of course, a quick check we could do here would be to check that each of our probabilities does indeed sum to one, and it does, so we can move on.

Our next job is to find the sum of the products of the numbers in each column. The expected value then is given by one times 16 over 57 plus two times six over 57 plus 𝐵 times a third plus seven times 16 over 57. But actually, we were told the expected value is 254 over 57. So we’re going to replace 𝐸 of 𝑥 with this number. And then we simplify the right-hand side. Now, all these fractions are making life a little bit awkward, so we’re going to multiply every single number in our equation by 57. When we do, our equation becomes 254 equals 16 plus 12 plus 19𝐵 plus 112. 19 is essentially 57 divided by three. And then, by adding the numerical parts, we get 140 plus 19𝐵 on the right-hand side.

Next, we subtract 140 from both sides, and our equation becomes 114 equals 19𝐵. Finally, we divide through by 19. And we find 𝐵 is 114 divided by 19, but 114 divided by 19 is six. And so the value of 𝐵 is six.

Let’s now recap the key points from this lesson. In this video, we recapped what we meant by a discrete random variable. It’s a variable that can only take a countable number of values. We saw that we denote the expected value, or sometimes called the mean of 𝑥, as 𝐸 of 𝑥 or 𝜇 or 𝜇 sub 𝑥. And then the expected value is found by calculating the sum of the products of the variable 𝑥 and the probability of that variable occurring. And we use the 𝛴 notation to represent this as shown.

Nagwa uses cookies to ensure you get the best experience on our website. Learn more about our Privacy Policy.