# Conditional Expectation of a random variable given sigma algebra is the same random variable

We define the conditional expectation of a random variable $X$ on a given probability space $(\Omega,\mathscr F, P)$ w.r.t a sub $\sigma$-algebra $\mathscr G$ is a random variable denoted by $E[X|\mathscr G]$ defined as random variable that satisfies the following condition

$\int_{A}E[X|\mathscr{G}] \hspace{0.1 cm}dP = \int_A X\hspace{0.1 cm}dP \hspace{0.3 cm}\text{for all } A \in \mathscr{G}$

But we know that if $X_1$ and $X_2$ are two random variables satisfying the condition that

$\int_{A}X_1 \hspace{0.1 cm}dP = \int_A X_2\hspace{0.1 cm}dP \hspace{0.3 cm}\text{for all } A \in \mathscr{G}$, then $X_1 = X_2$ a.s.

Therefore for the conditonal expectation defined as above, we conclude that $E[X|\mathscr G] = X$ a.s. Then what is the major difference between $E[X|\mathscr G]$ and $X$?

• $\int_A X_1\ \mathsf d\mathbb P=\int_A X_2\ \mathsf d\mathbb P$ for all $A\in\mathcal G$ implies that $\mathbb E[X_1\mid\mathcal G]=\mathbb E[X_2\mid\mathcal G]$ a.s., not that $X_1=X_2$ a.s. – Math1000 Apr 4 '16 at 7:51
• $\int_{A}X_1 \hspace{0.1 cm}dP = \int_A X_2\hspace{0.1 cm}dP \hspace{0.3 cm}$ for all $A \in \mathscr{G}$, then $X_1 = X_2$ a.s. is TRUE I believe strongly. Do you agree that if $\int_A Y \hspace{0.1 cm} dP=0$ for all $A \in \mathscr{G}$, then $Y=0$ a.s. Do you agree this? If you don;t agree this..pls provide a counter example. – Uday Kumar Apr 4 '16 at 8:45
• Counterexample - $\mathcal G=\{\varnothing, \Omega\}$. – Math1000 Apr 4 '16 at 16:26
• This is not the correct counter example. Only constant functions(or random variables) are measurable with respect to the trivial sigma algebra $\mathcal G = \{ \Phi,\Omega\}$ – Uday Kumar Apr 5 '16 at 6:03
• Fair enough, I was being a bit glib :) – Math1000 Apr 5 '16 at 6:07

Let $$\mathbb P(X=1) = \mathbb P(X=-1)=\frac12,$$ $Y=2X$, and $$\mathbb P(W=1) = \mathbb P(W=0)=\frac12,$$ with $W$ and $X$ independent. Then $$\mathbb E[X\mid\sigma(W)]=\mathbb E[X] = 0,\quad E[Y\mid\sigma(W)]=\mathbb E[Y] = 0\ a.s.$$ so for any $A\in\sigma(W)$, $$\mathbb E[\mathbb E[X\mathsf \mid\sigma(W)]1_A] = \mathbb E[\mathbb E[X]\mathsf 1_A]=\mathbb E[X]\mathbb P(A)=0$$ and similarly for $Y$. But $\mathbb P(X\ne Y)=1$, so clearly $X\ne Y$ a.s.