so you are saying the probability for +0 to +1 is 0.9, +1 to +2 is 0.8 etc
p(n) = 1 - n/10
right?
then there would be one small flaw:
either
1) the first number for +0 to +1 is 0, then the first upgrade will succeed always, or
2) the first number for +9 to +10 is 100, then it will always fail, or
3) you cap at 90 for the second number, which means +8 to +9 has the same probabilty as +9 to +10
from what i saw, i guess you implemented the first option.
the expected value for this would be, since this is a geometric sequence, 1/p
and variance would be (1-p)/p^2
| X (from) | X+1 (to) | p(X) (chance) | E(X) (average) | ∑(E(X)) (sum) | Var(X) | s(X) |
|---|
| 0 | 1 | 1.0 | 1 | 1 | 0 | 0 |
| 1 | 2 | 0.9 | 1.1111 | 2.1111 | 0.1235 | 0.3514 |
| 2 | 3 | 0.8 | 1.25 | 3.3611 | 0.3125 | 0.6603 |
| 3 | 4 | 0.7 | 1.4286 | 4.7897 | 0.61225 | 1.0238 |
| 4 | 5 | 0.6 | 1.6667 | 6.4564 | 1.1111 | 1.4695 |
| 5 | 6 | 0.5 | 2 | 8.4564 | 2 | 2.03944 |
| 6 | 7 | 0.4 | 2.5 | 10.956 | 3.75 | 2.8124 |
| 7 | 8 | 0.3 | 3.3333 | 14.289 | 7.7777 | 3.9607 |
| 8 | 9 | 0.2 | 5 | 19.290 | 20 | 5.9739 |
| 9 | 10 | 0.1 | 10 | 29.290 | 90 | 11.211 |
X is the random variable. upgrade goes from +X to +(X+1)
p(X) is the single probability for success for the upgrade from X
E(X) is the expected value (average) for the amount of attempts and is computed by 1/p
∑(E(X)) is the amounted number of attempts from +0 up to +(X+1) and is calculated recursively as ∑(E(X)) = ∑(E(X-1)) + E(X) and ∑(E(0)) = E(0)
Var(X) is the variance, which happens to be the square of the standard deviation. calculated by sum(n=0 to infinity) p(X)*(X-E(X)) = (1-p)/p^2
s(X) is the summed up standard deviation for the upgrade from 0 to X+1 and calculated as sqrt(sum(n=0 to X) Var(X))
29.290 from +0 to +10 and 14.289 for +0 to +8 (~57 attempts for a +8 set)
maybe a bit too low for the +8 set?
using chebychev's inequality it means that the probability for using more than 100 attempts for a +8 set is lower than 10%
edit: had some miscalculations, fixed.