Expected value of first success in Bernoulli trials

727 Views Asked by At

I have a sequence of $n$ Bernoulli experiments each succeeding with probability $p$. In general, the number of successes $X$ follows the well-known binomial distribution:

$$P(X = k) = \begin{pmatrix} n\\ k \end{pmatrix} p^k(1-p)^{n-k}$$

However, I'm interested in the expected value of the number of experiments until the first success, assuming a maximum number of $n$ trials (if the experiment never succeeds, there will have been $n$ experiments attempted).

My reasoning is the following: if $n = 4$, the expected value will be (?):

$$ 1\cdot p + 2\cdot(1-p)p + 3\cdot(1-p)^2p + 4\cdot(1-p)^3p + 5(1-p)^5$$

Generalizing:

$$E = \sum_{i=1}^n i\cdot p(1-p)^{i-1}$$

However, the sum of these weights is not one, as it should be:

$$\sum_{i=1}^n p(1-p)^{i-1} \neq 1$$

Clearly I'm off somewhere. What am I missing?

2

There are 2 best solutions below

2
On

Expected value:

$$E = n\cdot(1 - \sum_{i=1}^N p(1-p)^{i-1}) + \sum_{i=1}^N i\cdot p(1-p)^{i-1}$$

0
On

Denoting $q:=1-p$ for $n=4$ we find:

$$p\cdot1+qp\cdot2+q^2p\cdot3+(1-p-qp-q^2p)\cdot4$$