On the conditional expectation formula $E[X] = E \big[ E[X|Y] \big]$ vs. $E[X] = E \big[ E[X|Y=y] \big]$

80 Views Asked by At

I am comfortable with the fact that for two random variables $X,Y$,

$$E[X] = E \big[ E[X|Y] \big]$$

However, in my textbook, they express this as $$E[X] = E \big[ E[X|Y=y] \big]$$

To me, the second expression seems incorrect since $y$ is fixed. As a discrete counter example, If I flip a fair 3 sided die, let $X$ be the number that shows up on the die, and $Y$ be a binary random variable that takes 1 if $X$ is odd and $0$ otherwise.

Then clearly, $E[X] \neq E\big[ E[X|Y=0]\big]$

Am I just misunderstanding notation? Thanks in advance!