[Math] probability of passing an exam (continued)

probability

Following my previous question, which can be found here:
probability of passing an exam,
I found out that the probability of passing an exam at the nth try is $p(1-p)^{n-1}$.

If I now assume that taking an exam takes me one hour of work, how many hours on average will I have worked if the maximum number of retries is N (regardless of whether I end up passing the exam or not) ?

Best Answer

The probability of taking the exam $n$ times is then $p(1-p)^{n-1}$ except for the last, which has probability $(1-p)^{N-1}$ as you stop in any case. The average or expected number of hours is then $$\sum_{i=1}^N P(i)i=\sum_{i=1}^{N-1} ip(1-p)^{i-1}+(1-p)^{N-1}N$$ To sum the series, let $q=1-p$. Then $$\sum_{i=1}^{N-1} ip(1-p)^{i-1}=p\sum_{i=1}^{N-1} iq^{i-1}=p\sum_{i=1}^{N-1} \frac d{dq} q^i=p \frac d{dq} \frac {q-q^N}{1-q}$$

Related Question