Expected random generation Background: I've been reading about how Dota deals with its random generation.  There's another question on Gaming.SE about this, but it doesn't give a formula, which is what I'm looking for.
Therefore, 
Let the probability of $E$ succeeding be $\min(A(N+1), 1)$ where $N$ is the number of previous successive failed attempts, and $0 \le A \le 1$.
For example, if $A$ is $25\%$, then on the first attempt, the chance of success is $25\%$, then $50\%$ on the next try, then $75\%$, and then finally $100\%$.  Once any attempt has succeeded, the success chance goes back down to $25\%$.
What is the average success rate (across an infinite number of trials)?  Is it possible to get this into a single formula?
 A: I suspect it might be easier just to work out the probabilities and expected number of attempts until a success directly from the probabilities and then take the reciprocal of this for the average success rate.  This is in effect what the PfromC function does in one of the answers you link to. In effect the direct formula is $$\dfrac{1}{\displaystyle \sum_{n=1}^{\Big\lceil\tfrac1A\Big\rceil} n \min(nA,1) \prod_{m=0}^{n-1}(1-mA)}   $$
There may be a single-pass formula involving a sum, the ceiling function, and the Gamma function (which becomes a factorial when A is the reciprocal of an integer), perhaps 
$$\dfrac{1}{\displaystyle \Bigg\lceil\frac1A\Bigg\rceil - \Gamma\left(\frac1A\right) \sum_{n=1}^{\Big\lceil\tfrac1A\Big\rceil -1} \dfrac{\left(\Big\lceil\tfrac1A\Big\rceil -n \right)n A^{n}}{\Gamma\left(\frac1A-n+1\right)} }  $$ though whether this is an improvement is open to question. I doubt you can simplify this much.
Here are some values:
A    average success rate
1    1
0.9  0.9090909
0.8  0.8333333
0.7  0.7692308
0.6  0.7142857
0.5  0.6666667
0.4  0.5813953
0.3  0.4980080
0.2  0.3983429
0.1  0.2732079
0.05 0.1889079
0.02 0.1170532
0.01 0.0819003

This is in effect the inverse of the table at the end of that linked answer.   
