Conditional expectation on a sub-sigma-algebra I am having troubles understanding what it means to calculate $E[X \vert \mathcal{G}]$ if $\mathcal{G}$ is a sub-$\sigma$-algebra of $\mathcal{F}$. The definition in my book states that:
$$\forall G \in \mathcal{G}: E[E[Y\vert \mathcal{G}]1_G] = E[Y1_G]$$
For example. I tried letting $\Omega = \left\{ a,b,c,d \right\}$ with $P(\left\{ i \right\}) = \frac{1}{4}$ for all $i \in \Omega$. And $\mathcal{F} = 2^\Omega$. Then I created the random variables
$X(\omega) = \begin{cases} 1 & \text{if $\omega \in \left\{a,b \right\}$  } \\ 0 & \text{if $\omega \in \left\{c,d \right\}$} \end{cases} $
$Y(\omega) = \begin{cases} 1 & \text{if $\omega \in \left\{b,c \right\}$  } \\ 0 & \text{if $\omega \in \left\{a,d \right\}$} \end{cases} $
and let $\mathcal{G} = \left\{\emptyset,\Omega,\left\{a,b \right\},\left\{c,d \right\} \right\}$ Then I wish to calculate $E[XY\vert \mathcal{G}]$ and $E[X\vert \mathcal{G}] \cdot E[Y\vert\mathcal{G}]$ but I don't know how to do that unfortunately. Could someone please help?
 A: To calculate this let me state some facts about conditional expectation:
It holds for a random variable H


*

*If $Z$ is a $\mathcal G$ measurable random variable then $E[ZH|\mathcal G] = Z \cdot E[H|\mathcal G]$

*$E[Z|\mathcal G]$ is a.s. unique


Thus, for your purposes it suffices to calculate $E[Y|\mathcal G]$, because we have $E[X|\mathcal G] = X$ already for $X$ is $\mathcal G$ measurable.
In this case one way is to pop up with a candidate for $E[Y|\mathcal G]$ and show that it fulfilles the definition.
For this we consider the possibilities for $E[Y 1_G]$ while $G\in \mathcal G$ and that in this special case a $\mathcal G$ measurable random variable is of the form
$$\sum_{G\in \mathcal G} \lambda_G 1_G $$
where $\lambda_G$ is a coefficient. We want something like
$$E[\lambda_{\{a,b\}}1_{\{a,b\}}] = E[Y1_{\{a,b\}}],\quad E[\lambda_{\{c,d\}}1_{\{c,d\}}] = E[Y1_{\{c,d\}}]$$
The approach is then
$$E[Y|\mathcal G] = \frac{1}{P(\{a,b\})}E[Y 1_{\{a,b\}}]1_{\{a,b\}} + \frac{1}{P(\{c,d\})}E[Y 1_{\{c,d\}}]1_{\{c,d\}}$$
It easy then to varify the definition.
