# Indpendent Bernoulli Trials with Negative Binomial Distribution

Suppose 2 students A and B are performing independent Bernoulli trials. Each performance is independent, and for both A and B each trial has a chance p of succeeding. A will stop after r successes, and B will stop after s successes. Compute the probability that the total number of failed trials performed by A and B is k. What kind of distribution is this probability?

I am thinking that I let k+n=a+b, where a is the number of trials A did and b is the number of trials b did, and n is the number of successes. I believe it's a negative binomial distribution, but am stuck on where to go from here. Any help would be appreciated.

Let random variable $X_1$ denote the # of failed trials until student $A$ obtains her/his first success and let random variable $X_i$ for $2 \leq i \leq r$ be the # of failed trials before getting the $i$-th success after the $(i-1)$-th success. Then the total number of failed trials $X$ that $A$ has conducted is thus $$X = X_1 + X_2 + \cdots + X_r \tag{1}$$ Observe that $X_i \sim \texttt{Geometry}(p)$ for $1 \leq i \leq r$; that is, $$\Pr(X_i = k) = p(1-p)^k$$ Similarly, we can define $Y_1$, $Y_2$, $\cdots$, $Y_s$ for $B$ and $$Y = Y_1 + Y_2 + \cdots + Y_s \tag{2}$$ and $Y_i \sim \texttt{Geometry}(p)$ for $1 \leq i \leq s$ too. Therefore, the total # of failed trials $Z$ is $$Z = X + Y \tag{3}$$ which is the sum of $(r + s)$ independent geometric random variables. It is well known that sum of independent geometric random variables follows negative binomial distribution. See here.