# Random variables $X,Y$ such that $E(X|Y)=E(Y|X)$ a.s.

Let $$X$$ and $$Y$$ be random variables such that $$E(|X|), E(|Y|)<\infty$$ and $$E(X|Y)=E(Y|X)$$ a.s. Then is it true that $$X=Y$$ a.s. ? If this is not true in general, what happens if we also assume $$X,Y$$ are identically distributed ?

Not true at all.

Let $$X, Y$$ be indepedently, identically distributed.

$$\mathbb{E}(X ) = \mathbb{E}(X | Y ) = \mathbb{E}(Y|X ) = \mathbb{E}(Y )$$

but this does not mean $$P(X = Y) = 1$$.

Suppose $$X, Y \overset{iid}{\sim} Normal(\mu, \sigma^2)$$.

Note that $$P(Z = 0) = 0$$, where $$Z := X -Y$$, because $$Z \sim N(0, 2\sigma^2)$$ is a continuous R.V.

So the probability measure of the event $$X = Y$$ is $$0$$, not $$1$$ (as in almost sure case).

But since $$X, Y$$ are independent,

$$\mu = \mathbb{E}(X ) = \mathbb{E}(X | Y ) = \mathbb{E}(Y|X ) = \mathbb{E}(Y )$$

• You mean to say $E(X|Y)$ is a constant random variable !? Also I would like to point out that $E(X|X)=X$ ... – user521337 Dec 20 '18 at 2:40
• @user521337 Yes, since $X$ is independent of $Y$. – Moreblue Dec 20 '18 at 2:42
• Also, $Z$ is $N(0 , \sigma^2)$ ... – user521337 Dec 20 '18 at 2:49
• @user521337 No, $Z \sim N(0, 2 \sigma^2)$. For the variance, check here – Moreblue Dec 20 '18 at 2:50
• again ... I would like to point out that $E(X|X)=X$ and not $E(X)$ ... – user521337 Dec 20 '18 at 2:52