What is the expected value of a discrete random variable of a probability distribution?

Show

    What is the expected value of a discrete random variable of a probability distribution?

    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.

    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.

    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.

    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.

    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?

    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.

    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.

    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.

    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.

    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.

    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.

    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.

    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.

    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.

    • 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 𝑋.