# Thread: conditional expectation

1. ## conditional expectation

I have a question regarding E[X|Y]. I always thought that the expectation of E[X] was always a constant. However, I read in a proof of the law of total expectation that E[X|Y] is actually a function of Y. Can someone explain why?

2. Hello,

E[X|Y] is a random variable, and sometimes depends on Y (if X is independent from Y, then E[X|Y]=X)

I don't know how you've been introduced conditional expectation, but we've been told that E[X|Y] is the projection of X to the $L^2$ space generated by Y. A different rv from X, in another space.