I'm trying to find the expected number of trials, $x$, to achieve $n$ number of successes, when the probability of a success is dependent on the results of the last trial.
Specifically, I'm trying to calculate the effects of gacha pity on the expected number of trials to achieve $n$ number of successes. How it works is if a certain number of trials, $t$, have occurred without a success, the probability of success, $p$, will be increased by a set amount, $q$, for each failure. Once a success has been achieved, the number of trials in order to activate the probability increase is set back to $t$. I know that the expected number of trials for a number of successes is given by $x = n/p$, but this only works when $p$ is constant.
In the gacha system I'm examining:
$$p = 0.02,$$
$$t = 50,$$
$$q = +0.02$$
Any ideas or places you could point me to would be appreciated!
Best Answer
The expected number of attempts for $n$ successes is $n$ times the expected number of attempts for one success, and it is easier to look at the expected number of attempts for one success.
If you add these all up to give the expected number of attempts for one success and then multiply by $n$, then you get $$n \left(\frac{1-p^{t+1}}{1-p} + \left(1-p^{t}\right)\sum\limits_{m=t+1}^{t+\lfloor(1-p)/q\rfloor} \prod\limits_{k=1}^{m-t}(1-p-kq)\right)$$
This will not have a closed form, but in the example in the question with $n=3, p=q=0.02$ and $t=50$ it seems to give about $3\times 34.594555=103.783665$ from the earlier result
It may be possible to give approximations, at least for large $t$ and small $p$ and $q$ in special circumstances. For example if $c=\frac1p=\frac1q$ for some integer $c$ then I think you may be able to use, if I have done this correctly, an approximation like $$n\left(c-e^{-t/c}\left(c-\sqrt{\frac \pi 2}\sqrt{c}+\frac56-\frac7{12}\sqrt{\frac \pi 2}\sqrt{\frac{1}{c}} + \frac{617}{1080}\frac1c -\cdots\right) \right) $$
which with $n=3, t=50$ and $c=50$ gives about $103.7806$, which is not far away from the earlier result.