# Expected value of a certain sort of game

Please check my work, expected value calculations are often of the sort where you get an answer but there's no "check", so to speak.

Imagine you have a scenario with the following rules:

• Inputs determine several possible outcomes
• Your outcome for each trial is determined randomly
• The different outcomes have different probabilites
• Repeat the same inputs over and over until you win, see below
• Each outcome has a different $score$
• You stop when you get the "correct" outcome
• Don't count your score for the correct outcome, in other words, $score=0$

Example: for given inputs, you have (fail probabilities are the same but they don't have to be):

• $P(success) = 6.6667\%$
• $P(fail_1) = 23.333\%$, $Score(fail_1) = .5$
• $P(fail_2) = 23.333\%$, $Score(fail_2) = 4$
• $P(fail_3) = 23.333\%$, $Score(fail_3) = 6$
• $P(fail_4) = 23.333\%$, $Score(fail_4) = 20$

Calculate: What is the expected score for a given list of failed outcomes?

Let $FS_0$ = failed score on one trial that fails

$$FS = \sum\limits_{trials}{P(trial)Score(trial)}$$

If we succeed on the first try, score is zero.

If we succeed on the second try, score is $(P(fail_{all})*FS$

If we succeed on the third try, score is $(P(fail_{all})*(FS + (P(fail_{all})*FS)$

This implies the infinite sum:

$$EV = P(fail_{all}) * \Bigg( FS + P(fail_{all}) * \bigg(FS + P(fail_{all}) * \Big(FS + P(fail_{all}) ...$$ $$= P(fail_{all}) * FS * (1 + P(fail_{all}) + P(fail_{all})^2 + P(fail_{all})^3 + ... )$$ $$= P(fail_{all}) * FS * \left(\frac{1}{1-P(fail_{all})}\right)$$ $$= FS * \left(\frac{1}{P(success)} - 1\right)$$

So in the case of our example above,

$$EV_{example} = 7.11667 * \left(\frac{1}{6.67\%} - 1\right)$$ $$EV_{example} = 99.63333$$

How did I do?

-

As a general hint, you should never use percentages when describing probability problems - it can leas to simple mistakes.

The Expected score of a single failed game

\begin{align} S &= \frac{\sum_{i=1}^4{p_is_i}}{1-p_0}\\ \end{align}

In this case $S=7.625$

Games continue until there is a success with $p_0=0.0\dot6$. This is a geometric series and the expected number of failures before a success is given by

$$\frac{1-p}{p}=14$$

So the expected score of the game described is $7.625\times14=106.75$

I think you got the second part right, but I think that you included the success criteria when working out the expected payout for a failed game i.e. you did not divide by $(1-p_0)$. So, right method, wrong numbers!

-
Good point about the percentages, I'll keep that in mind. I don't understand why I'm supposed to divide by $\left(1-p_0\right)$. Could you explain further? – durron597 Apr 16 '13 at 4:48
Because the expected number of games $\frac{1-p}{p}$ is the number of failures before the first success. You could use the alternative formulation of the geometric series which is the number of rolls including the first success, $\frac{1}{p}$. You you get the same answer because the two terms cancel in the first formulation and aren't there in the second! Either is fine, you just need to be consistent. – Dale M Apr 16 '13 at 5:08
Yes but... shouldn't I be multiplying by $1-p$, not dividing by it? Because that's what I did, that's the outer $P(fail_{all})$ in the original question. – durron597 Apr 16 '13 at 5:34
What you did in the expected number of games is correct - multiply by $(1-p)$. In order to get the expected value of a game given that you have failed, you need to eliminate the chance of success - so divide by $(1-p)$. These two terms cancel out when you multiply them - which is why you need to be clear about which of the alternate formulations of geomatric distribution you are using. See en.wikipedia.org/wiki/Geometric_distribution – Dale M Apr 16 '13 at 5:48