# Expectation of sum of geometric random variables vs. expectation of Pascal r.v.

Let $$\{X_i\}$$ be a Bernoulli process, i.e. $$X_1, X_2, X_3, \dots$$ are i.i.d. Bernoulli variables with parameter $$p$$. Let $$T_k$$ be the time at which the $$k$$th success occurs. I can reason about the expectation of $$T_k$$ using independent increments or the sum of geometric random variables:

$$\mathbb{E}[T_k] = \mathbb{E}[(T_1 - T_0) + (T_2 - T_1) + \dots + (T_{k-1} - T_k)] = \frac{k}{p}$$

But I also believe that $$T_k$$ must a Pascal or negative binomial random variable. If we have $$n$$ trials and $$k$$ successes, let $$r = n - k$$ be the predefined number of failures. Then I would expect

$$T_k \sim \text{NB}(n - k, p)$$

But this expectation is

$$\mathbb{E}[T_k] = \frac{(n - k) p}{1 - p}$$

I must be missing something when I convert the problem from the sum of geometric random variables to a negative binomial random variable.

One can think of $$\text{NB}(r,q)$$ as the number of failures that occur before the experiment is stopped at the $$r$$th success, with $$q$$ being the probability of failure. (Note that I have reversed the roles of success and failure.)

Thus, $$T_k - k$$ follows the $$\text{NB}(k, 1-p)$$ distribution, so $$E[T_k] = k + \frac{(1-p) k}{p} = \frac{k}{p}.$$

Both expressions of the expected value are correct but measuring different things. Your Wikipedia link says

Different texts adopt slightly different definitions for the negative binomial distribution. They can be distinguished by whether the support starts at $$k = 0$$ or at $$k = r$$, whether $$p$$ denotes the probability of a success or of a failure, and whether $$r$$ represents success or failure, so it is crucial to identify the specific parametrization used in any given text.

and that is the issue here

Wikipedia is counting the number of successes until there have been $$r$$ failures while you are counting the number of attempts until there have been $$k$$ successes. Both of you are using $$p$$ as the probability of a success. So to compare the two

• You correctly say that the expected number of attempts until you get $$k$$ successes, where each attempt independently has probability of being a success is $$p$$, is $$\dfrac{k}{p}$$

• You would say that the expected number of attempts until you get $$k$$ failures, where each attempt independently has probability of being a success is $$p$$, is $$\dfrac{k}{1-p}$$

• You would say that the expected number of attempts until you get $$r$$ failures, where each attempt independently has probability of being a success is $$p$$, is $$\dfrac{r}{1-p}$$

• You would say that the expected number of successes until you get $$r$$ failures, where each attempt independently has probability of being a success is $$p$$, is $$\dfrac{r}{1-p}-r = \dfrac{pr}{1-p}$$. And that is the Wikipedia result for the same expectation