[Math] Expected value of a random variable power of another random variable

probabilityprobability distributionsrandom variables

I have the following problem:

Suppose $Z = Y^X$ is a random variable, where $Y$ is a generic random variable and $X$ is a binary random variable which takes value $1$ with probability $p$ and value $2$ with probability $1 – p$.

I need to find the expected value $\mathbb{E}[Z]$, but I don't even understand from where to start!

Best Answer

Let Y be a generic random variable, and let X be a binary random variable such that $P(X=1)=p$ and $P(X=2)=1-p$.

$$ E[Z] = E[Y^X|X=1]P(X=1) + E[Y^X|X=2]P(X=2) = E[Y|X=1]p + E[Y^2|X=2](1-p) $$

If $X$ and $Y$ are independent, then $E[Y|X=1]=E[Y]$ and $E[Y^2|X=2]=E[Y^2]$, which means that the above equation reduces to:

$$ E[Z] = E[Y]p + E[Y^2](1-p)$$

Related Question