Functions of Random Variables
The Expected Value Rule
If is a function of random variable :
This formula lets you find the expected value of without first finding the PMF of .
Key Insight: Cannot Interchange Expectation and Functions
In general:
You cannot reason on averages when dealing with non-linear functions.
Example: Reciprocal
If is a random variable, then:
From the travel example: , but .
These are completely different!
Exceptions: Linear Functions
For linear functions :
This is the linearity of expectation. It always works, even for dependent random variables.
Temperature Conversion
If is temperature in Celsius and is temperature in Fahrenheit:
You can first convert to Fahrenheit, then average. Or average in Celsius, then convert. Either way gives the same result.
Multiple Random Variables
For multiple random variables, linearity still holds:
SAT Example
If are scores on three SAT sections:
- Total score
- Average total
You can average each section separately, then add. Or add scores for each student, then average. Same result.
Product of Independent Random Variables
If and are independent:
Why Does This Work?
If and are independent, knowing tells you nothing about . Therefore, knowing tells you nothing about for any function .
So if and are independent, then and are also independent, and:
Variance of Functions
Scaling
The variance scales by the square of the scaling factor.
Shifting
Adding a constant shifts the distribution but doesn’t change its spread.
Sum of Independent RVs
If and are independent:
Warning: This fails for dependent variables!
Example: Dependent Variables
If , then:
- But
These are different!
Indicator Variables
An indicator variable takes values 0 or 1, indicating whether an event occurred.
Binomial Example
For coin flips with probability of heads:
Let if flip is heads, 0 otherwise.
Then counts total heads.
This is much easier than summing over the binomial PMF!