I have a question about using geometric distribution to analyze a spefic issue of the Pokemon Go game. First let me describe the context.
When a player throws a ball to catch a pokemon, the success rate is a fixed number p. If the pokemon is not caught by the ball, the probability that it flees is f. If the pokemon does not flee, the player can throw the ball again, and each throw is an independant event. Assuming the player continues to throw balls until either the pokemon is caught or it flees, we would like to calcuatel the expected # of balls the player throws when a pokemon is encountered.
I will describe my derivation below, but my result is diffrenet from the well known web site Gamepress, so I'd like to confirm the right answer.
There are two conditions: when the player succesds to catch it, and when the pokemon eventually flees.
The probability of successfully catching the pokemon is:
$$ p + (1-p)(1-f)p + [(1-p)(1-f)]^2p+... $$ $$= p\sum_{x=1}^\infty[(1-p)(1-f)]^{x-1}$$ $$= p\frac{1}{1-(1-p)(1-f)}$$ $$= \frac{p}{p+f-fp}$$
Similary, the probability that the pokemon flees is:
$$ (1-p)f + (1-p)(1-f)(1-p)f + (1-p)[(1-f)(1-p)]^2f+... $$ $$= (1-p)f\sum_{x=1}^\infty[(1-p)(1-f)]^{x-1}$$ $$= (1-p)f\frac{1}{1-(1-p)(1-f)}$$ $$= \frac{(1-p)f}{p+f-fp}$$
The expected number of throws at the condition that the pokemon is caught is:
$$= p\sum_{x=1}^\infty(x[(1-p)(1-f)]^{x-1})$$ $$= p\frac{d}{dZ}\sum_{x=1}^\infty[Z^x], Z=(1-p)(1-f)$$ $$= p\frac{d}{dZ}\frac{Z}{1-Z}$$ $$= \frac{p}{(1-Z)^2}$$ $$= \frac{p}{(p+f-fp)^2}$$
The expected number of throws when the pokemon flees is:
$$= f(1-p)\sum_{x=1}^\infty(x[(1-p)(1-f)]^{x-1})$$ $$= f(1-p)\frac{d}{dZ}\sum_{x=1}^\infty[Z^x], Z=(1-p)(1-f)$$ $$= f(1-p)\frac{d}{dZ}\frac{Z}{1-Z}$$ $$= \frac{f(1-p)}{(1-Z)^2}$$ $$= \frac{f(1-p)}{(p+f-fp)^2}$$
The expected number of throws, without knowing whether the pokemon is caught is The probability of successfully catching the pokemon x The expected number of throws at the condition that the pokemon is caught + the probability that the pokemon flees x The expected number of throws when the pokemon flees:
$$ \frac{p}{p+f-fp}\times\frac{p}{(p+f-fp)^2} + \frac{(1-p)f}{p+f-fp}\times\frac{f(1-p)}{(p+f-fp)^2}$$
$$ = \frac{p^2+f^2(1-p)^2}{(p+f-fp)^3}$$
Gamepress does not provide the equation (https://pokemongo.gamepress.gg/catchcalc#/), but it appears it is using the same formula described here:
Which is $$ \frac{1}{p+f-fp}$$
and appears to be
$$ \frac{p}{(p+f-fp)^2} +\frac{f(1-p)}{(p+f-fp)^2}$$
Therefore my question is, which formula is correct, and why? Thanks!