I have a (I think quite simple) question, but I have some problems in understanding this topic (in general) so I hope you can help me!
The problem is about conditional probability. Let be $X~B_{n,p}$ and $Y~B_{m,p}$. I need to calculate the conditional distribution $X|X+Y$.
First of all I calculated $X+Y$ out of $X = \binom{n}{k} p^k(1-p)^{n-k}$ and $Y=\binom{m}{k}p^k(1-p)^{m-k}$. My result was $X+Y = \binom{n+m}{k}p^k(1-p)^{n+m-k}$
But now I don't know how to get the distribution $X|X+Y$, which is originally asked for.
I would be very glad if some of you can help me understanding this topic!
Thank you very much!
Assume that $X$ and $Y$ are independent, then we have
$P(X=k_1)=\binom{n}{k_1} p^{k_1}(1-p)^{n-k_1}$, denoted as $P_{X}(k_1)$
$P(Y=k_2)=\binom{m}{k_2} p^{k_2}(1-p)^{m-k_2}$, denoted as $P_{Y}(k_2)$
Then \begin{equation} \begin{aligned} P(X=x|X+Y=z) &= \frac{P(X=x,X+Y=z)}{P(X+Y=z)}\\ &=\frac{P(X=x,Y=z-x)}{P(X+Y=z)}\\ &=\frac{P(X=x)P(Y=z-x)}{P(X+Y=z)}\\ &=\frac{P_X{(x)} P_Y(z-x)}{P(X+Y=z)} \end{aligned} \end{equation}
Now, we turn to calculate $P(X+Y=z)$, which is \begin{equation} \begin{aligned} P(X+Y=z)= \sum_{t=0}^{z} P_{X}(t)P_{Y}(z-t). \end{aligned} \end{equation}
The final result can be obtained.