I'm feeling dumb right now.
I have a loop, and each iteration there's an effect that shows up N% of the time. If it fails to show up a total of M times, the effect goes away (is no longer checked for). I'm looking for the average number of times the effect will actually show up before the effect goes away. Obviously if N is 100 or more, the answer is infinity, but if it helps N is not allowed to be more than 99 or less than 0 (at 0, the answer is also 0).
I have a loop, and each iteration there's an effect that shows up N% of the time. If it fails to show up a total of M times, the effect goes away (is no longer checked for). I'm looking for the average number of times the effect will actually show up before the effect goes away. Obviously if N is 100 or more, the answer is infinity, but if it helps N is not allowed to be more than 99 or less than 0 (at 0, the answer is also 0).