# probability of passing an exam (last thoughts)

So we have seen before (here: probability of passing an exam (continued)) that the average number of hours I would have worked for an exam, assuming I work one hour for an exam that I can pass with a probability p, and assuming I can try to pass it at most N times, is $\sum_{k=0}^{N-1}q^k$. (q=1-p)

I know have one last question. What if this exam is actually composed of r tests, which follow the rules described above (so all tests can be taken at most N times), and the test i can only be passed if i-1 is taken (so if I reach N once, the whole exam is stopped, and thus my number of hours spent into this exam stops growing).

What would then be the average number of hours spent into the exam ?

If the question is unclear please state so and I'll try to reformulate.

edit: maybe a little more explanation is needed as to why the exam requires on average $\sum_{k=0}^{N-1}q^k$ hours of work: $E(X)=\sum_{i=1}^{N-1}iP(X=i)+P(X=N)$, and $P(X=N)=pq^N$. The sum can be calculated by noticing that it's a sum of derivative, and it comes $E(X)=\frac{p}{(1-q)^2} \left( (N-1)q^{N}-Nq^{N-1}+1 \right)$+$pq^N$=(1-q^N)/(1-q)

My question has still not been answered.

-

## 1 Answer

Well if $X$ is the random variable modelling the number of hours spent into the exam then $$E[X] = \sum_{i=1}^N P(X=i)i$$ $$E[X] = \sum_{i=1}^N q^{i-1}p i = p \frac{\partial}{\partial q}\left( \sum_{i=0}^N q^i \right) = \frac{p}{(1-q)^2} \left( Nq^{N+1}-(N+1)q^N+1 \right)$$

This is for your first problem. The second problem follows.

-

That's very good, thank you. I had actually already found that before, sorry I didn't add the link. I will do so now. Also, there's a slight mistake in your calculus, because the last try has a special treatment. In the end, you end up with a solution very much similar to yours, but which simplify to $(1-q^{N-1})/(1-q)$. So I'm actually more interested in the second part of the question. Please consider for the second part that $E[X]=\sum_{k=0}^{N-1} q^k$. – TimZEI Jun 13 '12 at 8:41
So how to actually solve the question I asked ? The answer above is only the answer to the previous question, which had already been answered... – TimZEI Jun 13 '12 at 13:09
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 9, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9759551882743835, "perplexity_flag": "head"}