# From conditional to unconditional expectation

Consider a random variable $$Y$$ and a random variable $$G$$. $$G$$ can only take value $$1$$ or $$0$$.

Is it true that $$E(Y|G=0)\geq 0 \Leftrightarrow E((1-G)Y) \geq 0 \quad ?$$

My thought is yes and below I report the proof (I imagine that $$Y$$ is discrete for simplicity). Is it correct? What is really that I'm leveraging on for this result?

$$E(Y|G=0)=\sum_{y} y Pr(Y=y|G=0)\geq 0 \Leftrightarrow \sum_{y} y Pr(Y=y|G=0)Pr(G=0)\geq 0 \Leftrightarrow \sum_{y} y Pr(Y=y,G=0)\geq 0 \Leftrightarrow E((1-G)Y)\geq 0$$

You can prove this proposition by law of iterated expectations. \begin{align} \mathbb{E} (1-G)Y &= \mathbb{E}_G \mathbb{E}_Y( (1-G)Y | G)\\ &= \mathbb{P}(G=1) \mathbb{E}_Y(0*Y|G=1) + \mathbb{P}(G=0)\mathbb{E}_Y(1*Y| G=0)\\ &= \mathbb{P}(G=0) \mathbb{E}_Y(Y|G=0). \end{align} It is clear that your proposition is true. The key to proving this proposition is to use the $$1-G$$ as an indicator function.