Skip to main content

Section 2.5 Linear Combinations of Random Variables (P5)

When we sample data, we're picking a value from the probability distribution of a random variable. But it's not usually the case that we do this one at a time. When we take a sample of size \(n\text{,}\) this is \(n\) values of the random variable. So we're naturally interested in dealing with multiple random variables at once. In this section we address sums, differences and scaling of random variables.

Exploration 2.5.1. Sum of Dice.

We saw in Exploration 2.4.3 the distribution, mean and variance of the outcome of a die roll, \(X\text{.}\) Consider rolling a pair of die, a blue and green one as in Activity 2.2.7. Consider the possible pairs of outcomes.

\begin{equation*} \begin{array}{cccccc} (1,1)\amp(2,1)\amp(3,1)\amp(4,1)\amp(5,1)\amp(6,1)\\ (1,2)\amp(2,2)\amp(3,2)\amp(4,2)\amp(5,2)\amp(6,2)\\ (1,3)\amp(2,3)\amp(3,3)\amp(4,3)\amp(5,3)\amp(6,3)\\ (1,4)\amp(2,4)\amp(3,4)\amp(4,4)\amp(5,4)\amp(6,4)\\ (1,5)\amp(2,5)\amp(3,5)\amp(4,5)\amp(5,5)\amp(6,5)\\ (1,6)\amp(2,6)\amp(3,6)\amp(4,6)\amp(5,6)\amp(6,6)\\ \end{array} \end{equation*}

Let \(Y\) denote the sum of both die.

(a)

What are the possible values of \(Y\)

(b)

For each possible sum (\(Y_i\)), find the probability that the sum of the die will give that value (\(P(Y=Y_i)\)).

\begin{equation*} \begin{array}{|c|c|c|c|c|c|c|c|c|c|} \hline Y_i \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \amp \hspace{0.5in} \\ \hline P(Y=Y_i) \amp \amp \amp \amp \amp \amp \amp \amp \amp \amp \amp \\ \hline \end{array} \end{equation*}

(c)

Compute \(E(Y)\) and \(Var(Y)\text{.}\)

How do these values compare to \(E(X), Var(X)\) found in Activity 2.4.5?

(d)

Run the following code to simulate 1,000 blue and green die rolls and plot a histogram of their sum.

(e)

Run the following code to find the mean and variance of these dierolls.

How do these values compare to the what you found in (c)?

Remark 2.5.1.

Given independent random variables \(X, Y\) and a constant \(c\text{,}\) the random variable \(X+Y\) has:

\begin{equation*} E(X+Y)=E(X), +E(Y), Var(X+Y)=Var(X)+Var(Y) \end{equation*}

and the random variable \(cX\) has

\begin{equation*} E(cX)=cE(X), Var(cX)=c^2Var(X). \end{equation*}

What was computed in Exploration 2.5.1 is the expectation and variance of \(Y=X_B+X_G\) the sum of the blue and green die rolls. Note that both \(X_B, X_G\) have the same expectation and variance as a single die roll \(X\) as in Activity 2.4.5.

Activity 2.5.2. Difference of Dice.

W Consider rolling a pair of die, a blue and green one as in Exploration 2.5.1. Consider the possible pairs of outcomes.

\begin{equation*} \begin{array}{cccccc} (1,1)\amp(2,1)\amp(3,1)\amp(4,1)\amp(5,1)\amp(6,1)\\ (1,2)\amp(2,2)\amp(3,2)\amp(4,2)\amp(5,2)\amp(6,2)\\ (1,3)\amp(2,3)\amp(3,3)\amp(4,3)\amp(5,3)\amp(6,3)\\ (1,4)\amp(2,4)\amp(3,4)\amp(4,4)\amp(5,4)\amp(6,4)\\ (1,5)\amp(2,5)\amp(3,5)\amp(4,5)\amp(5,5)\amp(6,5)\\ (1,6)\amp(2,6)\amp(3,6)\amp(4,6)\amp(5,6)\amp(6,6)\\ \end{array} \end{equation*}

Let \(Z\) denote the difference of the green die subtracted from the blue die (\(Z=X_B-X_G\)). Note that \(Z=X_B+(-1)X_G\text{.}\)

(a)

Use Remark 2.5.1 to rewrite

\begin{equation*} E(X_B+(-1)X_G)=E(X_B)+E((-1)X_G)=E(X_B)+(-1)E(X_G) \end{equation*}

and compute \(E(X_B+(-1)X_G).\)

(b)

Use Remark 2.5.1 to rewrite

\begin{equation*} Var(X_B+(-1)X_G)=Var(X_B)+Var((-1)X_G)=Var(X_B)+(-1)^2Var(X_G) \end{equation*}

and compute \(Var(X_B+(-1)X_G).\)

(c)

Run the following code to simulate 1,000 blue and green die rolls and plot a histogram of their differences.

(d)

Run the following code to find the mean and variance of these dierolls.

How do these values compare to the what you found in (a) and (b)?

Activity 2.5.3. Fast Food Group Order.

Recall the fast food orders of Activity 2.4.6. Suppose a group of ten friends order together, and let the cost of their order be \(G=X_1+\ldots X_{10}\) where each \(X_i\) is the cost of an individual order as in Activity 2.4.6. Also suppose these orders will be independent of each other.

(a)

Use Remark 2.5.1 and the fact that

\begin{equation*} G=X_1+X_2+X_3+X_4+X_5+X_6+X_7+X_8+X_9+X_{10} \end{equation*}

to find \(E(G), Var(G)\text{.}\)

(b)

Run the following code to simulate 200 groups of ten and plot a histogram of their purchase amounts.

(c)

Run the following code to find the mean and variance of the purchase amounts.

How do these values compare to the what you found in (a)?

Activity 2.5.4. Ice Cream.

Suppose that a box of Ice Cream comes with on average 60 oz of ice cream, but because theyre not all packed evenly, with a standard deviation of 2 oz. Suppose a scoop of ice cream is 3oz, but with standard deviation of 0.15oz.

(a)

Let \(B\) denote the number of oz in a box of ice cream and find \(E(B), Var(B)\text{.}\) (Hint: recall Remark 2.4.5 and the relationship between standard deviation and variance.)

(b)

Let \(S\) denote the number of oz in a scoop of ice cream and find \(E(S), Var(S)\text{.}\)

(c)

Let \(R\) denote the amount of ice cream remaining in a box after I take 2 scoops out, note that \(R=B-S_1-S_2=B+(-1)S_1+(-1)S_2\text{.}\)

Find \(E(R), Var(R)\text{.}\)

(d)

Run the following code to simulate 1000 boxes of icecream with 2 scoops removed.

(e)

Run the following code to find the mean and variance of these remains.

How do these values compare to the what you found in (c)?