# Sum of two Geometric Random Variables with different success probability

Here is a problem and my answer which I know is wrong. I am hoping somebody can tell me where I went wrong. Thanks
Bob

Problem:
Let $$X$$ and $$Y$$ be independent random variables having geometric densities with parameters $$p_1$$ and $$p_2$$ respectively. Find the density of $$X + Y$$.
Let $$Z = X + Y$$. $$\begin{eqnarray*} P( Z = 0 ) &=& P( X = 0 ) P(Y = 0) \\ P( Z = 1 ) &=& P( X = 0 ) P(Y = 1) + P( X = 1 ) P(Y = 0) \\ P( Z = n ) &=& \sum_{i = 0}^{n} P(X = i)P(Y = n - i ) = \sum_{i = 0}^{n} p_1(1-p_1)^i p_2 (1 - p_2)^{n - i} \\ \end{eqnarray*}$$

This is a finite geometric series with $$a = p_1 p_2$$ and $$r = \frac{1-p_1}{1-p_2}$$. Also observe that there are $$n+1$$ terms not $$n$$ terms. $$\begin{eqnarray*} P( Z = n ) &=& \frac{p_1 p_2\Big(1 - {\Big(\frac{1-p_1}{1-p_2}\Big) } ^{n+1}\Big)}{1 - \frac{1-p_1}{1-p_2}} \\ P( Z = n ) &=& \frac{p_1 p_2\Big(1 - {\Big(\frac{1-p_1}{1-p_2}\Big) } ^{n+1}\Big)} { \frac{p_1 - p_2}{1 - p_2} } \\ P( Z = n ) &=& \frac{p_1 p_2\Big(1 - {\Big(\frac{1-p_1}{1-p_2}\Big) } ^{n+1}\Big)} { \frac{p_1 - p_2}{1 - p_2} } \\ \end{eqnarray*}$$

• Tiny mistake - $a$ is $p_1 p_2 (1-p_2)^{n},$ not $p_1p_2$. Feb 9, 2018 at 22:14
• are you sure the question says density? Feb 9, 2018 at 22:54
• @Henry The book does say density but I believe the modern term probability mass function.
– Bob
Feb 9, 2018 at 23:03

Your definition of a geometric random variable is not quite consistent with the normal definition; normally one would say that $X$ is the trial on which one has the first success (in a sequence of $p_1$ Benoulli variables).

So that means

$$\mathbf{P}(X = k) = (1-p_1)^{k-1} p_1, \qquad k = 1,2,\ldots$$

In particular the distribution is defined only for integers greater than or equal to $1$. In your definition (which I will denote $\widehat X$, you allow $\widehat X = 0$ to be non-zero; that is you assume the density is

$$\mathbf{P}\left( \widehat X = k\right) = (1-p_1)^k p_1, \qquad k = 0,1,\ldots$$ This also has an interpretation: this is you are counting the number of failures before success, so your definition is equivalent to $$\widehat X = X-1.$$

From here we can determine the distribution of $Z = X + Y$ using the method you have

\begin{align*} \mathbf{P}(Z = n) & = \sum_{k=0}^n P(X = k) P(Y = n-k) \\ & = \sum_{k=1}^{n-1} P(X = k) P(Y = n-k) \\ & = p_1 p_2 \sum_{k=1}^{n-1} (1-p_1)^{k-1} (1-p_2)^{n-k-1} \\ & = p_1 p_2\frac{(1-p_2)^{n-1}}{(1-p_1)} \sum_{k=1}^{n-1} \left( \frac{1-p_1}{1-p_2} \right)^{k}. \end{align*} From here you can manipulate the geometric series (much as you do above) to derive

$$\mathbf{P}(Z = n) = \frac{p_1p_2}{p_1 - p_2} \big( (1-p_2)^{n-1} - (1-p_1)^{n-1} \big), \qquad n = 2,3,\ldots$$

Note that $Z$ can only take values greater than or equal to $2$.