What is the expected value of number of Bernoulli trials required for k successes? Assume probability of success in a single trial = $p$, probability of failure = $q = 1 - p$. I managed to derive the discrete probability mass function: $P(X = n) = \binom{n - 1}{k -1} p^{k} (1 - p)^{n - k}$, for $n \geq k$. However, I could not sum the series $E(X) = \sum_{n = k}^{\infty} n\binom{n - 1}{k -1} p^{k} (1 - p)^{n - k}$. Can anybody please help?
-
Why ${n-1 \choose k - 1}$? – Michael Albanese Sep 03 '13 at 11:12
-
Erase $(\frac{n−1}{k−1})$. it is not correct – DanielY Sep 03 '13 at 11:22
-
@MichaelAlbanese, I think the assumption is that the last trial in Bernoulli trials is 1, so that's why it is fixed and $k-1$ success should be picked out of the rest. – Arash Sep 03 '13 at 11:24
-
@akhil see here: http://en.wikipedia.org/wiki/Bernoulli_trial – DanielY Sep 03 '13 at 11:27
-
1Does this work (I'm a bit rusty)? If $k=1$, then $E_1=qE_1+1,$ which we solve to get $E_1=1/p.$ By linearity of expectation $E_k=kE_1=k/p.$ – Rebecca J. Stones Sep 03 '13 at 11:36
-
@Rebecca This is exactly true. Expected number of times you need to get one success is equal to $1/p$. Now for a new success you have to wait for the same expected time. So for $k$ success, you need to wait $k/p$. – Arash Sep 03 '13 at 12:26
-
I turned it into an answer. My argument for the above formula was faulty (it made sense at the time), but I'm sure now that once you know $E_1=1/p$, linearity implies $E_k=k/p$. – Rebecca J. Stones Sep 03 '13 at 14:55
3 Answers
If you want to analytically calculate the sum, you can do as follows: $$ \sum_{n = k}^{\infty} n\binom{n - 1}{k -1} p^{k} (1 - p)^{n - k}=(\frac{p}{1-p})^k\sum_{m = 0}^{\infty} (m+k)\binom{m+k - 1}{m} (1 - p)^{m+k} $$
Now you can find the following identity in the literature: $$ \sum_{m = 0}^{\infty} \binom{m+k - 1}{m} y^{m}=\frac{1}{(1-y)^k} $$ Now by multiplication of $y^k$ and derivation wrt $y$, you get: $$ \sum_{m = 0}^{\infty} (m+k)\binom{m+k - 1}{m} y^{m+k-1}=\left(\frac{y^k}{(1-y)^k}\right)^{'}=\left(\frac{ky^{k-1}}{(1-y)^{k+1}}\right) $$ Now put $y=1-p$ in the first identity and you get:
$$ \mathbb{E}(X)=\frac{k}{p} $$
- 11,131
This has a name, and it's the Negative Binomial Distribution $NB(r,p)$. (But with $p$ and $1-p$ switched, and an atypical definition). We have
$$P(X=n) = \binom{n-1}{k-1}p^k(1-p)^{n-k}$$
as you said. Now, we could compute this using some binomial identities, but that takes a while and seems to be unnecessary, because it's easy to see that if $X$ has the disribution of a negative binomial with $k$ successes wanted and probability $p$ for a success, is it also the sum of $k$ geometric random variables with mass function $$P(X_i = k) = (1-p)^{k-1}p$$ which each have mean $\frac1p$. They are all independent, and there are $k$ of them, so our mean is $\frac kp$.
- 6,049
Let $E_k$ denote the expected number of Bernoulli trials required for $k$ successes.
By definition, we have \begin{align*} E_1 &= \sum_{k \geq 1} k\ \mathrm{Pr}(\text{exactly } k \text{ trials for } 1 \text{ success}) \\ &= \sum_{k \geq 1} kq^{k-1}p \\ &= p(1-q)^{-2} & \text{provided } 0\leq q<1\\ &= p^{-1} \end{align*} using the Taylor series $(x-1)^{-2}=\sum_{k \geq 1} kx^{k-1}$.
(One could alternatively argue that $E_1=q(E_1+1)+p,$ which also yields $E_1=1/p$.)
By linearity of expectation, it follows that $$E_k=k\ E_1=k/p.$$
- 26,845