Let $X$ and $Y$ be discrete random variables with real values $\{x_1, \dots, x_n\}$, $\{y_1, \dots, y_m\}$ respectively.
The questions below arose from considering the expression $E[E[X \mid Y]]$ and asking whether it it well-defined and unambiguous.
In my mind, we can make sense of $E[X = x_i \mid Y]$; it is simply $\sum_{j=1}^m y_jP(X = x_i \mid Y = y_j)$. Then $E[E[X \mid Y]] = \sum_{i=1}^nx_iE[X = x_i \mid Y]$.
$1$. Can we view this as the expectation of the discrete random variable $X \mid Y$ which has values $\{(x_i, y_j) \mid i = 1, \dots, n, j = 1, \dots, m\}$? Or is $X \mid Y$ not a random variable?
Approaching the expression $E[E[X \mid Y]]$ in a different way, I want to swap the order in which we take the expectations.
$2$. Is $E[X \mid Y = y_j] = \sum_{i=1}^n x_i P(X = x_i \mid Y = y_j)$ a common thing to consider? If not, why not?
Then we would have $E[E[X \mid Y]] = \sum_{j=1}^m y_j E[X \mid Y = y_j]$. Note, this agrees with the other calculation of $E[E[X \mid Y]]$.
In trying to indicate the order of the variables I was taking expectations of, I wrote some expressions which I'm not sure are defined.
$3$. Does it make sense to write $E[X \mid E[Y]]$ or $E[E[X] \mid Y]$? If so, is there any relation between these things and $E[X \mid E[Y]]$?
firstly, $E[X=x_i|Y]$ makes no sense
maybe by $X|Y$ you mean the distribution of $X$ conditional on $Y$? I don't know what the proper notation for this.
This is correct
$E[X]$ and $E[Y]$ are numbers. $E[E[X]|Y]=E[X]$, $E[Y|E[X]]=E[Y]$ What I said was conditioning on $E[Y]$ makes no sense, but thanks to Did and Byron, what I should have said was : conditioning a constant is not particularly interesting or tell you anything
I would like to point out at last that conditional expectations, in the probability theory sense, i.e. $X|Y$, are random variables. These are effectively the 'best prediction' of $X$ when given $Y$.
$E[X=x_i|Y]$ - what should this mean? the expectation of $X=x_i$ conditional on everything you know about $Y$?! The thing before | should be a random variable, but $\{X=x_i\}$ an event. $P(X=x_i|Y)$ or $P(X=x_i|Y=y_j)$ makes sense.