I came across this distribution in a computer game and wanted to learn more about its behaviour. It comes from the decision as to whether a certain event should occur after a given number of player actions. The details beyond this aren't relevant. It seems applicable to other situations, and I found it interesting because it's easy to calculate and creates a long tail.
Every step $n$, the game generates a uniform random number $0 \leq X < 1$. If $X < p(n)$, then the event is triggered. After the event once occurs, the game resets $n = 0 $ and runs through the sequence again. I'm only interested in one occurrence of the event for this problem, because that represents the distribution that the game is using. (Also, any questions regarding multiple occurrences can be answered with a single occurrence model.)
The main "abnormality" here is that the probability parameter in this distribution increases over time, or put another way, the threshold rises over time. In the example it changes linearly but I suppose other rules could apply. After $n$ steps, or actions by the user,
$$ p(n) = kn $$
for some constant $0 < k < 1$. At a certain point $n_{\max} $, we get $p(n_{\max}) \geq 1 $. The event is simply guaranteed to occur at that step.
I was able to determine that
$$ f(n) = p(n)\left[1 - F(n - 1)\right] $$ and $$ F(n) = p(n) + F(n-1)\left[1 - p(n)\right] $$ for PMF $f(n)$ and CDF $F(n)$. In brief, the probability that the event will on the $n$th step is equal to the probability $p(n)$, less the probability that it has already happened on any preceding step.
Here's a plot from our friend Monte Carlo, for fun, with $k \approx 0.003$. The median works out to 21 and average to 22.
This is broadly equivalent to a first-order difference equation from digital signal processing, which is my background, and so I found that quite novel. I'm also intrigued by the notion that $p(n)$ could vary according to any arbitrary formula.
My questions:
- What's the name of this distribution, if it has one?
- Is there any way to derive an expression for $f(n)$ without reference to $F(n)$?
- Are there other examples of discrete recursive distributions like this?
Edits Clarified process about random number generation.