开发者

What is the expected period of a repeating event that has a random (but limited) interval between each occurrence?

Okay, so we've got this event. Awesome, right?

We've also got a timer with a fixed maximum duration, like one of those rotary kitchen timers. Not exactly awesome, but definitely handy.

When the timer goes off, the event occurs, and the timer is reset to some random value between zero and the maximum duration (every value has an equal chance or being selected). 开发者_如何学运维The timer is started immediately, and the process continues forever.

My question is: what is the effective period of the event? That is, if another repeating event has a fixed period, what would that period have to be for the two events to have an equal number of occurrences over a very large amount of time.

I want to say it's half the maximum duration of the timer, but I don't know why, and I wouldn't be surprised if that's wrong.


I want to say it's half the maximum duration of the timer, but I don't know why, and I wouldn't be surprised if that's wrong.

Your intuition is correct. This is just the uniform selection of random numbers from the interval [0, N], where N is the maximum number of minutes on the timer. The expected value of such a selection is the mean of the minimum (0) and the maximum (N) values, so the result is N/2.

You can imagine some other similar cases; for example, the expected value of a die roll is 3.5, because the minimum value is 1 and the maximum is 6, yielding (1 + 6)/2 = 3.5.


I think you are right: 0.5 * maximum duration of the timer.

Reasoning: The maximum period at all with the given setup would be the maximum duration of the timer.

The average duration selected will be ahlf the maximum period of the timer, if they all have an equal probability: Add them up, divide by count and see for yourself:

Example: values 1, 2, 3, 4, 5, 6

Since each have the same probability of being chosen, for N is large: 1 will be chosen N / 6 times, 2 will be chosen N / 6 times etc.

We add them all up: N/6 * (1 + 2 + 3 + 4 + 5 + 6) = N/6 * (21) = N * 21/6 = N * 3.5 ==> the average period for N events firing was 3.5, which is more or less the maximum duration of the timer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜