# Relation between a random variable and its conditional expectation

I have a random variable $X$ and its conditional expectation $E(X | G) = Y$.

In the context of some homework, I have to reach the conclusion that $P(X = 0 \text{ and } Y \neq 0) = 0$ But isn't this always the case? I think we have $P(X = 0 \text{ and } Y \neq 0) = P(Y \neq 0 | X=0) P(X=0)$ and $P(Y \neq 0 | X=0) = 0$ since when $X = 0$, its conditional expectation is $0$ too

Am I missing something here? thanks!

-
"when $X=0$ its conditional expectation is 0 too"... whose conditional expectation? – Xabier Domínguez Oct 10 '12 at 21:55
E(X | G), for any G possible? – lezebulon Oct 10 '12 at 22:03
For each event $G$, $X|G$ is a different random variable. If by "when $X=0$" you mean that you are considering the random variable $X|[X=0],$ that is a "constant random variable" (i. e. it takes only one value) and indeed, its expectation is zero. But this does not mean that $E(X)=0,$ nor that these considerations will help you in evaluating $P[Y\ne 0|X=0]$. – Xabier Domínguez Oct 10 '12 at 22:14
alright I understand my mistake, I though that P(X = 0) meant "probability that X is the constant 0" – lezebulon Oct 10 '12 at 22:21
The conditional probability part doesn't always work. You can only split $P(X = 0 \textrm{ and } Y \neq 0)$ into $P(Y \neq 0 | X = 0) P(X = 0)$ if $P(X = 0) \neq 0$, because, by definition, $P(Y \neq 0 | X = 0) \equiv \frac{P(X = 0 \textrm{ and } Y = 0)}{P(X = 0)}$, so $P(X = 0) = 0$ results in division by zero, making $P(Y \neq 0 | X = 0)$ undefined. – Firefeather Oct 11 '12 at 21:53

First, you probably misunderstood the question: $G$ denotes a sigma-algebra, not an event. Note that if $B$ is an event (of nonzero probability) then $\mathbb E(X\mid B)$ is a real number, not a random variable, and you are asked to consider the situation where $\mathbb E(X\mid G)$ coincides with the random variable $Y$.
Second, the claimed property does not hold without some additional hypotheses: assume that the sigma-algebra is $G=\{\varnothing,\Omega\}$, then $Y=\mathbb E(X)$, hence every random variable $X$ such that $\mathbb E(X)\ne0$ and $\mathbb P(X=0)\ne0$ is a counterexample.