Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Given a game where the player has some probability of dying and this probability increases each second as the game is played to some maximum probability. The player has three lives and then the game is over.

Can I calculate the average game duration if I know the probability the player will die at each second?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

Yes. If $p_n$ is the probability for the char to die if it is at age $n$, then the porbability of dying at age $n$ is $$(1-p_0)(1-p_1)(1-p_2)\cdots(1-p_{n-1})p_n $$ hence the expected life time is $$\sum_{n=0}^\infty n\cdot (1-p_0)(1-p_1)(1-p_2)\cdots(1-p_{n-1})p_n\\ =\sum_{n=1}^\infty (1-p_0)(1-p_1)\cdots(1-p_{n-1})$$ and with three lives, the expected game duration is three times as long.

If all $p_n$ were equal, this expression could readily be simplified, but alas that does not match your setup.

share|improve this answer
    
Excellent, thank you very much. –  nobo01 Sep 27 '12 at 20:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.