# If $Y=g[X]$, why is $E[Y]$ not $g[E[X]]$?

I cannot seem to grasp why we usually have to factor in $$var[X]$$ to determine $$E[Y]$$ when $$Y$$ is some function of an independent random variable $$X$$, if we wish to calculate the mean value of $$Y$$ surely it must be $$Y$$ at the mean value of $$X$$ if $$Y$$ is to be the dependent variable? If $$Y=g[X]$$ why isn't it that $$E[Y]=g[E[Y]]$$?

• Did you try some examples? For example, $g[X]=X^2$? May 8, 2023 at 11:02
• Why should it be? The average of, say, the reciprocals of two natural numbers is not the reciprocal of the average of the two numbers. Very few pairs of functions commute.
– lulu
May 8, 2023 at 11:02
• @lulu you are right, I was ignoring the fact that quite literally the two graphs for each variable can be quite skewed as we must account for the fact a given function might map more inputs close or further away from each other, a perfect normal distribution might end up looking quite skewed if you put it through something like a cubic function. May 8, 2023 at 11:50
• The third moment of a normal distribution is called skewness and is zero like every other odd moment. May 8, 2023 at 14:20