Lesson Explainer: Expected Values of Discrete Random Variables Mathematics

In this explainer, we will learn how to calculate the expected value of a discrete random variable from a table, a graph, and a word problem.

Definition: Discrete Random Variable

A discrete random variable is a variable that can only assume a countable number of numerical values. The value that the variable takes on is determined by the outcome of a random phenomenon or experiment. Such a variable is often denoted by an upper case 𝑋, with the value that the variable takes on denoted by a lower case π‘₯.

Each value that a discrete random variable can assume has an associated probability. For example, consider the graph below, which gives the probabilities of a spinner landing on 1, 2, 3, and 4:

It shows that

  • the probability of the spinner landing on 1 is 0.2 (written as 𝑃(𝑋=1)=0.2),
  • the probability of the spinner landing on 2 is 0.3 (written as 𝑃(𝑋=2)=0.3),
  • the probability of the spinner landing on 3 is 0.3 (written as 𝑃(𝑋=3)=0.3),
  • the probability of the spinner landing on 4 is 0.2 (written as 𝑃(𝑋=4)=0.2).

In table form, we would give these probabilities as follows:

π‘₯1234
𝑃(𝑋=π‘₯)0.20.30.30.2

Together, the probabilities of each of the possible values of 𝑋 represent a probability distribution.

Definition: Probability Distribution

A probability distribution is a function that gives the likelihood of obtaining each of the possible values that a discrete random variable can assume. It is often represented with a graph or with a table of values. Some properties of a probability distribution include the following:

  • The probability that 𝑋 takes on a specific value π‘₯ is 𝑃(𝑋=π‘₯). You may also use the notations 𝑝(π‘₯), 𝑝(π‘₯), and 𝑝 for this probability.
  • 𝑝(π‘₯)β‰₯0 for all real numbers π‘₯.
  • οŠοƒοŠ²οŠ§οƒο„šπ‘(π‘₯)=1, where 𝑛 is the number of possible values of 𝑋 and 𝑖 takes values 1,…,𝑛.

Hence, from the second and third points, we know that 0≀𝑝(π‘₯)≀1.

Applying this to our spinner probability distribution above, the sum of all of the probabilities is equal to 1. That is, 0.2+0.3+0.3+0.2=1.

Since this will always be the case, if we know all of the probabilities except one in a distribution, we can subtract the sum of the known probabilities from 1 to find the unknown probability.

The law of large numbers states that as the sample size grows, the mean of all of the outcomes gets closer to the mean of the whole population, or closer to the mean that we would expect. Thus, using a probability distribution, we can calculate the most likely mean of all of the outcomes when a large number of trials are conducted. For example, suppose we spun our spinner 10β€Žβ€‰β€Ž000 times. The most likely number of times each of the possible values would come up out of these 10β€Žβ€‰β€Ž000 trials is the product of 10β€Žβ€‰β€Ž000 and the probability of getting that value. That is,

  • the most likely number of 1s to come up would be 10000β‹…0.2=2000,
  • the most likely number of 2s to come up would be 10000β‹…0.3=3000,
  • the most likely number of 3s to come up would be 10000β‹…0.3=3000,
  • the most likely number of 4s to come up would be 10000β‹…0.2=2000.

If these were the frequencies of each of the values, we could find the mean, πœ‡, of all of the outcomes by multiplying each value by its frequency, finding the sum of the products, and then dividing by the total number of possible outcomes. This would give us a mean of πœ‡=1β‹…2000+2β‹…3000+3β‹…3000+4β‹…20002000+3000+3000+2000=2000+6000+9000+800010000=2500010000=2.5.

Note that we would have got the same answer had we performed our calculations in a slightly different way. Multiplying each value of π‘₯ by its probability and adding the products together, we obtain πœ‡=1β‹…200010000+2β‹…300010000+3β‹…300010000+4β‹…200010000.

This is actually ο„šπ‘₯⋅𝑃(𝑋=π‘₯), so we have πœ‡=ο„šπ‘₯⋅𝑃(𝑋=π‘₯)=1β‹…0.2+2β‹…0.3+3β‹…0.3+4β‹…0.2=0.2+0.6+0.9+0.8=2.5.

This is the same result that we got when we first found the mean of the 10β€Žβ€‰β€Ž000 outcomes and it leads us to the definition of expected value.

Definition: Expected Value

The expected value, or expectation, 𝐸(𝑋), of the discrete random variable 𝑋 is the most likely of all the outcomes for the variable when a very large number of trials are conducted. That is, 𝐸(𝑋)=πœ‡,οŠβ†’βˆž where πœ‡ is the mean and 𝑛 is the number of trials. The formula for expected value is 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯), where π‘₯ is each of the possible values of 𝑋 and 𝑃(𝑋=π‘₯) is the probability of each of these outcomes occurring.

Now that we have a formula for the expected value of a discrete random variable, let’s use it to solve problems. We will start with an example in which the probability distribution of a discrete random variable is given in a table.

Example 1: Calculating Expected Values

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?

π‘₯2345
𝑝(π‘₯)0.10.30.20.4

Answer

Recall that the law of large numbers states that as the number of trials approaches infinity, the mean of the results will approach the expected value. That is, πœ‡=𝐸(𝑋),οŠβ†’βˆž where πœ‡ is the mean, 𝑛 is the number of trials, and 𝐸(𝑋) is the expected value of 𝑋. Also remember that the formula for the expected value is 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯), where π‘₯ is each of the possible values of 𝑋 and 𝑃(𝑋=π‘₯) is the probability of each of these outcomes occurring.

Thus, to find the likely mean for the experiment above, we substitute the values given in the table into the formula for the expected value. That is, we multiply each possible outcome by its probability and then find the sum of the products: 𝐸(𝑋)=2(0.1)+3(0.3)+4(0.2)+5(0.4)=0.2+0.9+0.8+2.0=3.9.

This tells us that the expected value of 𝑋 is 3.9. Hence, if a very high number of trials were carried out, the likely mean of all the outcomes would be 3.9.

Note

The expected value of 3.9 is a little more than 2+52=3.5, which is the value that is halfway between 2 and 5. This is what we would expect, since the sum of the probabilities of 4 and 5 (0.2+0.4=0.6) is a little more than the sum of the probabilities of 2 and 3 (0.1+0.3=0.4).

Next, we will calculate the expected value of a discrete random variable that has a uniform probability distribution. In a uniform probability distribution, each outcome has the same probability of occurring.

Example 2: Calculating the Expected Value from the Probabilities of a Discrete Random Variable

The table shows the probability distribution of a fair six-sided die. Determine 𝐸(𝑋).

π‘₯123456
𝑃(𝑋=π‘₯)161616161616

Answer

Let’s begin by substituting the given values into the formula for the expected value, 𝐸(𝑋). That is 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯), where each of the possible values of 𝑋 is π‘₯ and the probability of each of these outcomes occurring is 𝑃(𝑋=π‘₯). Note that since each outcome has the same probability of occurring, we have a uniform probability distribution.

The formula says that, to find the expected value of 𝑋, we need to multiply each of the possible values of 𝑋 by its probability and then find the sum of the products. When we do this, we get 𝐸(𝑋)=1ο€Ό16+2ο€Ό16+3ο€Ό16+4ο€Ό16+5ο€Ό16+6ο€Ό16=16+26+36+46+56+66=216=3.5.

Therefore, the formula tells us that 𝐸(𝑋) is equal to 3.5.

Notice that the expected value of 3.5 that we just calculated is exactly halfway between 1 and 6. This leads us to a formula for the expected value, 𝐸(π‘₯), of a discrete random variable 𝑋 that has a uniform probability distribution.

Formula: Expected Value of a Discrete Random Variable with a Uniform Probability Distribution

For a uniform distribution where 𝑋={1,2,3,…,𝑛} and 𝑛 is the last consecutive integer in the set of possible values of 𝑋, 𝐸(𝑋)=𝑛+12.

Remember that, for our uniform probability distribution in the example above, 𝑋={1,2,3,4,5,6}. To double-check our work, we can substitute 6 for 𝑛 in the stated formula and simplify as shown: 𝐸(𝑋)=6+12=72=3.5.

Just as before, we find the value of 𝐸(𝑋) to be 3.5.

In the problem that follows, we will be given a probability distribution in graphical form and will be asked to calculate the expected value of the associated discrete random variable.

Example 3: Calculating Expected Values from the Graph of a Probability Distribution

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

Answer

We begin by representing the information given in the graph in table form so that we can more easily calculate the expected value of 𝑋. Doing so, we get

π‘₯1234
𝑃(𝑋=π‘₯)0.10.30.40.2

Now let’s substitute the given values from the table into the formula for the expected value, 𝐸(𝑋). That is, 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯), where π‘₯ is each of the possible values of 𝑋 and 𝑃(𝑋=π‘₯) is the probability of each of these outcomes occurring.

Substituting our π‘₯-values and their probabilities into the formula gives us 𝐸(𝑋)=1(0.1)+2(0.3)+3(0.4)+4(0.2)=0.1+0.6+1.2+0.8=2.7.

Thus, the expected value of the random variable 𝑋 is 2.7.

Now, we will calculate the expected value of another discrete random variable. This time, the probability distribution is given to us as a function. We must use the fact that the sum of all of the probabilities in a probability distribution is equal to 1 to find an unknown probability.

Example 4: Finding the Expected Value of a Discrete Random Variable given a Function

Let 𝑋 denote a discrete random variable that can take the values –1, 𝑀, and 1. Given that 𝑋 has probability distribution function 𝑓(π‘₯)=π‘₯+26, find the expected value of 𝑋.

Answer

In this problem, we are given the probability distribution function for the discrete random variable 𝑋 and the three possible values that 𝑋 can take. We are asked to find the expected value of 𝑋.

Before we can calculate the discrete random variable’s expected value, however, we must evaluate the variable’s probability distribution function at each of the possible values of the variable in order to determine the probability associated with each value.

First, evaluating 𝑓(π‘₯) at π‘₯=–1, we get 𝑓(βˆ’1)=βˆ’1+26=16.

Next, evaluating 𝑓(π‘₯) at π‘₯=𝑀 gives us 𝑓(𝑀)=𝑀+26.

Finally, evaluating 𝑓(π‘₯) at π‘₯=1, we get 𝑓(1)=1+26=36=12.

We now know that the probability for 𝑋=βˆ’1 is 16, the probability for 𝑋=𝑀 is 𝑀+26, and the probability for 𝑋=1 is 12. Remember that the sum of all of the probabilities in a probability distribution must be equal to 1. This means that we can write the equation 16+𝑀+26+12=1, and after finding a common denominator for the three fractions on the left side, we get 16+𝑀+26+36=1.

Simplifying the left side then gives us 𝑀+66=1, and after multiplying both sides of the equation by 6, we get 𝑀+6=6.

Finally, subtracting 6 from both sides shows us that 𝑀=0.

Recall that the probability for 𝑋=𝑀 is 𝑀+26. Since we have now determined that the value of 𝑀 is 0, we know that the probability for 𝑋=0 is 0+26=26=13.

To help us calculate the expected value of 𝑋, let’s represent our findings so far in table form as shown.

π‘₯βˆ’101
𝑃(𝑋=π‘₯)161312

By checking that all of the probabilities in the probability distribution sum to 1, we can confirm that the probabilities in our table are correct as follows: 16+13+12=16+26+36=66=1.

Since we have the correct probability for each of the possible values of 𝑋, we can now use the formula 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯) to find the expected value, 𝐸(𝑋), of 𝑋. In the formula, each of the possible values of 𝑋 is π‘₯, and the probability of each of these outcomes occurring is 𝑃(𝑋=π‘₯).

Substituting our π‘₯ values and their probabilities into the formula, we get 𝐸(𝑋)=βˆ’1ο€Ό16+0ο€Ό13+1ο€Ό12=βˆ’16+0+12=βˆ’16+06+36=26=13.

Therefore, the expected value of 𝑋 is 13.

In the example that follows, we again use the fact that the sum of all of the probabilities in a probability distribution is equal to 1 to set up a linear equation. We solve this equation to find a pair of unknown probabilities, which we then use to calculate a discrete random variable’s expected value.

Example 5: Using the Probability Function of a Discrete Random Variable to Find the Expected Value

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

π‘₯1346
𝑓(π‘₯)10278π‘Ž6π‘Ž19

Answer

In this problem, we are asked to find the expected value of a discrete random variable 𝑋 by using the information provided in the given table. The π‘₯ are the possible values of 𝑋,where, in this case, 𝑖 = 1, 2, 3, and 4, since there are four possible outcomes, and 𝑓(π‘₯) are the probabilities for each of these. Often, 𝑓(π‘₯) is written as 𝑝(π‘₯).

We can see that the probabilities for 𝑋=3 and 𝑋=4 are not given. Rather, they are represented in terms of the unknown constant π‘Ž. Therefore, we must find the value of π‘Ž before we can calculate the expected value.

Recall that the sum of all of the probabilities in a probability distribution must be equal to 1. This means that we can write the equation 1027+8π‘Ž+6π‘Ž+19=1, and after finding a common denominator for the two fractions on the left side, we get 1027+8π‘Ž+6π‘Ž+327=1.

Simplifying the left side then gives us 1327+14π‘Ž=1.

Now, subtracting 1327 from both sides, we get 14π‘Ž=1427.

Finally, after dividing both sides of the equation by 14, we arrive at π‘Ž=127.

Now that we know the value of π‘Ž is 127, we are able to determine that 𝑓(3)=8ο€Ό127=827 and also that 𝑓(4)=6ο€Ό127=627=29.

Entering these probabilities into our table then gives us

π‘₯1346
𝑓(π‘₯)10278272919

We can confirm that our probabilities are correct by checking to make sure that all of the probabilities in the probability distribution sum to 1 as follows: 1027+827+29+19=1027+827+627+327=2727=1.

Now that we have the correct probability for each of the possible values of 𝑋, we can use the formula 𝐸(𝑋)=ο„šπ‘₯⋅𝑓(π‘₯)οŠοƒοŠ²οŠ§οƒοƒ to find the expected value of 𝑋. In the formula, the expected value is 𝐸(𝑋), and the number of possible outcomes for 𝑋 is 𝑛, where, as noted earlier, in our case the value of 𝑛 is 4.

Using the formula, we multiply each of the possible values of 𝑋 by its probability and then calculate the sum of the products to find the expected value of 𝑋. When we do this, we get 𝐸(𝑋)=1ο€Ό1027+3ο€Ό827+4ο€Ό29+6ο€Ό19=1027+2427+89+69=1027+2427+2427+1827=7627.

Thus, we find that the expected value of 𝑋 is 7627.

We will also use the fact that the sum of all of the probabilities in a probability distribution must be equal to 1 to find an unknown probability in our next problem. Just as before, we will then use this probability to help determine the expected value of a discrete random variable.

Example 6: Finding the Expected Value of a Discrete Random Variable

Let 𝑋 denote a discrete random variable that can take the values 4, 5, 8, and 10. Given that 𝑃(𝑋=4)=427, 𝑃(𝑋=5)=527, and 𝑃(𝑋=8)=827, find the expected value of 𝑋. Give your answer to two decimal places.

Answer

To summarize the information given, let’s represent it in table form. Doing so, we get

π‘₯45810
𝑃(𝑋=π‘₯)427527827?

Note that we are not told the probability that the value of 𝑋 is 10, that is, 𝑃(𝑋=10). However, we do know that the sum of all of the probabilities in a probability distribution must be equal to 1. This means that we must subtract the sum of the other probabilities in the table from 1 to find our missing probability. Doing so, we get 𝑃(𝑋=10)=1βˆ’ο€Ό427+527+827=1βˆ’1727=2727βˆ’1727=1027.

Now that we know the probability that the value of 𝑋 is 10, let’s use the formula for the expected value, 𝐸(𝑋). Remember that the formula is 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯), where π‘₯ is each of the possible values of 𝑋 and 𝑃(𝑋=π‘₯) is the probability of each of these outcomes occurring.

Using the formula, we multiply each of the possible values of 𝑋 by its probability and then find the sum of the products to find the expected value of 𝑋: 𝐸(𝑋)=4ο€Ό427+5ο€Ό527+8ο€Ό827+10ο€Ό1027=1627+2527+6427+10027=20527.

To convert our fraction to decimal form, we can now divide 205 by 27 to get 7.59259…, which means that the expected value of 𝑋 to two decimal places is 7.59.

Finally, we will work on a problem in which we are given the expected value of a discrete random variable and must find one of the variable’s possible values. Before we can do this, however, we will need to set up a linear equation that we will then solve to help determine three unknown probabilities.

Example 7: Using the Probability Distribution Function and Expected Value of a Discrete Random Variable to Find an Unknown

The function in the given table is a probability function of a discrete random variable 𝑋. Given that the expected value of 𝑋 is 25457, find the value of 𝐡.

π‘₯12𝐡7
𝑓(π‘₯)8π‘Ž3π‘Ž138π‘Ž

Answer

To find the value of 𝐡, we first need to find the value of π‘Ž. To do this, we recall that the sum of all of the probabilities in a probability distribution must be equal to 1. This allows us to set up the equation 8π‘Ž+3π‘Ž+13+8π‘Ž=1, which we can solve for π‘Ž. Adding like terms on the left side of the equation gives us 19π‘Ž+13=1, and then, after subtracting 13 from both sides, we get 19π‘Ž=23.

Finally, dividing both side by 19, we arrive at π‘Ž=257.

Now that we know that the value of a is 257, we can calculate the probabilities of the outcomes 1, 2, and 7 in our table as shown: 𝑓(1)=8ο€Ό257=1657,𝑓(2)=3ο€Ό257=657,𝑓(7)=8ο€Ό257=1657.

Entering these probabilities into our table then gives us:

π‘₯12𝐡7
𝑓(π‘₯)1657657131657

We can confirm that our probabilities are correct by checking to make sure that all of the probabilities in the probability distribution sum to 1 as follows: 1657+657+13+1657=1657+657+1957+1657=5757=1.

Now that we have the correct probability for each of the possible values of 𝑋, we can use the formula 𝐸(𝑋)=ο„šπ‘₯⋅𝑓(π‘₯)οŠοƒοŠ²οŠ§οƒοƒ to find the value of 𝐡. In the formula, 𝐸(𝑋) is the expected value, 𝑛 is the number of possible outcomes, π‘₯ is each of these possible outcomes, and 𝑓(π‘₯) is the probability of each of these outcomes occurring. Note that, for this data set, 𝑖 = 1, 2, 3, 4, since there are 4 possible values of 𝑋, which means that the value of 𝑛 is 4.

According to the formula, we must multiply each of the possible values of 𝑋 by its probability and then find the sum of the products to find the expected value of 𝑋. However, recall that we were told that the expected value of 𝑋 is 25457. Substituting this expected value, along with the values from our table, into the formula, we get 25457=1ο€Ό1657+2ο€Ό657+𝐡13+7ο€Ό1657.

Now, we can solve the resulting equation for 𝐡. Multiplying on the right side gives us 25457=1657+1257+𝐡13+11257.

Then, adding the fractions with like denominators on the right side, we get 25457=14057+𝐡13.

Next, subtracting 14057 from both sides of the equation gives us 11457=𝐡13, and after multiplying both sides of the equation by 3, we get 𝐡=34257=6

Thus, with our value of π‘Ž=257, we find that 𝐡 must be equal to 6.

Now, let’s finish by recapping some key points.

Key Points

  • A discrete random variable is a variable that can only assume a countable number of numerical values. The value that the variable takes on is determined by the outcome of a random phenomenon or experiment.
  • An uppercase 𝑋 often denotes a discrete random variable, with a lowercase π‘₯ denoting the value that the variable takes on.
  • A probability distribution is a function that gives the likelihood of obtaining each of the possible values that a discrete random variable can assume.
  • The expected value, 𝐸(𝑋), of the discrete random variable 𝑋 is the most likely mean of all the outcomes for the variable when a very large number of trials are conducted.
  • The formula for expected value is 𝐸(𝑋)=ο„šπ‘₯⋅𝑃(𝑋=π‘₯), where π‘₯ is each of the possible values of the discrete random variable 𝑋 and 𝑃(𝑋=π‘₯) is the probability of each of these outcomes occurring.
  • The sum of all of the probabilities in a probability distribution is equal to 1.
  • The expected value, 𝐸(𝑋), for a discrete random variable 𝑋={1,2,3,…,𝑛} that has a uniform probability distribution is 𝐸(𝑋)=𝑛+12, where 𝑛 is the last consecutive integer in the set of possible values of 𝑋.

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