Probability Hybrid Function Transformation

19 Views Asked by At

I was trying to use the fact that $E[g(K)]=\sum g(k)f(k)$ (if $K$ is discrete or change the sum for an integral for the continuous case) on a hybrid function of a random variable that consists of multiple random variables. The below function will be my example.

$$Z=\cases{ X \quad \text{w.p.} \ 0.5 \\ Y \quad \text{w.p.} \ 0.5 } $$

Intuitvely, $E[Z]=0.5E[X]+0.5E[Y]$ and through the use of indicator functions $Z$ can be rewritten as (I'm not sure about this):

$$ \begin{align} Z&=1_AX+1_BY \\ E[Z]&=0.5E[X]+0.5E[Y] \end{align}$$

$$ 1_A=1_B=\cases{ 1 \quad \text{w.p.} \ 0.5 \\ 0 \quad \text{w.p.} \ 0.5 }$$

However, I'm unsure if my original equation to the indicator equation are equivalent. When I try to prove the same result through only using the hybrid funciton (i.e. not changing it into the indicator format if that even is an equivalent expression)I get confused. The following two formulas below are what I get from applying the expectation. $$ E[Z]=\cases{ E[X] \quad \text{w.p.} \ 0.5 \\ E[Y] \quad \text{w.p.} \ 0.5 } $$ $$ E[Z]=0.5X+0.5Y $$ Could I get some help? It has been driving me nuts.