# What is the probability of the sum of the successes of two independent bernoulli experiments?

Two experiments with different probabilities of success run independently $$n_1$$ and $$n_2$$ times. I'm modeling the number of successes of each experiment as two independent binomial random variables: $$X\sim\mathcal B(n_1, p_1)$$ and $$Y\sim\mathcal B(n_2, p_2)$$.

I would like to know $$\Pr[X + Y = k]$$ for a constant $$k$$, i.e., the probability that the sum of the successes of the two experiments in $$n_1+n_2$$ trials is $$k$$.

Is there an expression in terms of $$n_i$$, $$p_i$$, and $$k$$ for such probability?

It will be the convolution: $$\mathsf P(X+Y=k)=\sum_{r=0}^k \mathsf P(X=r)~\mathsf P(Y=k-r)\\=\sum_{r=0}^k \binom{n_1}r\binom{n_2}{k-r}{p_1}^r{p_2}^{k-r}(1-p_1)^{n_1-r}(1-p_2)^{n_2-k+r}$$
Which will not close neatly, unless $$p_1=p_2$$.
• That the series won't have a closed form. However, when $p_1=p_2$ it just ...falls into place neatly.\begin{align}\sum_{r=0}^k\binom{n_1}{r}\binom{n_2}{k-r}p^{r}p^{k-r}(1-p)^{n_1-r}(1-p)^{n_2-k+r} &= p^k(1-p)^{n_1+n_2-k}\sum_{r=0}^k\binom{n_1}{r}\binom{n_2}{k-r}\\&=p^k(1-p)^{n_1+n_2-k}\binom{n_1+n_2}{k}\end{align} Commented Oct 21, 2021 at 7:19