Let $X_1,...,X_n\sim \operatorname{Ber}(p)$ where $p \in (0,1)$. I want to compute $\mathbb{E}_{p}[X_1|X_1+\cdots +X_n]$. I know that there's a neat trick using symmetry. But my computation using the definition fails, so I want to know where I'm wrong.
\begin{align} \mathbb{E}_{p}[X_1|X_1+\cdots +X_n=k]&=0\cdot \mathbb{P}(X_1=0|X_1+\cdots +X_n=k)+1\cdot \mathbb{P}(X_1=1|X_1+\cdots +X_n=k) \\ &=\frac{\mathbb{P}(X_1=1, X_1+\cdots +X_n=k)}{\mathbb{P}(X_1+\cdots +X_n=k)}=\frac{\mathbb{P}(X_2+\cdots +X_n=k-1)}{\mathbb{P}(X_1+\cdots +X_n=k)} \\ &=\frac{\begin{pmatrix} n-1\\k-1 \end{pmatrix}p^{k-1}(1-p)^{n-k}}{\begin{pmatrix} n\\k \end{pmatrix}p^{k}(1-p)^{n-k}}=\frac{k}{pn} \end{align}
How can I get rid off the $p$? It should be $k/n$.
The mistake is $$\text{P}(X_1=1,X_1+\cdots+X_{n}=k)\color{red}{=}\text{P}(X_2+\cdots+X_n=k-1).$$ The probability of $X_1=1$ and $X_2+\cdots+X_n=k$ is the probability of $X_1=1$ and $X_2+\cdots+X_{n}=k-1$.
Therefore, we get the correct equality $$\text{P}(X_1=1,X_1+\cdots+X_{n}=k)=\color{red}{p}\cdot\text{P}(X_2+\cdots+X_n=k-1).$$