The meaning of denotation E[X|Y]? Assume we have 2-dim data $(x,y): {(a_1,b_1),...,(a_n,b_n)}$; where $X, Y$ are random variables.
The conditional expectation is $E(X|Y=b_j)=\sum_{i}a_iP(X=a_i|Y=b_j)$
There is a theorem: $E(E(X|Y))=E(X)$, but what does $E(X|Y)$ exactly mean? In the former fomula, $Y=b_j$ is a condition, but $X|Y$ does not really make sense?

$\mathbb E\left(X\mid Y\right)$ is by definition a random variable satisfying:


*

*It is measurable with respect to the $\sigma$-algebra generated by rv $Y$.

*$\int_{A}X\left(\omega\right)\rm  P\left(d\omega\right)=\int_{A}\mathbb E\left(X\mid Y\right)\left(\omega\right)\rm P\left(d\omega\right)$
for each set $A$ in $\sigma$-algebra generated by rv $Y$.
Taking $A=\Omega$ in the second bullet point we get $\mathbb EX=\mathbb E[\mathbb E(X\mid Y)]$.
