Let $X_1, ..., X_n$ be i.i.d. random variables with $X_k \sim Bern(\theta)$ for $\theta \in (0,1)$. Furthermore, define $Y := \sum_{k=1}^n X_k.$
Determine $E(X_k|Y).$
Since $X_k$ and $Y$ are obviously discrete and $X_k \in \{0,1\},$ we have that $E(X_k|Y) = P(X_k = 1 | Y = j)$ with $j \in \{1,...,n\}$, which can be rewritten as
$$\frac{P(X_k = 1, Y = j)}{P(Y = j)}$$
$Y$ is binomially distrbuted, therefore
$$P(Y = j) = {n \choose j}\theta^j(1-\theta)^{n-j}.$$
Applying the multiplication formula on $P(X_k = 1, Y = j)$ yields
$$P(X_k = 1) \cdot P(Y = j | X_k = 1)$$
with $P(X_k = 1) = \theta$.
In order to calculate $P(Y = j | X_k = 1)$, I used the following reasoning:
Assume that we want to calculate
$$P(Y = 1| X_k = 1).$$
Given the assumption that $X_k = 1$, it must be true that $Y \ge 1$. We want to exclude the case that $Y > 1$, which is true if there is some other $X_i$ such that $X_i = 1$ for $i \neq k$. So we want to have that $X_i = 0$ for every $i \in \{1,...,n\} \setminus \{k\}.$ The probability for this event is $(1-\theta)^{n-1}.$ So overall, we receive that
$$P(Y = 1|X_k = 1) = (1-\theta)^{n-1}.$$
Now, if we want to calculate $P(Y = 2| X_k = 1)$, we need to look at the event that there is some other $X_l = 1$ for $l \neq k$, which is true with probability $\theta$. Similarly to above, we need to exclude the case that $Y > 2$ and receive that
$$P(Y = 2|X_k = 1) = \theta \cdot (1-\theta)^{n-2}.$$
By the same reasoning, we receive that
$$P(Y = 3|X_k = 1) = \theta^2 \cdot (1-\theta)^{n-3},$$
or in general:
$$P(Y = j| X_k = 1) = \theta^{j-1} \cdot (1-\theta)^{n-j}.$$
Therefore,
$$P(X_k = 1, Y = j) = \theta \cdot \theta^{j-1} \cdot (1-\theta)^{n-j} = \theta^{j} \cdot (1-\theta)^{n-j}.$$
So,
$$E(X_k|Y) = \frac{1}{n \choose j}.$$
Is that correct?
Edit:
Now I finally understood what's wrong with this approach:
$$P(Y = j| X_k = 1) = \theta^{j-1} \cdot (1-\theta)^{n-j}.$$
simply doesn't contain the possibility that there are several different arrangements of the values of the $X_2, ..., X_n$ such that $Y = j$. The probability from above reads like there would be only one valid arrangement, when, in fact, it's ${n-1 \choose j-1}$ valid arrangements. Therefore, it should be
$$P(Y = j| X_1 = 1) = {n-1 \choose j-1} \theta^{j-1} \cdot (1-\theta)^{n-j}.$$
The other results stay the same though, so it's actually
$$\frac{{n-1 \choose j-1}}{n \choose j} = j/n,$$
which is the same result given in the answer below, though I agree that it would be more appropriate to write this as
$$\frac{1}{n}Y(\omega)$$
for some $\omega \in \Omega$.
$\sum_{k=1}^n\mathbb E[X_k\mid Y=y]=\mathbb E[\sum_{k=1}^n X_k\mid Y=y]=\mathbb E[Y\mid Y=y]=y$.
Then by symmetry for any fixed $k\in\{1,\dots,n\}$ we have $\mathbb E[X_k\mid Y=y]=\frac1ny$.
From this we conclude that: $$\mathbb E[X_k\mid Y]=\frac1nY$$