Skip to main content

Advanced High School Statistics: Third Edition

Section 3.4 Random variables

The chance of landing on single number in the game of roulette is 1/38 and the pay is 35:1. The chance of landing on Red is 18/38 and the pay is 1:1. Which game has the higher expected value? The higher standard deviation of expected winnings? How do we interpret these quantities in this context? If you were to play each game 20 times, what would the distribution of possible outcomes look like? In this section, we define and summarize random variables such as this, and we look at some of their properties.

Subsection 3.4.1 Introduction to expected value

Example 3.4.1.

Two books are assigned for a statistics class: a textbook and its corresponding study guide. The university bookstore determined 20% of enrolled students do not buy either book, 55% buy the textbook only, and 25% buy both books, and these percentages are relatively constant from one term to another. If there are 100 students enrolled, how many books should the bookstore expect to sell to this class?
Solution.
Around 20 students will not buy either book (0 books total), about 55 will buy one book (55 books total), and approximately 25 will buy two books (totaling 50 books for these 25 students). The bookstore should expect to sell about 105 books for this class.

Guided Practice 3.4.2.

Would you be surprised if the bookstore sold slightly more or less than 105 books?
 1 
If they sell a little more or a little less, this should not be a surprise. Hopefully Chapter 2 helped make clear that there is natural variability in observed data. For example, if we would flip a coin 100 times, it will not usually come up heads exactly half the time, but it will probably be close.

Example 3.4.3.

The textbook costs $137 and the study guide $33. How much revenue should the bookstore expect from this class of 100 students?
Solution.
About 55 students will just buy a textbook, providing revenue of
\begin{gather*} \$137 \times 55 = \$7,535 \end{gather*}
The roughly 25 students who buy both the textbook and the study guide would pay a total of
\begin{gather*} (\$137 + \$33) \times 25 = \$170 \times 25 = \$4,250 \end{gather*}
Thus, the bookstore should expect to generate about \(\$7,535 + \$4,250 = \$11,785\) from these 100 students for this one class. However, there might be some sampling variability so the actual amount may differ by a little bit.
Figure 3.4.4. Probability distribution for the bookstore’s revenue from one student. The triangle represents the average revenue per student.

Example 3.4.5.

What is the average revenue per student for this course?
Solution.
The expected total revenue is $11,785, and there are 100 students. Therefore the expected revenue per student is \(\$11,785/100 = \$117.85\text{.}\)

Subsection 3.4.2 Probability distributions

A probability distribution is a table of all disjoint outcomes and their associated probabilities. Table 3.4.7 shows the probability distribution for the sum of two dice.

Rules for probability distributions.

A probability distribution is a list of the possible outcomes with corresponding probabilities that satisfies three rules:
  1. The outcomes listed must be disjoint.
  2. Each probability must be between 0 and 1.
  3. The probabilities must total 1.

Guided Practice 3.4.6.

Table 3.4.8 suggests three distributions for household income in the United States. Only one is correct. Which one must it be? What is wrong with the other two?
 2 
The probabilities of (a) do not sum to 1. The second probability in (b) is negative. This leaves (c), which sure enough satisfies the requirements of a distribution. One of the three was said to be the actual distribution of US household incomes, so it must be (c).
Table 3.4.7. Probability distribution for the sum of two dice.
Dice 2 3 4 5 6 7 8 9 10 11 12
Probability \(\frac{1}{36}\) \(\frac{2}{36}\) \(\frac{3}{36}\) \(\frac{4}{36}\) \(\frac{5}{36}\) \(\frac{6}{36}\) \(\frac{5}{36}\) \(\frac{4}{36}\) \(\frac{3}{36}\) \(\frac{2}{36}\) \(\frac{1}{36}\)
Table 3.4.8. Proposed distributions of US household incomes (Guided Practice 3.4.6).
Income range ($1000s) 0-25 25-50 50-100 100+
(a) 0.18 0.39 0.33 0.16
(b) 0.38 -0.27 0.52 0.37
(c) 0.28 0.27 0.29 0.16
Chapter 2 emphasized the importance of plotting data to provide quick summaries. Probability distributions can also be summarized in a histogram or bar plot. The probability distribution for the sum of two dice is shown in Table 3.4.7 and its histogram is plotted in Figure 3.4.9. The distribution of US household incomes is shown in Figure 3.4.10 as a bar plot. The presence of the 100+ category makes it difficult to represent it with a regular histogram.
Figure 3.4.9. A histogram for the probability distribution of the sum of two dice.
Figure 3.4.10. A bar graph for the probability distribution of US household income. Because it is artificially separated into four unequal bins, this graph fails to show the shape or skew of the distribution.
In these bar plots, the bar heights represent the probabilities of outcomes. If the outcomes are numerical and discrete, it is usually (visually) convenient to make a histogram, as in the case of the sum of two dice. Another example of plotting the bars at their respective locations is shown in Figure 3.4.4.

Subsection 3.4.3 Expectation

We call a variable or process with a numerical outcome a random variable, and we usually represent this random variable with a capital letter such as \(X\text{,}\) \(Y\text{,}\) or \(Z\text{.}\) The amount of money a single student will spend on her statistics books is a random variable, and we represent it by \(X\text{.}\)

Random variable.

A random process or variable with a numerical outcome.
The possible outcomes of \(X\) are labeled with a corresponding lower case letter \(x\) and subscripts. For example, we write \(x_1=\$0\text{,}\) \(x_2=\$137\text{,}\) and \(x_3=\$170\text{,}\) which occur with probabilities \(0.20\text{,}\) \(0.55\text{,}\) and \(0.25\text{.}\) The distribution of \(X\) is summarized in Figure 3.4.4 and Table 3.4.11.
Table 3.4.11. The probability distribution for the random variable \(X\text{,}\) representing the bookstore’s revenue from a single student. We use \(P(x_i)\) to represent the probability of \(x_i\text{.}\)
\(i\) 1 2 3 Total
\(x_i\) $0 $137 $170
\(P(x_{i})\) 0.20 0.55 0.25 1.00
We computed the average outcome of \(X\) as $117.85 in Solution 3.4.5.1. We call this average the expected value of \(X\text{,}\) denoted by \(E(X)\text{.}\) The expected value of a random variable is computed by adding each outcome weighted by its probability:
\begin{align*} E(X) \amp = 0 \cdot P(0) + 137 \cdot P(137) + 170 \cdot P(170)\\ \amp = 0 \cdot 0.20 + 137 \cdot 0.55 + 170 \cdot 0.25 = 117.85 \end{align*}

Expected value of a discrete random variable.

If \(X\) takes outcomes \(x_1\text{,}\) \(x_2\text{,}\) ..., \(x_n\) with probabilities \(P(x_1)\text{,}\) \(P(x_2)\text{,}\) ..., \(P(x_n)\text{,}\) the mean, or expected value, of \(X\) is the sum of each outcome multiplied by its corresponding probability:
\begin{align*} \mu_{\scriptscriptstyle{X}} = E(X) \amp = x_1\cdot P(x_1) + x_2\cdot P(x_2) + \cdots + x_n\cdot P(x_n)\\ \amp = \sum_{i=1}^{n}x_i\cdot P(x_i) \end{align*}
The expected value for a random variable represents the average outcome. For example, \(E(X)=117.85\) represents the average amount the bookstore expects to make from a single student, which we could also write as \(\mu=117.85\text{.}\) While the bookstore will make more than this on some students and less than this on other students, the average of many randomly selected students will be near $117.85.
It is also possible to compute the expected value of a continuous random variable. However, it requires a little calculus and we save it for a later class.
 3 
\(\mu_{\scriptscriptstyle{X}} = \int xf(x)dx\) where \(f(x)\) represents a function for the density curve.
In physics, the expectation holds the same meaning as the center of gravity. The distribution can be represented by a series of weights at each outcome, and the mean represents the balancing point. This is represented in Figure 3.4.4 and Figure 3.4.12. The idea of a center of gravity also expands to continuous probability distributions. Figure 3.4.13 shows a continuous probability distribution balanced atop a wedge placed at the mean.
Figure 3.4.12. A weight system representing the probability distribution for \(X\text{.}\) The string holds the distribution at the mean to keep the system balanced.
Figure 3.4.13. A continuous distribution can also be balanced at its mean.

Subsection 3.4.4 Variability in random variables

Suppose you ran the university bookstore. Besides how much revenue you expect to generate, you might also want to know the volatility (variability) in your revenue.
The variance and standard deviation can be used to describe the variability of a random variable. Subsection 2.2.2 introduced a method for finding the variance and standard deviation for a data set. We first computed deviations from the mean (\(x_i - \mu\)), squared those deviations, and took an average to get the variance. In the case of a random variable, we again compute squared deviations. However, we take their sum weighted by their corresponding probabilities, just like we did for the expectation. This weighted sum of squared deviations equals the variance, and we calculate the standard deviation by taking the square root of the variance, just as we did in Subsection 2.2.2.

Variance and standard deviation of a discrete random variable.

If \(X\) takes outcomes \(x_1\text{,}\) \(x_2\text{,}\) ..., \(x_n\) with probabilities \(P(x_1)\text{,}\) \(P(x_2)\text{,}\) ..., \(P(x_n)\) and expected value \(\mu_{\scriptscriptstyle{X}}=E(X)\text{,}\) then to find the standard deviation of \(X\text{,}\) we first find the variance and then take its square root.
\begin{align*} Var(X) = \sigma^2_x \amp = (x_1-\mu_{\scriptscriptstyle{X}})^2\cdot P(x_1) + (x_2-\mu_{\scriptscriptstyle{X}})^2\cdot P(x_2) + \cdots + (x_n-\mu_{\scriptscriptstyle{X}})^2\cdot P(x_n)\\ \amp = \sum_{i=1}^{n} (x_i - \mu_{\scriptscriptstyle{X}})^2 \cdot P(x_i)\\ SD(X) = \sigma_{\scriptscriptstyle{X}} \amp = \sqrt{ \sum_{i=1}^{n} (x_i - \mu_{\scriptscriptstyle{X}})^2 \cdot P(x_i)} \end{align*}
Just as it is possible to compute the mean of a continuous random variable using calculus, we can also use calculus to compute the variance.
 4 
\(\sigma^2_x = \int (x - \mu_{\scriptscriptstyle{X}})^2f(x)dx\) where \(f(x)\) represents a function for the density curve.
However, this topic is beyond the scope of the AP exam.

Example 3.4.14.

Compute the expected value, variance, and standard deviation of \(X\text{,}\) the revenue of a single statistics student for the bookstore.
Solution.
It is useful to construct a table that holds computations for each outcome separately, then add up the results.
\(i\) 1 2 3 Total
\(x_i\) $0 $137 $170
\(P(x_i)\) 0.20 0.55 0.25
\(x_i \cdot P(x_i)\) 0 75.35 42.50 117.85
Thus, the expected value is \(\mu_{X}=117.85\text{,}\) which we computed earlier. The variance can be constructed using a similar table:
\(i\) 1 2 3 Total
\(x_i\) $0 $137 $170
\(P(x_i)\) 0.20 0.55 0.25
\(x_i - \mu_{X}\) -117.85 19.15 52.15
\((x_i-\mu_{X})^2\) 13888.62 366.72 2719.62
\((x_i-\mu_{X})^2\cdot P(x_i)\) 2777.7 201.7 679.9 3659.3
The variance of \(X\) is \(\sigma_{X}^2 = 3659.3\text{,}\) which means the standard deviation is \(\sigma_{X} = \sqrt{3659.3} = \$60.49\text{.}\)

Guided Practice 3.4.15.

The bookstore also offers a chemistry textbook for $159 and a book supplement for $41. From past experience, they know about 25% of chemistry students just buy the textbook while 60% buy both the textbook and supplement.
 5 
(a) \(100\%- 25\% - 60\% = 15\%\) of students do not buy any books for the class. Part (b) is represented by the first two lines in the table below. The expectation for part (c) is given as the total on the line \(y_{i}\cdot P(y_{i})\text{.}\) The result of part (d) is the square-root of the variance listed on in the total on the last line: \(\sigma_{Y}= \sqrt{Var(Y)}=\sqrt{4800}=69.28\)
\(i\) (scenario) 1 (noBook) 2 (notebook) 3 (both) Total
\(y_{i}\) 0.00 159.00 200.00
\(P(y_{i})\) 0.15 0.25 0.60
\(y_{i} \cdot P(y_{i})\) 0/00 39.75 120.00 \(E(Y)=159.75\)
\(y_{i}- \mu_{Y}\) -159.75 -0.75 40.25
\((y_{i}-\mu_{Y})^2\) 25520.06 0.56 1620.06
\((y_{i}-\mu_{Y})^2 \cdot P(y_{i})\) 3828.0 0.1 972.0 \(Var(Y) \approx 4800\)
  1. What proportion of students don’t buy either book? Assume no students buy the supplement without the textbook.
  2. Let \(Y\) represent the revenue from a single student. Write out the probability distribution of \(Y\text{,}\) i.e. a table for each outcome and its associated probability.
  3. Compute the expected revenue from a single chemistry student.
  4. Find the standard deviation to describe the variability associated with the revenue from a single student.

Subsection 3.4.5 Linear transformations of a random variable

An online store is selling a limited edition t-shirt. The maximum a person is allowed to buy is 3. Let X be a random variable that represents how many of the t-shirts a t-shirt buyer orders. The probability distribution of X is given in the following table.
\(x_i\) 1 2 3
\(P(x_i)\) 0.6 0.3 0.1
Using the methods of the previous section we can find that the mean \(\mu_{X} = 1.5\) and the standard deviation \(\sigma_{X} = 0.67\text{.}\) Suppose that the cost of each t-shirt is $30 and that there is flat rate $5 shipping fee. The amount of money a t-shirt buyer pays, then, is \(30X + 5\text{,}\) where X is the number of t-shirts ordered. To calculate the mean and standard deviation for the amount of money a t-shirt buyers pays, we could define a new variable \(Y\) as follows:
\begin{gather*} Y = 30X + 5 \end{gather*}

Guided Practice 3.4.16.

Verify that the distribution of \(Y\) is given by the table below.
 6 
\(30 \times 1 + 5 = 35\text{;}\) \(30 \times 2 + 5 = 65\text{;}\) \(30 \times 3 + 5 = 95\)
\(y_i\) $35 $65 $95
\(P(y_i)\) 0.6 0.3 0.1
Using this new table, we can compute the mean and standard deviation of the cost for t-shirt orders. However, because Y is a linear transformation of X, we can use the properties from Subsection 2.2.7. Recall that multiplying every X by 30 multiplies both the mean and standard deviation by 30. Adding 5 only adds 5 to the mean, not the standard deviation. Therefore,
\begin{align*} \mu_{30X+5}\amp =E(30X+5) \amp \sigma_{30X+5}\amp =SD(30X+5)\\ \amp = 30\times E(X) + 5 \amp \amp = 30\times SD(X)\\ \amp = 30\times 1.5+5 \amp \amp = 30 \times 0.67\\ \amp = 50.00 \amp \amp = 20.10 \end{align*}
Among t-shirt buyers, they spend an average of $50.00, with a standard deviation of $20.10.

Linear transformations of a random variable.

If \(X\) is a random variable, then a linear transformation is given by \(aX + b\text{,}\) where \(a\) and \(b\) are some fixed numbers.
\begin{align*} E(aX+b) \amp = a\times E(X) + b \amp SD(aX+b) \amp = \lvert a\rvert \times SD(X) \end{align*}

Subsection 3.4.6 Linear combinations of random variables

So far, we have thought of each variable as being a complete story in and of itself. Sometimes it is more appropriate to use a combination of variables. For instance, the amount of time a person spends commuting to work each week can be broken down into several daily commutes. Similarly, the total gain or loss in a stock portfolio is the sum of the gains and losses in its components.

Example 3.4.17.

John travels to work five days a week. We will use \(X_1\) to represent his travel time on Monday, \(X_2\) to represent his travel time on Tuesday, and so on. Write an equation using \(X_1\text{,}\) ..., \(X_5\) that represents his travel time for the week, denoted by \(W\text{.}\)
Solution.
His total weekly travel time is the sum of the five daily values:
\begin{equation*} W = X_1 + X_2 + X_3 + X_4 + X_5 \end{equation*}
Breaking the weekly travel time \(W\) into pieces provides a framework for understanding each source of randomness and is useful for modeling \(W\text{.}\)

Example 3.4.18.

It takes John an average of 18 minutes each day to commute to work. What would you expect his average commute time to be for the week?
Solution.
We were told that the average (i.e. expected value) of the commute time is 18 minutes per day: \(E(X_i) = 18\text{.}\) To get the expected time for the sum of the five days, we can add up the expected time for each individual day:
\begin{align*} E(W) \amp = E(X_1 + X_2 + X_3 + X_4 + X_5)\\ \amp = E(X_1) + E(X_2) + E(X_3) + E(X_4) + E(X_5)\\ \amp = 18 + 18 + 18 + 18 + 18 = 90\text{ minutes } \end{align*}
The expectation of the total time is equal to the sum of the expected individual times. More generally, the expectation of a sum of random variables is always the sum of the expectation for each random variable.

Guided Practice 3.4.19.

Elena is selling a TV at a cash auction and also intends to buy a toaster oven in the auction. If \(X\) represents the profit for selling the TV and \(Y\) represents the cost of the toaster oven, write an equation that represents the net change in Elena’s cash.
 7 
She will make \(X\) dollars on the TV but spend \(Y\) dollars on the toaster oven: \(X-Y\text{.}\)

Guided Practice 3.4.20.

Based on past auctions, Elena figures she should expect to make about $175 on the TV and pay about $23 for the toaster oven. In total, how much should she expect to make or spend?
 8 
\(E(X-Y) = E(X) - E(Y) = 175 - 23 = \$152\text{.}\) She should expect to make about $152.

Guided Practice 3.4.21.

Would you be surprised if John’s weekly commute wasn’t exactly 90 minutes or if Elena didn’t make exactly $152? Explain.
 9 
No, since there is probably some variability. For example, the traffic will vary from one day to next, and auction prices will vary depending on the quality of the merchandise and the interest of the attendees.
Two important concepts concerning combinations of random variables have so far been introduced. First, a final value can sometimes be described as the sum of its parts in an equation. Second, intuition suggests that putting the individual average values into this equation gives the average value we would expect in total. This second point needs clarification — it is guaranteed to be true in what are called linear combinations of random variables.
A linear combination of two random variables \(X\) and \(Y\) is a fancy phrase to describe a combination
\begin{equation*} aX + bY \end{equation*}
where \(a\) and \(b\) are some fixed and known numbers. For John’s commute time, there were five random variables — one for each work day — and each random variable could be written as having a fixed coefficient of 1:
\begin{equation*} 1X_1 + 1 X_2 + 1 X_3 + 1 X_4 + 1 X_5 \end{equation*}
For Elena’s net gain or loss, the \(X\) random variable had a coefficient of +1 and the \(Y\) random variable had a coefficient of -1.
When considering the average of a linear combination of random variables, it is safe to plug in the mean of each random variable and then compute the final result. For a few examples of nonlinear combinations of random variables — cases where we cannot simply plug in the means — see the footnote.
 10 
If \(X\) and \(Y\) are random variables, consider the following combinations: \(X^{1+Y}\text{,}\) \(X\times Y\text{,}\) \(X/Y\text{.}\) In such cases, plugging in the average value for each random variable and computing the result will not generally lead to an accurate average value for the end result.

Linear combinations of random variables and the average result.

If \(X\) and \(Y\) are random variables, then a linear combination of the random variables is given by \(aX + bY\text{,}\) where \(a\) and \(b\) are some fixed numbers. To compute the average value of a linear combination of random variables, plug in the average of each individual random variable and compute the result:
\begin{gather*} E(aX+bY) = a\times E(X) + b\times E(Y) \end{gather*}
Recall that the expected value is the same as the mean, i.e. \(E(X) = \mu_{X}\text{.}\)

Example 3.4.22.

Leonard has invested $6000 in Google Inc. (stock ticker: GOOG) and $2000 in Exxon Mobil Corp. (XOM). If \(X\) represents the change in Google’s stock next month and \(Y\) represents the change in Exxon Mobil stock next month, write an equation that describes how much money will be made or lost in Leonard’s stocks for the month.
Solution.
For simplicity, we will suppose \(X\) and \(Y\) are not in percents but are in decimal form (e.g. if Google’s stock increases 1%, then \(X=0.01\text{;}\) or if it loses 1%, then \(X=-0.01\)). Then we can write an equation for Leonard’s gain as
\begin{gather*} \$6000\times X + \$2000\times Y \end{gather*}
If we plug in the change in the stock value for \(X\) and \(Y\text{,}\) this equation gives the change in value of Leonard’s stock portfolio for the month. A positive value represents a gain, and a negative value represents a loss.

Guided Practice 3.4.23.

Suppose Google and Exxon Mobil stocks have recently been rising 2.1% and 0.4% per month, respectively. Compute the expected change in Leonard’s stock portfolio for next month.
 11 
\(E(\$6000 \times X + \$2000\times Y) = \$6000\times 0.021 + \$2000\times 0.004 = \$134\text{.}\)

Guided Practice 3.4.24.

You should have found that Leonard expects a positive gain in Guided Practice 3.4.23. However, would you be surprised if he actually had a loss this month?
 12 
No. While stocks tend to rise over time, they are often volatile in the short term.

Subsection 3.4.7 Variability in linear combinations of random variables

Quantifying the average outcome from a linear combination of random variables is helpful, but it is also important to have some sense of the uncertainty associated with the total outcome of that combination of random variables. The expected net gain or loss of Leonard’s stock portfolio was considered in Guided Practice 3.4.23. However, there was no quantitative discussion of the volatility of this portfolio. For instance, while the average monthly gain might be about $134 according to the data, that gain is not guaranteed. Figure 3.4.25 shows the monthly changes in a portfolio like Leonard’s during the 36 months from 2009 to 2011. The gains and losses vary widely, and quantifying these fluctuations is important when investing in stocks.
Figure 3.4.25. The change in a portfolio like Leonard’s for the 36 months from 2009 to 2011, where $6000 is in Google’s stock and $2000 is in Exxon Mobil’s.
Just as we have done in many previous cases, we use the variance and standard deviation to describe the uncertainty associated with Leonard’s monthly returns. To do so, the standard deviations and variances of each stock’s monthly return will be useful, and these are shown in Table 3.4.26. The stocks’ returns are nearly independent.
Table 3.4.26. The mean, standard deviation, and variance of the GOOG and XOM stocks. These statistics were estimated from historical stock data, so notation used for sample statistics has been used.
Mean (\(\bar{x}\)) Standard deviation (\(s\)) Variance (\(s^2\))
GOOG 0.0210 0.0849 0.0072
XOM 0.0038 0.0520 0.0027
We want to describe the uncertainty of Leonard’s monthly returns by finding the standard deviation of the return on his combined portfolio. First, we note that the variance of a sum has a nice property: the variance of a sum is the sum of the variances. That is, if X and Y are independent random variables:
\begin{align*} Var(X + Y) \amp = Var(X) + Var(Y) \end{align*}
Because the standard deviation is the square root of the variance, we can rewrite this equation using standard deviations:
\begin{gather*} (SD_{X + Y})^2 = (SD_X)^2 + (SD_Y)^2 \end{gather*}
This equation might remind you of a theorem from geometry: \(c^2 = a^2 + b^2\text{.}\) The equation for the standard deviation of the sum of two independent random variables looks analogous to the Pythagorean Theorem. Just as the Pythagorean Theorem only holds for right triangles, this equation only holds when X and Y are independent.
 13 
Another word for independent is orthogonal, meaning right angle! When X and Y are dependent, the equation for \(SD_{X+Y}\) becomes analogous to the law of cosines.

Standard deviation of the sum and difference of random variables.

If X and Y are independent random variables:
\begin{gather*} SD_{X + Y} = SD_{X - Y} = \sqrt{(SD_X)^2 + (SD_Y)^2} \end{gather*}
Because \(SD_Y\) = \(SD_{-Y}\text{,}\) the standard deviation of the difference of two variables equals the standard deviation of the sum of two variables. This property holds for more than two variables as well. For example, if X, Y, and Z are independent random variables:
\begin{gather*} SD_{X + Y + Z} = SD_{X - Y - Z} = \sqrt{(SD_X)^2 + (SD_Y)^2 + (SD_Z)^2} \end{gather*}
If we need the standard deviation of a linear combination of independent variables, such as \(aX + bY\text{,}\) we can consider \(aX\) and \(bY\) as two new variables. Recall that multiplying all of the values of variable by a positive constant multiplies the standard deviation by that constant. Thus, \(SD_{aX}\) = \(a \times SD_X\) and \(SD_{bY}\) = \(b \times SD_Y\text{.}\) It follows that:
\begin{gather*} SD_{aX + bY} = \sqrt{(a \times SD_X)^2 + (b \times SD_Y)^2} \end{gather*}
This equation can be used to compute the standard deviation of Leonard’s monthly return. Recall that Leonard has $6,000 in Google stock and $2,000 in Exxon Mobil’s stock. From Table 3.4.26, the standard deviation of Google stock is 0.0849 and the standard deviation of Exxon Mobile stock is 0.0520.
\begin{align*} SD_{6000X + 2000Y} \amp = \sqrt{(6000\times SD_X)^2 + (2000\times SD_Y)^2}\\ \amp = \sqrt{(6000\times 0.0849)^2 + (2000\times .0520)^2}\\ \amp = \sqrt{270,304} = 520 \end{align*}
The standard deviation of the total is $520. While an average monthly return of $134 on an $8000 investment is nothing to scoff at, the monthly returns are so volatile that Leonard should not expect this income to be very stable.

Standard deviation of linear combinations of random variables.

To find the standard deviation of a linear combination of random variables, we first consider \(aX\) and \(bY\) separately. We find the standard deviation of each, and then we apply the equation for the standard deviation of the sum of two variables:
\begin{gather*} SD_{aX + bY} = \sqrt{(a\times SD_X)^2 + (b\times SD_Y)^2} \end{gather*}
This equation is valid as long as the random variables \(X\) and \(Y\) are independent of each other.

Example 3.4.27.

Suppose John’s daily commute has a standard deviation of 4 minutes. What is the uncertainty in his total commute time for the week?
Solution.
The expression for John’s commute time is
\begin{gather*} X_1 + X_2 + X_3 + X_4 + X_5 \end{gather*}
Each coefficient is 1, so the standard deviation of the total weekly commute time is
\begin{align*} \text{ SD } \amp = \sqrt{(1 \times 4)^2 + (1 \times 4)^2 + (1 \times 4)^2 + (1 \times 4)^2 + (1 \times 4)^2}\\ \amp = \sqrt{5\times (4)^2}\\ \amp = 8.94 \end{align*}
The standard deviation for John’s weekly work commute time is about 9 minutes.

Guided Practice 3.4.28.

The computation in Solution 3.4.27.1 relied on an important assumption: the commute time for each day is independent of the time on other days of that week. Do you think this is valid? Explain.
 14 
One concern is whether traffic patterns tend to have a weekly cycle (e.g. Fridays may be worse than other days). If that is the case, and John drives, then the assumption is probably not reasonable. However, if John walks to work, then his commute is probably not affected by any weekly traffic cycle.

Guided Practice 3.4.29.

Consider Elena’s two auctions from Guided Practice 3.4.19. Suppose these auctions are approximately independent and the variability in auction prices associated with the TV and toaster oven can be described using standard deviations of $25 and $8. Compute the standard deviation of Elena’s net gain.
 15 
The equation for Elena can be written as \((1) \times X + (-1) \times Y\text{.}\) To find the SD of this new variable we do: \(SD_{(1) \times X+(-1) \times Y}= \sqrt{(1 \times SD_{X})^2+(-1 \times SD_{Y})^2} = \sqrt{(1\times 25)^2)+(-1\times8)^2}=26.25\) The SD is about $26.25
Consider again Guided Practice 3.4.29. The negative coefficient for \(Y\) in the linear combination was eliminated when we squared the coefficients. This generally holds true: negatives in a linear combination will have no impact on the variability computed for a linear combination, but they do impact the expected value computations.

Subsection 3.4.8 Normal approximation for sums of random variables

We have seen that many distributions are approximately normal. The sum and the difference of normally distributed variables is also normal. While we cannot prove this here, the usefulness of it is seen in the following example.

Example 3.4.30.

Three friends are playing a cooperative video game in which they have to complete a puzzle as fast as possible. Assume that the individual times of the 3 friends are independent of each other. The individual times of the friends in similar puzzles are approximately normally distributed with the following means and standard deviations.
Mean SD
Friend 1 5.6 0.11
Friend 2 5.8 0.13
Friend 3 6.1 0.12
To advance to the next level of the game, the friends’ total time must not exceed 17.1 minutes. What is the probability that they will advance to the next level?
Solution.
Because each friend’s time is approximately normally distributed, the sum of their times is also approximately normally distributed. We will do a normal approximation, but first we need to find the mean and standard deviation of the sum. We learned how to do this in Section 3.4.
Let the three friends be labeled \(X\text{,}\) \(Y\text{,}\) \(Z\text{.}\) We want \(P(X + Y + Z \lt 17.1)\text{.}\) The mean and standard deviation of the sum of \(X\text{,}\) \(Y\text{,}\) and \(Z\) is given by:
\begin{align*} \mu_{sum} \amp = E(X+Y+Z) \amp \sigma_{sum}\amp = \sqrt{(SD_X)^2+(SD_Y)^2 + (SD_Z)^2}\\ \amp = E(X) + E(Y) + E(Z) \amp \amp = \sqrt{(0.11)^2+(0.13)^2+(0.12)^2}\\ \amp =4.6+4.8+4.5 \amp \amp = 0.208\\ \amp =17.5 \end{align*}
Now we can find the Z-score.
\begin{align*} Z \amp = \frac{x_{sum}-\mu_{sum}}{\sigma_{sum}}\\ \amp =\frac{17.1-17.5}{0.208}\\ \amp =-1.92 \end{align*}
Finally, we want the probability that the sum is less than 17.5, so we shade the area to the left of \(Z = -1.92\text{.}\) Using the normal table or a calculator, we get
\begin{gather*} P(Z \lt -1.92) = 0.027 \end{gather*}
There is a 2.7% chance that the friends will advance to the next level.

Guided Practice 3.4.31.

What is the probability that Friend 2 will complete the puzzle with a faster time than Friend 1? Hint: find \(P(Y \lt X)\text{,}\) or \(P(Y - X \lt 0)\text{.}\)
 16 
First find the mean and standard deviation of \(Y-X\text{.}\) The mean of \(Y-X\) is \(\mu_{Y-X}= 5.8 - 5.6 = 0.2\text{.}\) The standard deviation is \(SD_{Y-X} = \sqrt{(0.13)^2+(0.11)^2} = 0.170\text{.}\) Then \(Z = \frac{0-0.2}{0.170}=-1.18\) and \(P(Z \lt -1.18)=0.119\text{.}\) There is an 11.9% chance that Friend 2 will complete the puzzle with a faster time than Friend 1.

Subsection 3.4.9 Section summary

  • A discrete probability distribution can be summarized in a table that consists of all possible outcomes of a random variable and the probabilities of those outcomes. The outcomes must be disjoint, and the sum of the probabilities must equal 1.
  • A probability distribution can be represented with a histogram and, like the distributions of data that we saw in Chapter 2, can be summarized by its center, spread, and shape.
  • When given a probability distribution table, we can calculate the mean (expected value) and standard deviation of a random variable using the following formulas.
    \begin{align*} E(X) = \mu_{\scriptscriptstyle{X}} \amp = \sum{x_i\cdot P(x_i)} \amp\\ \amp = x_1\cdot P(x_1) + x_2\cdot P(x_2) + \cdots + x_n\cdot P(x_n)\\ Var(X) = \sigma^2_x \amp = \sum(x_i - \mu_{\scriptscriptstyle{X}})^2 \cdot P(x_i)\\ SD(X) = \sigma_{\scriptscriptstyle{X}} \amp =\sqrt{\sum(x_i - \mu_{\scriptscriptstyle{X}})^2 \cdot P(x_i)}\\ \amp =\sqrt{(x_1-\mu_{\scriptscriptstyle{X}})^2\cdot P(x_1) + (x_2-\mu_{\scriptscriptstyle{X}})^2\cdot P(x_2) + \cdots + (x_n-\mu_{\scriptscriptstyle{X}})^2\cdot P(x_n) } \end{align*}
    We can think of \(P(x_i)\) as the weight, and each term is weighted its appropriate amount.
  • The mean of a probability distribution does not need to be a value in the distribution. It represents the average of many, many repetitions of a random process. The standard deviation represents the typical variation of the outcomes from the mean, when the random process is repeated over and over.
  • Linear transformations. Adding a constant to every value in a probability distribution adds that value to the mean, but it does not affect the standard deviation. When multiplying every value by a constant, this multiplies the mean by the constant and it multiplies the standard deviation by the absolute value of the constant.
  • Combining random variables. Let \(X\) and \(Y\) be random variables and let \(a\) and \(b\) be constants.
    • The expected value of the sum is the sum of the expected values.
    • \(\displaystyle E(X+Y) = E(X) + E(Y)\)
    • \(\displaystyle E(aX+bY) = a\times E(X) + b\times E(Y)\)
    • When X and Y are independent: The standard deviation of a sum or a difference is the square root of the sum of each standard deviation squared.
    • \(\displaystyle SD(X + Y) = \sqrt{(SD(X))^2 + (SD(Y))^2}\)
    • \(\displaystyle SD(X - Y) = \sqrt{(SD(X))^2 + (SD(Y))^2}\)
    • \(\displaystyle SD(aX + bY) = \sqrt{(a\times SD(X))^2 + (b\times SD(Y))^2}\)
  • Because the sum or difference of two normally distributed variables is itself a normally distributed variable, the normal approximation is also used in the following type of problem.
    Find the probability that a sum \(X + Y\) or a difference \(X − Y\) is greater/less than some value.
    1. Verify that the distribution of \(X\) and the distribution of \(Y\) are approximately normal.
    2. Find the mean of the sum or difference. Recall: the mean of a sum is the sum of the means. The mean of a difference is the difference of the means. Find the SD of the sum or difference using: \(SD(X+Y)= SD(X-Y) = \sqrt{(SD(X))^2+(SD(Y))^2}\)
    3. Calculate the Z-score. Use the calculated mean and SD to standardize the given sum or difference.
    4. Find the appropriate area under the normal curve.
The SD properties require that \(X\) and \(Y\) be independent. The expected value properties hold true whether or not \(X\) and \(Y\) are independent.

Exercises 3.4.10 Exercises

1. Patreon Contributions.

The distribution of monthly contributions made to a particular Patreon creator is given as follows:
Monthly Contribution $3 $5 $10 $25
Proportion 0.50 0.30 0.15 0.05
  1. Compute the average monthly contribution made to this creator.
  2. Compute the standard deviation of the monthly contributions made to this creator.
Solution.
  1. Mean: \(\$3 \times 0.5 + \$5 \times 0.3 + \$10 \times 0.15 + \$25 \times 0.05 = \$5.75\text{.}\)
  2. To compute the SD, it is easier to first compute the variance: \((3 − 5.75)^2 \times 0.5 + (5 − 5.75)^2 \times 0.3+ (10−5.75)^2 \times 0.15+ (25−5.75)^2 \times 0.05 = 25.1875\text{.}\) The SD is then the square root of this value: $5.02.

2. Experiment Launch Impact.

An online shopping website develops new features and iterates on its product recommendations on a regular basis. The team also uses an experiment when launching each new feature to assess the impact of the change on the total sales. Below is a summary table of the impacts that the team observes
Number of Sales From Launch \(-200\) \(0\) \(+200\) \(+500\)
Proportion of Launches 0.1 0.5 0.3 0.1
  1. Compute the average impact for the experiments.
  2. Compute the standard deviation of the impact from these experiments.

3. Hearts win.

In a new card game, you start with a well-shuffled full deck and draw 3 cards without replacement. If you draw 3 hearts, you win $50. If you draw 3 black cards, you win $25. For any other draws, you win nothing.
  1. Create a probability model for the amount you win at this game, and find the expected winnings. Also compute the standard deviation of this distribution.
  2. If the game costs $5 to play, what would be the expected value and standard deviation of the net profit (or loss)? (Hint: profit = winnings \(-\) cost; \(X-5\))
  3. If the game costs $5 to play, should you play this game? Explain.
Solution.
  1. \(E(X) = 3.59\text{.}\) \(SD(X) = 9.64\text{.}\)
  2. \(E(X) = -1.41\text{.}\) \(SD(X) = 9.64\text{.}\)
  3. No, the expected net profit is negative, so on average you expect to lose money.

4. Ace of clubs wins.

Consider the following card game with a well-shuffled deck of cards. If you draw a red card, you win nothing. If you get a spade, you win $5. For any club, you win $10 plus an extra $20 for the ace of clubs.
  1. Create a probability model for the amount you win at this game. Also, find the expected winnings for a single game and the standard deviation of the winnings.
  2. What is the maximum amount you would be willing to pay to play this game? Explain your reasoning.

5. Portfolio return.

A portfolio’s value increases by 18% during a financial boom and by 9% during normal times. It decreases by 12% during a recession. What is the expected return on this portfolio if each scenario is equally likely?
Solution.
5% increase in value.

6. Baggage fees.

An airline charges the following baggage fees: $25 for the first bag and $35 for the second. Suppose 54% of passengers have no checked luggage, 34% have one piece of checked luggage and 12% have two pieces. We suppose a negligible portion of people check more than two bags.
  1. Build a probability model, compute the average revenue per passenger, and compute the corresponding standard deviation.
  2. About how much revenue should the airline expect for a flight of 120 passengers? With what standard deviation? Note any assumptions you make and if you think they are justified.

7. American roulette.

The game of American roulette involves spinning a wheel with 38 slots: 18 red, 18 black, and 2 green. A ball is spun onto the wheel and will eventually land in a slot, where each slot has an equal chance of capturing the ball. Gamblers can place bets on red or black. If the ball lands on their color, they double their money. If it lands on another color, they lose their money. Suppose you bet $1 on red. What’s the expected value and standard deviation of your winnings?
Solution.
\(E(X) = -0.0526\text{.}\) \(SD = 0.9986\text{.}\)

8. European roulette.

The game of European roulette involves spinning a wheel with 37 slots: 18 red, 18 black, and 1 green. A ball is spun onto the wheel and will eventually land in a slot, where each slot has an equal chance of capturing the ball. Gamblers can place bets on red or black. If the ball lands on their color, they double their money. If it lands on another color, they lose their money.
  1. Suppose you play roulette and bet $3 on a single round. What is the expected value and standard deviation of your total winnings?
  2. Suppose you bet $1 in three different rounds. What is the expected value and standard deviation of your total winnings?
  3. How do your answers to parts (a) and (b) compare? What does this say about the riskiness of the two games?

9. Lemonade at The Cafe.

Drink pitchers at The Cafe are intended to hold about 64 ounces of lemonade and glasses hold about 12 ounces. However, when the pitchers are filled by a server, they do not always fill it with exactly 64 ounces. There is some variability. Similarly, when they pour out some of the lemonade, they do not pour exactly 12 ounces. The amount of lemonade in a pitcher is normally distributed with mean 64 ounces and standard deviation 1.732 ounces. The amount of lemonade in a glass is normally distributed with mean 12 ounces and standard deviation 1 ounce.
  1. How much lemonade would you expect to be left in a pitcher after pouring one glass of lemonade?
  2. What is the standard deviation of the amount left in a pitcher after pouring one glass of lemonade?
  3. What is the probability that more than 50 ounces of lemonade is left in a pitcher after pouring one glass of lemonade?
Solution.
  1. Let X represent the amount of lemonade in the pitcher, Y represent the amount of lemonade in a glass, and W represent the amount left over after. Then, \(\mu_{W} = E(X - Y ) = 64 - 12 = 52\)
  2. \(\displaystyle \sigma_{W} = \sqrt{SD(X)^2 + SD(Y)^2} = \sqrt{1.732^2 + 1^2} \approx \sqrt{4} = 2\)
  3. \(\displaystyle P(W > 50) = P(Z > \frac{50-52}{2})= P(Z > -1) = 1 - 0.1587 = 0.8413\)

10. Spray paint, Part I.

Suppose the area that can be painted using a single can of spray paint is slightly variable and follows a nearly normal distribution with a mean of 25 square feet and a standard deviation of 3 square feet. Suppose also that you buy three cans of spray paint.
  1. How much area would you expect to cover with these three cans of spray paint?
  2. What is the standard deviation of the area you expect to cover with these three cans of spray paint?
  3. The area you wanted to cover is 80 square feet. What is the probability that you will be able to cover this entire area with these three cans of spray paint?

11. GRE scores, Part III.

In Exercise 2.3.9.3 and Exercise 2.3.9.5 we saw two distributions for GRE scores: \(N(\mu=151, \sigma=7)\) for the verbal part of the exam and \(N(\mu=153, \sigma=7.67)\) for the quantitative part. Suppose performance on these two sections is independent. Use this information to compute each of the following:
  1. The probability of a combined (verbal + quantitative) score above 320.
  2. The score of a student who scored better than 90% of the test takers overall.
Solution.
  1. The combined scores follow a normal distribution with \(\mu_{\text{combined}}= 304\) and \(\sigma_{\text{combined}}= 10.38\text{.}\) Then, \(P(\text{combined score} > 320)\) is approximately 0.06.
  2. \(Z=1.28\) (using calculator or table). Then we set \(1.28 = \frac{x-304}{10.38}\) and find \(x \approx 317\text{.}\)

12. Betting on dinner, Part I.

Suppose a restaurant is running a promotion where prices of menu items are random following some underlying distribution. If you’re lucky, you can get a basket of fries for $3, or if you’re not so lucky you might end up having to pay $10 for the same menu item. The price of basket of fries is drawn from a normal distribution with mean $6 and standard deviation of $2. The price of a fountain drink is drawn from a normal distribution with mean $3 and standard deviation of $1. What is the probability that you pay more than $10 for a dinner consisting of a basket of fries and a fountain drink?
You have attempted of activities on this page.