# For any function $h(\cdot)$, $h(X)$ is a random variable (at least if we forget about measurability issues) [duplicate]

My probability notes say the following:

For any function $$h(\cdot)$$, $$h(X)$$ is a random variable (at least if we forget about measurability issues). To calculate the expectation $$Eh(X)$$, one can derive the distribution of $$h(X)$$, say, $$Y = h(X)$$, and compute $$E[Y]$$ or use the following direct calculation: $$E[h(X)] = \begin{cases} \sum_{x_i} h(x_i) p_i & \text{if X is discrete} \\ \int h(x) f(x) \ dx & \text{if X is continuous} \end{cases}$$

I have not studied any measure theory, but I'm curious about this statement about measurability issues. Would someone please explain what the "issue" is here, in more-understandable probability theory language (rather than measure theory language)? So is it still valid to consider $$h(X)$$ as a random variable? It seems like it is saying "this is incorrect, but proceed as if it were correct anyway"; it isn't clear to me how this results in sensible mathematics, which, clearly, it does, since, in probability theory, we often just assume that $$h(X)$$ can be considered as a random variable, as done in the excerpt.

• A random variable is a real valued measurable function on a probability space. How can measurability issue be ignored? Jul 12, 2021 at 9:57
• @KaviRamaMurthy Well, the point of my question is to understand what's going on here, so I have no idea. Jul 12, 2021 at 9:59
• – Joe
Jul 12, 2021 at 10:24

Basically, for $$h(X)$$ to be a random variable (following the rigorous definition), you need $$h$$ to have a nice property called "measurability". I don't think you can get a more useful answer without learning the basic ideas of measure theory (to start, see $$\sigma$$-algebra, measurable space and measurable function)
• But this doesn't answer whether it is still valid to consider $h(X)$ as a random variable. Jul 12, 2021 at 10:35
• If $h$ is measurable, then $h(X)$ is a random variable. If $h$ is not measurable, $h(X)$ might not be a random variable. More details would mean getting into measure theory. Jul 12, 2021 at 10:38
• Hmm, so why does the excerpt seem to assume that it is valid to proceed as if $h(X)$ is a random variable? It seems like it is saying "this is incorrect, but proceed as if it were correct anyway"; it isn't clear to me how this results in sensible mathematics, which, clearly, it does, since, in probability theory, we often just assume that $h(X)$ can be considered as a random variable. Jul 12, 2021 at 10:41
• Because measurability is a pretty weak condition. Most function you will encounter are measurable. If you are not interested in being rigorous, it is ok to neglect this. To be rigorous, you need to check each time that $h$ is measurable. Jul 12, 2021 at 10:43