during my "Intro to probability" Course, I've stumbled upon this simple example:
Let $X,Y\sim Bin(n,p)$ be independent random variables, Find $\mathbb{E}[X|X+Y=m]$.
I've tried the following (which came out wrong):
$\mathbb{E}[X|X+Y=m] = \mathbb{E}[X|X=m-Y] = m - \mathbb{E}[Y] = m-np$
What am I missing here? The result should be $\frac m2$, and I'm able to show that in a different way. I'm more interested in understanding the mistake in what I've shown.
Any help would be appreciated.
$\mathbb{E}[X|X=m-Y] = m - \mathbb{E}[Y]$ is wrong. You are ignoring the fact that you have a conditioning event.
Here is a small trick that gives the answer immediately. Since $\{X,Y\}$ is i.i.d. $E[X|X+Y=m]=E(Y|X+Y=m)$. Hence, $E[X|X+Y=m]=\frac 1 2 E[X+Y|X+Y=m]=\frac 1 2 m$.