Expected value of a function of a random variable
Summary
Discrete random variable
- \(X\) is a discrete random variable with probability mass function \(f\left( x \right)\) and \(Y=g(X)\) for some function \(g\) . Then
\[E\left( Y \right)=\sum_{i=1}^{n}{ g\left( x_i \right)f\left( x_i \right) }\]
Example
- The range of \(X\) is \(\{ 1,2 \}\) ,
- \(f\left( 1 \right)=2/3\) , \(f\left( 2 \right)=1/3\) ,
- \(Y=X^2+1\) .
- Then
\[E\left( Y \right)=\left( 1^2+1 \right)⋅ \frac{2}{3}+\left( 2^2+1 \right)⋅ \frac{1}{3}=3\]
Continuous random variable
- \(X\) is a continuous random variable with probability density function \(f\left( x \right)\) and \(Y=g(X)\) for some function \(g\) . Then
\[E\left( Y \right)=\int_{-∞}^{∞}{ g\left( x \right)f\left( x \right)dx }\]
Example
- The range of \(X\) is \(\left[ 0,1 \right]\) ,
- \(f\left( x \right)=x^2/3\) ,
- \(Y=\sqrt{X}\) .
- Then
\[E\left( Y \right)=\int_{0}^{1}{ \sqrt{x}⋅ \frac{x^2}{3}dx }= \frac{1}{3}\int_{0}^{1}{ x^{5/2}dx }= \frac{1}{3} \frac{2}{7}{\left[ x^{7/2} \right]}_0^1= \frac{2}{21}\]