Skip to ContentGo to accessibility pageKeyboard shortcuts menu
OpenStax Logo
Statistics

4.2 Mean or Expected Value and Standard Deviation

Statistics4.2 Mean or Expected Value and Standard Deviation

The expected value of a discrete random variable X, symbolized as E(X), is often referred to as the long-term average or mean (symbolized as μ). This means that over the long term of doing an experiment over and over, you would expect this average. For example, let X = the number of heads you get when you toss three fair coins. If you repeat this experiment (toss three fair coins) a large number of times, the expected value of X is the number of heads you expect to get for each three tosses on average.

NOTE

To find the expected value, E(X), or mean μ of a discrete random variable X, simply multiply each value of the random variable by its probability and add the products. The formula is given as E(X)=μ= xP(x) . E(X)=μ= xP(x) .

Here x represents values of the random variable X, P(x) represents the corresponding probability, and symbol represents the sum of all products xP(x). Here we use symbol μ for the mean because it is a parameter. It represents the mean of a population.

Example 4.3

A men's soccer team plays soccer zero, one, or two days a week. The probability that they play zero days is .2, the probability that they play one day is .5, and the probability that they play two days is .3. Find the long-term average or expected value, μ, of the number of days per week the men's soccer team plays soccer.

To do the problem, first let the random variable X = the number of days the men's soccer team plays soccer per week. X takes on the values 0, 1, 2. Construct a PDF table adding a column x*P(x), the product of the value x with the corresponding probability P(x). In this column, you will multiply each x value by its probability.

x P(x) x*P(x)
0 .2 (0)(.2) = 0
1 .5 (1)(.5) = .5
2 .3 (2)(.3) = .6
Table 4.5 Expected Value Table This table is called an expected value table. The table helps you calculate the expected value or long-term average.

Add the last column x*P(x) x*P(x) to get the expected value/mean of the random variable X.

E(X)=μ=xP(x)=0+.5+.6=1.1 E(X)=μ=xP(x)=0+.5+.6=1.1

The expected value/mean is 1.1. The men's soccer team would, on the average, expect to play soccer 1.1 days per week. The number 1.1 is the long-term average or expected value if the men's soccer team plays soccer week after week after week.

As you learned in Chapter 3, if you toss a fair coin, the probability that the result is heads is 0.5. This probability is a theoretical probability, which is what we expect to happen. This probability does not describe the short-term results of an experiment. If you flip a coin two times, the probability does not tell you that these flips will result in one head and one tail. Even if you flip a coin 10 times or 100 times, the probability does not tell you that you will get half tails and half heads. The probability gives information about what can be expected in the long term. To demonstrate this, Karl Pearson once tossed a fair coin 24,000 times! He recorded the results of each toss, obtaining heads 12,012 times. The relative frequency of heads is 12,012/24,000 = .5005, which is very close to the theoretical probability .5. In his experiment, Pearson illustrated the law of large numbers.

The law of large numbers states that, as the number of trials in a probability experiment increases, the difference between the theoretical probability of an event and the relative frequency approaches zero (the theoretical probability and the relative frequency get closer and closer together). The relative frequency is also called the experimental probability, a term that means what actually happens.

In the next example, we will demonstrate how to find the expected value and standard deviation of a discrete probability distribution by using relative frequency.

Like data, probability distributions have variances and standard deviations. The variance of a probability distribution is symbolized as σ 2 σ 2 and the standard deviation of a probability distribution is symbolized as σ. Both are parameters since they summarize information about a population. To find the variance σ 2 σ 2 of a discrete probability distribution, find each deviation from its expected value, square it, multiply it by its probability, and add the products. To find the standard deviation σ of a probability distribution, simply take the square root of variance σ 2 σ 2 . The formulas are given as below.

NOTE

The formula of the variance σ 2 σ 2 of a discrete random variable X is

σ 2 = ( xμ ) 2 P( x ) . σ 2 = ( xμ ) 2 P( x ) .
4.1

Here x represents values of the random variable X, μ is the mean of X, P(x) represents the corresponding probability, and symbol represents the sum of all products (xμ) 2 P(x). (xμ) 2 P(x).

To find the standard deviation, σ, of a discrete random variable X, simply take the square root of the variance σ 2 σ 2 .

σ= σ 2 = ( xμ ) 2 P( x ) σ= σ 2 = ( xμ ) 2 P( x )

Example 4.4

A researcher conducted a study to investigate how a newborn baby’s crying after midnight affects the sleep of the baby's mother. The researcher randomly selected 50 new mothers and asked how many times they were awakened by their newborn baby's crying after midnight per week. Two mothers were awakened zero times, 11 mothers were awakened one time, 23 mothers were awakened two times, nine mothers were awakened three times, four mothers were awakened four times, and one mother was awakened five times. Find the expected value of the number of times a newborn baby's crying wakes its mother after midnight per week. Calculate the standard deviation of the variable as well.

To do the problem, first let the random variable X = the number of times a mother is awakened by her newborn’s crying after midnight per week. X takes on the values 0, 1, 2, 3, 4, 5. Construct a PDF table as below. The column of P(x) gives the experimental probability of each x value. We will use the relative frequency to get the probability. For example, the probability that a mother wakes up zero times is 2 50 2 50 since there are two mothers out of 50 who were awakened zero times. The third column of the table is the product of a value and its probability, xP(x).

x P(x) xP(x)
0 P( x = 0 ) = 2 50 P( x = 0 ) = 2 50 ( 0 )( 2 50 )=0 ( 0 )( 2 50 )=0
1 P( x = 1 ) = 11 50 P( x = 1 ) = 11 50 ( 1 )( 11 50 )= 11 50 ( 1 )( 11 50 )= 11 50
2 P( x = 2 ) = 23 50 P( x = 2 ) = 23 50 ( 2 )( 23 50 )= 46 50 ( 2 )( 23 50 )= 46 50
3 P( x = 3 ) = 9 50 P( x = 3 ) = 9 50 ( 3 )( 9 50 )= 27 50 ( 3 )( 9 50 )= 27 50
4 P( x = 4 ) = 4 50 P( x = 4 ) = 4 50 ( 4 )( 4 50 )= 16 50 ( 4 )( 4 50 )= 16 50
5 P( x = 5 ) = 1 50 P( x = 5 ) = 1 50 ( 5 )( 1 50 )= 5 50 ( 5 )( 1 50 )= 5 50
Table 4.6

We then add all the products in the third column to get the mean/expected value of X.

E( X )=μ=xP( x )=0+ 11 50 + 46 50 + 27 50 + 16 50 + 5 50 = 105 50 =2.1 E( X )=μ=xP( x )=0+ 11 50 + 46 50 + 27 50 + 16 50 + 5 50 = 105 50 =2.1
4.2

Therefore, we expect a newborn to wake its mother after midnight 2.1 times per week, on the average.

To calculate the standard deviation σ, we add the fourth column (x-μ)2 and the fifth column (x-μ)2P(x)(x-μ)2P(x) to get the following table:

x P(x) xP(x) (x-µ)2 (x-µ)2P(x)
0 P( x = 0 ) = 2 50 P( x = 0 ) = 2 50 ( 0 )( 2 50 )=0 ( 0 )( 2 50 )=0 (02.1) 2 =4.41 (02.1) 2 =4.41 4.41 2 50 =.1764 4.41 2 50 =.1764
1 P( x = 1 ) = 11 50 P( x = 1 ) = 11 50 ( 1 )( 11 50 )= 11 50 ( 1 )( 11 50 )= 11 50 (12.1) 2 =1.21 (12.1) 2 =1.21 1.21 11 50 =.2662 1.21 11 50 =.2662
2 P( x = 2 ) = 23 50 P( x = 2 ) = 23 50 ( 2 )( 23 50 )= 46 50 ( 2 )( 23 50 )= 46 50 (22.1) 2 =.01 (22.1) 2 =.01 .01 23 50 =.0046 .01 23 50 =.0046
3 P( x = 3 ) = 9 50 P( x = 3 ) = 9 50 ( 3 )( 9 50 )= 27 50 ( 3 )( 9 50 )= 27 50 (32.1) 2 =.81 (32.1) 2 =.81 .81 9 50 =.1458 .81 9 50 =.1458
4 P( x = 4 ) = 4 50 P( x = 4 ) = 4 50 ( 4 )( 4 50 )= 16 50 ( 4 )( 4 50 )= 16 50 (42.1) 2 =3.61 (42.1) 2 =3.61 3.61 4 50 =.2888 3.61 4 50 =.2888
5 P( x = 5 ) = 1 50 P( x = 5 ) = 1 50 ( 5 )( 1 50 )= 5 50 ( 5 )( 1 50 )= 5 50 (52.1) 2 =8.41 (52.1) 2 =8.41 8.41 1 50 =.1682 8.41 1 50 =.1682
Table 4.7

We then add all the products in the 5th column to get the variance of X.

σ 2 =.1764+.2662+.0046+.1458+.2888+.1682=1.05 σ 2 =.1764+.2662+.0046+.1458+.2888+.1682=1.05
4.3

To get the standard deviation σ, we simply take the square root of variance σ2.

σ= σ 2 = 1.05 1.0247 σ= σ 2 = 1.05 1.0247
4.4

Try It 4.4

A hospital researcher is interested in the number of times the average post-op patient will ring the nurse during a 12-hour shift. For a random sample of 50 patients, the following information was obtained. What is the expected value?

x P(x)
0 P(x = 0) = 4 50 4 50
1 P(x = 1) = 8 50 8 50
2 P(x = 2) = 16 50 16 50
3 P(x = 3) = 14 50 14 50
4 P(x = 4) = 6 50 6 50
5 P(x = 5) = 2 50 2 50
Table 4.8

Example 4.5

Suppose you play a game of chance in which five numbers are chosen from 0, 1, 2, 3, 4, 5, 6, 7, 8, 9. A computer randomly selects five numbers from zero to nine with replacement. You pay $2 to play and could profit $100,000 if you match all five numbers in order (you get your $2 back plus $100,000). Over the long term, what is your expected profit of playing the game?

To do this problem, set up a PDF table for the amount of money you can profit.

Let X = the amount of money you profit. If your five numbers match in order, you will win the game and will get your $2 back plus $100,000. That means your profit is $100,000. If your five numbers do not match in order, you will lose the game and lose your $2. That means your profit is -$2. Therefore, X takes on the values $100,000 and –$2. That is the second column x in the PDF table below.

To win, you must get all five numbers correct, in order. The probability of choosing the correct first number is 1 10 1 10 because there are 10 numbers (from zero to nine) and only one of them is correct. The probability of choosing the correct second number is also 1 10 1 10 because the selection is done with replacement and there are still 10 numbers (from zero to nine) for you to choose. Due to the same reason, the probability of choosing the correct third number, the correct fourth number, and the correct fifth number are also 1 10 1 10 . The selection of one number does not affect the selection of another number. That means the five selections are independent. The probability of choosing all five correct numbers and in order is equal to the product of the probabilities of choosing each number correctly.

P( choosing all five numbers correctly )P( choosing 1st number correctly )  P( choosing 2nd number correctly ) P( choosing 5th number correctly ) = ( 1 10 )( 1 10 )( 1 10 )( 1 10 )( 1 10 ) =.00001 P( choosing all five numbers correctly )P( choosing 1st number correctly )  P( choosing 2nd number correctly ) P( choosing 5th number correctly ) = ( 1 10 )( 1 10 )( 1 10 )( 1 10 )( 1 10 ) =.00001

Therefore, the probability of winning is .00001 and the probability of losing is 1 − .00001 = .99999. That is how we get the third column P(x) in the PDF table below.

To get the fourth column xP(x) in the table, we simply multiply the value x with the corresponding probability P(x).

The PDF table is as follows:

x P(x) x*P(x)
Loss –2 .99999 (–2)(.99999) = –1.99998
Profit 100,000 .00001 (100000)(.00001) = 1
Table 4.9

We then add all the products in the last column to get the mean/expected value of X.

 E(X)=μ= xP(x)=1.99998+1=.9998 .  E(X)=μ= xP(x)=1.99998+1=.9998 .

Since –.99998 is about –1, you would, on average, expect to lose approximately $1 for each game you play. However, each time you play, you either lose $2 or profit $100,000. The $1 is the average or expected loss per game after playing this game over and over.

Try It 4.5

You are playing a game of chance in which four cards are drawn from a standard deck of 52 cards. You guess the suit of each card before it is drawn. The cards are replaced in the deck on each draw. You pay $1 to play. If you guess the right suit every time, you get your money back and $256. What is your expected profit of playing the game over the long term?

Example 4.6

Suppose you play a game with a biased coin. You play each game by tossing the coin once. P(heads) = 2 3 2 3 and P(tails) = 1 3 1 3 . If you toss a head, you pay $6. If you toss a tail, you win $10. If you play this game many times, will you come out ahead?

Problem

a. Define a random variable X.

Problem

b. Complete the following expected value table.

x ____ ____
WIN 10 1313 ____
LOSE ____ ____ –123–123
Table 4.10

Problem

c. What is the expected value, μ? Do you come out ahead?

Try It 4.6

Suppose you play a game with a spinner. You play each game by spinning the spinner once. P(red) = 2 5 2 5 , P(blue) = 2 5 2 5 , and P(green) = 1 5 1 5 . If you land on red, you pay $10. If you land on blue, you don't pay or win anything. If you land on green, you win $10. Complete the following expected value table.

x P(x)
Red 20 5 20 5
Blue 2 5 2 5
Green 10
Table 4.12

Generally for probability distributions, we use a calculator or a computer to calculate μ and σ to reduce rounding errors. For some probability distributions, there are shortcut formulas for calculating μ and σ.

Example 4.7

Problem

Toss a fair, six-sided die twice. Let X = the number of faces that show an even number. Construct a table like Table 4.12 and calculate the mean μ and standard deviation σ of X.

Some of the more common discrete probability functions are binomial, geometric, hypergeometric, and Poisson. Most elementary courses do not cover the geometric, hypergeometric, and Poisson. Your instructor will let you know if he or she wishes to cover these distributions.

A probability distribution function is a pattern. You try to fit a probability problem into a pattern or distribution in order to perform the necessary calculations. These distributions are tools to make solving probability problems easier. Each distribution has its own special characteristics. Learning the characteristics enables you to distinguish among the different distributions.

Citation/Attribution

This book may not be used in the training of large language models or otherwise be ingested into large language models or generative AI offerings without OpenStax's permission.

Want to cite, share, or modify this book? This book uses the Creative Commons Attribution License and you must attribute Texas Education Agency (TEA). The original material is available at: https://www.texasgateway.org/book/tea-statistics . Changes were made to the original material, including updates to art, structure, and other content updates.

Attribution information
  • If you are redistributing all or part of this book in a print format, then you must include on every physical page the following attribution:
    Access for free at https://openstax.org/books/statistics/pages/1-introduction
  • If you are redistributing all or part of this book in a digital format, then you must include on every digital page view the following attribution:
    Access for free at https://openstax.org/books/statistics/pages/1-introduction
Citation information

© Apr 16, 2024 Texas Education Agency (TEA). The OpenStax name, OpenStax logo, OpenStax book covers, OpenStax CNX name, and OpenStax CNX logo are not subject to the Creative Commons license and may not be reproduced without the prior and express written consent of Rice University.