If I have to calculate $\mathrm{E}(2^X)$, is it then just $(2^{x_1} \cdot p_1) + (2^{x_2} \cdot p_2) + (2^{x_3} \cdot p_3)$ etc.?
Like $\mathrm{E}(X)$ is just $(x_1 \cdot p_1) + (x_2 \cdot p_2)$ etc.
Thanks.
If I have to calculate $\mathrm{E}(2^X)$, is it then just $(2^{x_1} \cdot p_1) + (2^{x_2} \cdot p_2) + (2^{x_3} \cdot p_3)$ etc.?
Like $\mathrm{E}(X)$ is just $(x_1 \cdot p_1) + (x_2 \cdot p_2)$ etc.
Thanks.
Copyright © 2021 JogjaFile Inc.
Yes, you are right. This is sometimes called the law of the unconscious statistician. If it is a discrete distribution and one knows its probability mass function $f_X$ (but not $f_{g(X)}$), then the expected value of $g(X)$ is $$ \operatorname{E}[g(X)] = \sum_x g(x) f_X(x) $$ where the sum is over all possible values $x$ of $X$.