Expectation of a random variable probabilistically defined in terms of other random variables

For instance, $$X = \begin{cases} Y, & \text{with probability} ~0.3,\\ Z, & \text{with probability} ~0.7, \end{cases}$$ where $$Y$$ and $$Z$$ are random variables with known distributions.

How does one find the expectation of $$X$$

• One applies a definition or an equivalent formula. An attractive one for this application is the tower formula, aka the law of iterated expectations.
– whuber
Mar 14, 2022 at 20:03

As @whuber commented, the representation of $$X$$ is conditional on $$Y$$ and $$Z$$. That is, conditional on $$Y$$ and $$Z$$, $$X$$ behaves like a Bernoulli random variable. Therefore, $$E(X\mid Y,Z) = 0.3 Y + 0.7Z.$$ This gives us $$E(X) = 0.3E(Y) + 0.7 E(Z)$$. A minor remark would be that what you wrote in the original post is typically how we construct a mixture distribution.
• In other words, $X=BY+(1-B)Z$ where $B \sim \text{Bernoulli}(0.3)$, independent of $Y,Z$. Mar 14, 2022 at 20:58