Is it true that a cycle with a period of 29 hours over 24 hours leads to a non-recurring pattern and how to prove it?

302 Views Asked by At

The default 'reset time' for Internet Information Services is 29 hours. The reason for this is that

'Wade [person on the team who developed the setting] suggested 29 hours for the simple reason that it’s the smallest prime number over 24. He wanted a staggered and non-repeating pattern that doesn’t occur more frequently than once per day. In Wade’s words: “you don’t get a resonate pattern”'.

Source: http://blogs.iis.net/owscott/why-is-the-iis-default-app-pool-recycle-set-to-1740-minutes

Is it true that if you have a cycle (of say 24 hours) and in this cycle period you want to have a non-resonate, staggered non-repeating pattern bigger than the cycle period, you have to use a prime number larger than this cycle period? How can this be proved?

/edit A simple calculation shows that this cycle is recurring as follows:

5
10
15
20
1
6
11
16
21
2
7
12
17
22
3
8
13
18
23
4
9
14
19
0
5
10
15
20
(...)

So after 24 times every value is touched and the cycle restarts again. This cycle is repeating after all. I don't know how to formalize this, but I think the question can be answered with False, it does not lead to a non-recurring pattern.

3

There are 3 best solutions below

0
On

If integer $r$ is the length of the reset interval, and resets begin at $t=0$, then the sequence of reset times (as measured on a $24$-hour clock) is $$R_{24,r} = (t\ \mathtt{mod}\ 24:\ \ t\ \mathtt{mod}\ r=0,\ t\in \{0,1,2,...\} )$$ where $\ a\ \mathtt{mod}\ b\ $ denotes the remainder of the division of $a$ by $b$.

NB:

If $q,r$ are positive integers, then the infinite sequence $$R_{q,r} = (t\ \mathtt{mod}\ q:\ \ t\ \mathtt{mod}\ r=0,\ t\in \{0,1,2,...\} )$$ is periodic with fundamental period $\frac{q}{\gcd(q,r)}$, where $\gcd$ denotes the greatest common divisor. Thus, the largest possible fundamental period is $q$, which is attained whenever $q,r$ are coprime (i.e., whenever $\gcd(q,r)=1$).

That is, $R_{q,r}$ contains a minimal repeating cycle of length $\frac{q}{\gcd(q,r)}$. If $q$ is fixed and $r=1,2,3,...$, then the corresponding fundamental periods range over all the divisors of $q$ (in haphazard order). What varies as $r$ varies is the length and internal structure of the minimal repeating cycle.

It seems evident that Wade's actual criteria are just these:

  1. There must be at most one reset every $24$ hours.
  2. The repeating cycle of reset times ($\mathtt{mod}\ 24$) should not be simply $(0,1,2,...,23)$.

Now (1) requires that $r\ge 24$, so consider the first few possibilities:

r   minimal repeating cycle in the sequence of reset times (mod 24)
--  ------------------------------------------------------------------------------------
24  0
25  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23
26  0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22
27  0, 3, 6, 9, 12, 15, 18, 21
28  0, 4, 8, 12, 16, 20
29  0, 5, 10, 15, 20, 1, 6, 11, 16, 21, 2, 7, 12, 17, 22, 3, 8, 13, 18, 23, 4, 9, 14, 19

The smallest integer $r$ satisfying both (1) and (2) is seen to be $r=29$.

NB: In our case of $R_{24,r}$, the maximum period ($24$) is attained when $\gcd(24,r) = 1$, i.e., when $r \in \{1,5,7,11,13,17,19,23,25,29,31,35,... \}$. It just happens that $r=29$ is the least of these with $r\ge 24$ and such that the minimal repeating cycle is not simply $(0,1,2,...,23)$.

0
On

The design somewhat contradicts the stated reasons for choosing $29$.

The reset time is specified not in hours but in minutes, $1740 = 29 \times 60$. By taking it to be a multiple of $1$ hour, there is a synchronization of the resets with the hours of a $24$ hour clock, which makes the possible period lengths $60$ times shorter. The designers created resonance while trying to avoid it.

If the resolution of users' time observation is approximately an hour it is still possible to increase the perceived periodicity at a $1$-hour scale beyond $24$, by using the freedom to select the reset time in minutes.

0
On

No, it isn't true. If you must have a period which is an integer number of hours, any period which is relatively prime to 24 (that is, doesn't share a prime factor with 24) will only hit the same time of day after 24 repetitions. For example: 25 hours would be an hour later each day until it works through all possible times and back to the starting time.

As other answers have noted, the language of the source is incoherent and betrays ignorance of the numerical issues in question.

First of all, if you really wanted to have a different time each day, you would count in minutes (and use any number relatively prime to 1440) or seconds (and use any number relatively prime to 86400).

Secondly, if you wanted to be clever about it and choose an interval which was as far as possible from a "simple" fraction of 24 hours or 1440 minutes or 86400 seconds, you would choose $\frac12(\sqrt 5+1)$ of a day. This is the most difficult ratio of all to approximate as a simple fraction.

But basically all these numerical acrobatics are pointless given the relatively mild requirement "not to reset at the same time each day".