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) ?