Let $X_1, X_2,\ldots, X_n$ be iid bernoulli r.v. with parameter $p$. Let $S=X_1+\cdots+X_n$ and $Y=X_1X_2$. Compute $\mathbb{E}(Y\mid S)$.
I know that $\mathbb{E}(X_1\mid S) = S/n$. So If I could split $\mathbb{E}(Y\mid S)$ into two then I would be done. But I don't think that is allowed. How to proceed?
Note that $Y = 1$ if and only if $X_1 = X_2 = 1$, and $0$ otherwise. So if $S \le 1$, then $Y = 0$, and if $S \ge 2$, we must find the number of outcomes for which $X_1 = X_2 = 1$ among the total number of outcomes; that is to say $$\Pr[X_1 = X_2 = 1 \mid S = s] = \frac{\binom{n-2}{s-2}}{\binom{n}{s}} = \frac{(n-2)!s!(n-s)!}{(s-2)!(n-s)!n!} = \frac{s(s-1)}{n(n-1)}, \quad s \ge 2,$$ and $0$ otherwise. Then
$$\operatorname{E}[Y \mid S] = 1 \cdot \Pr[Y = 1 \mid S] = \Pr[X_1 = X_2 = 1 \mid S] = \begin{cases} \frac{S(S-1)}{n(n-1)}, & S \in \{2, 3, \ldots, n\} \\ 0, & \text{otherwise}. \end{cases}$$
It is worth noting that the result does not depend on $p$, so long as $0 < p < 1$.