# 4.5 Expectation

## Great Expectations

1. What is the expected sum of the numbers that come up when you roll a fair 6-sided die and a fair 12-sided die?
[Assume the faces have values 1-6 and 1-12, respectively.]

Exercise 1

The expectation of a sum is the sum of the individual expectations, so
$$\frac{1+2+...+6}{6} + \frac{1+2+...+12}{12} = \frac{7}{2} + \frac{13}{2}=10$$.

2. Suppose you have two computers: Computer 1 generates a random number in the set $$\{1,2,\ldots,99\}$$ with all numbers equally likely. Similarly, Computer 2 generates a random number in $$\{1,2,\ldots,999\}$$ with all numbers equally likely.

You roll a fair die, and if a 5 comes up, you generate a random number using Computer 1, otherwise you generate a random number using Computer 2. What is the expected value of the number you generate?

Exercise 2

Let $$R$$ denote the value on the die, let $$G$$ denote the generated number, let $$C_1$$ denote the number Computer 1 generates and $$C_2$$ the one Computer 2 generates.
By the law of Total Expectation, $E[G] = E[G\;|\;R=5]\Pr[R=5] + E[G\;|\;R\neq 5]\Pr[R\neq 5]$ $$E[G\;|\;R=5] = E[C_1]=50$$, since each number is equally likely. Similarly, $$E[G\;|\;R\neq 5]= E[C_2]=500$$. Hence, $$E[G] = \frac{1}{6}\cdot 50+\frac{5}{6}\cdot 500 = \frac{2550}{6} = \fbox{425}.$$

3. Assuming that Computers 1 & 2 act independently, what is the expected value of the product of the numbers they generate?
Exercise 3

The Product Rule can be used because the two random variables are independent, so $E[C_1\cdot C_2]=E[C_1]\cdot E[C_2]=50\cdot 500 = 25000.$