In my studies for an exam which I have on Friday I have come across this assignment from last year in which the following question is asked:
"Let $E[x] = \mu$ and $var[x] = \sigma^2$. If $E[x \lvert y] = a + bx$, find $E[xy]$ as a function of $\mu$ and $\sigma^2$."
Now in this assignment of last year, an answer by a group of students from that year was provided:
"The law of total expectations states $E[xy] = E[E[xy \lvert x]]$. By linearity of conditional expectations, $E[E[xy \lvert x]] = E[xE[y \lvert x]]$. We get
$E[xy] = E[E[xy \lvert x]] = E[x[E[y \lvert x]] = E[x(a + bx)] =$ ...."
Where at the end they simply write out the expression and then input the given $\mu$ and $\sigma^2$. I'm not sure whether this is correct. First of all, I'm not sure whether I understand correctly how $E[xy] = E[E[xy \lvert x]]$ follows from the law of total expectation. I thought that it might be as follows:
$E[E[XY \lvert X = x]] = E[xE[Y \lvert X = x]] = \sum_x xE[Y \lvert X]P[X = x] =$ $ \sum_x \sum_y x y P[X = x \lvert Y = y]P[X = x] = \sum_x \sum_y x y P[X = x, Y = y] = E[XY].$
However I would like to know if that line of reasoning is correct.
Secondly I don't see why $E[y \lvert x] = E[x \lvert y]$ would have to be true. Could anyone tell me whether this is correct and possibly explain why it is correct or what is correct if it isn't? Mathematically, intuitively, or both?
Thank you in advance