I have two independent Poisson variables $X$ and $Y$ with parameters $\lambda$ and $\mu$, respectively. I defined $Z=X+Y$ and found that $Z$ is also Poisson-distributed with parameter $\lambda + \mu$.
My task was to compute $P(X=k|Z=n)$ for $0 \leq k \leq n$. I know from this question that the solution is ${n \choose k} p^k(1-p)^{n-k}$, but I couldn't figure out how to get this solution.
I noticed that since $n \geq k$, asking for $X=k$ is equivalent to $X=n-m$ for some $m$ such that $n-m = k$. So I used the formula for conditional probability and tried to find $P(X=n-m \land Z =n)$ using the sum $\sum_{m=0}^n P(X=n-m; Z=n)$, but I was not successful in this.
Can anyone show me how to reach the desired conclusion?
\begin{align} P(X=k|Z=n)&=\frac{P(X=k,Z=n)}{P(Z=n)}\\ &=\frac{P(X=k,X+Y=n)}{P(Z=n)}\\ &=\frac{P(X=k,Y=n-k)}{P(Z=n)}\\ &=\frac{P(X=k)P(Y=n-k)}{P(Z=n)}\\ &=\frac{\frac{e^{-\lambda}\lambda^k}{k!}\frac{e^{-\mu}\mu^{n-k}}{(n-k)!}}{\frac{e^{-\lambda-\mu}(\lambda+\mu)^n}{n!}}\\ &=\frac{n!}{k!(n-k)!}\frac{\lambda^k}{(\lambda+\mu)^k}\frac{\mu^{n-k}}{(\lambda+\mu)^{n-k}}\\ &=\frac{n!}{k!(n-k)!}p^k(1-p)^{n-k}\\ \end{align} where $p=\frac{\lambda}{\lambda+\mu}$.