There are two things follow this mechanism, Golden cookie (Wrath Cookie) and Reindeer. They are called shimmers in the game. The spawning mechanism basically is probabilistic, however the probability density function can be approximated nicely by a simple function. This mechanism is also affected by your current FPS (frames per second), which can be changed via cheating. From now on we shall assume the FPS is 30.
Let us first ignore first Tmin seconds which the probability of spawning Golden Cookie is 0.
There are two basic parameter for shimmers, Tmin and Tmax and there are many factors in the game can alter these two parameters. For first Tmin seconds, the probability of spawn shimmers is 0. After Tmin seconds every frame, the game checks if a random number between 0 and 1 is less than the proportion of time elapsed between the minimum and maximum time, taken to the 5th power. Define the test probability at frame n:
where N=30(Tmax-Tmin) frames is the difference of max time and min time in frame.The probability of spawning shimmer at frame n is:
which means the game failed to spawn from frame 1 to frame n-1, but successes at frame n. The cumulative density function can be calculated:
Since the time of each frame is short compared to the maximum time, we may approximate the difference of left hand side as a derivative:
The solution can be found by usual technique. The cumulative density function of the cookie spawning at kth frame is:
We can change the time unit to more familiar second. Let k=30t and N=30T,and we have:
The resulting cumulative probability of the cookie spawning looks logistic, with the probability early in the range nearly zero but increasing extremely quickly. These function fits well, but fails when t=T=Tmax-Tmin, . However it should not be bother in most case. Now we shall put the initial non-spawning time back.
It is also convenient to consider the inverse function of :
The expectation value of spawning time can be obtained:
where is the gamma function.