views:

65

answers:

2

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.

+2  A: 

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.

Daren Thomas
The reason your calculation yields "more or less" 3.5 instead of exactly 3 (which is the right answer when N = 6) is because you didn't include 0 as a possible choice.
John Feminella
Yes, I saw that, but got fed up with my answer (its a mess, I like yours better) - also, for expected timer values, the error gets a lot smaller. I'm not sure if a timer value of 0 would really work...
Daren Thomas
+8  A: 

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.

John Feminella
Thanks! Totally makes sense. I originally wrote the question in terms of frequency, which seemed less obvious for some reason. Looking at it now, I should have known as soon as I reworded it to ask for the period.
No Surprises