---
output:
  pdf_document: default
  html_document: default
---
# Section 3.3: Functions of random variables (Speegle 3.4)

### Example
Let $X = {-2, -1, 0, 1, 2}$, all equally likely and $g(x) = X^{2}$. Find the pmf of $y=g(x)$, and $E(Y)$. 


### You try it
Using the random variable $X$ in the above example, find the pmf and expected value of $Y = 2X+1$. 


### Example
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}, \ldots X_{5}$ that represents his travel time for the week, denoted by $W$.


* 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? Explain how you got to this answer? 


What was a major assumption that we had to make to figure out this example? 


## Independent Random Variables (Speegle 3.5.1)

### Example
1. Find $E(2X+5)$ if $E(X) = 4$



2. Find $E(2X+5Y)$ if $E(X) = 4$ and $E(Y) = -2$


### You try it
1. Let $E(X) = 2$. Find $E(3X-1)$. 



2. Find $E(2)$ 


3. Find $E(2X-3Y)$ when $E(X) = -4$ and $E(Y)=1$

## Theorem 3.9: Alternative method to calculate variance

### Example
Let $X = {-2, -1, 0, 1, 2}$, all values equally likely. Find $E(X)$ and $Var(X)$.


### You try it
Let $Y = 2x$ where $x = {0, 1, 2}$ and $p(x) = {.1, .5, .4}$. Find $E(X)$ and $Var(X)$. 


\newpage
## Theorem 3.10: Rules of Variance

1. Let $X$ be a random variable and $c$ a constant. Then


2. Let $X$ and $Y$ be independent random variables. Then



### Example
Suppose that three random variables $X_{1},X_{2},X_{3}$ form a random sample from a distribution for which the mean is 5 and the variance is 3. Determine the value of $E(2X_{1}-3X_{2}+X_{3}-4)$ and Var($2X_{1}-3X_{2}+X_{3}-4$).



### You try it:
Marksmanship competition at a certain level requires each contestant to take ten shots with each of two different handguns. Final scores are computed by taking a weighted average of 4 times the number of bull-eyes made with the first gun plus 6 times the number gotten with the second gun. If Bertha has a 30% chance of hitting the bull's-eye with each shot from the first gun and a 40% chance with each shot from the second gun, what is the variance of her score?
