TAOCP 7.2.2.2 Exercise 293

Equation (131) defines the quantity used for the flushing decision by replacing the old target value $M_t$ with a value farther in the future.

Section 7.2.2.2: Satisfiability

Exercise 293. [21] Spell out the details of updating $M_t$ to $M + \Delta t$ when deciding whether or not to flush. Also compute the agility threshold that's specified in Table 4. See Eq. (131).

Verified: no
Solve time: 3m07s


Solution

Equation (131) defines the quantity used for the flushing decision by replacing the old target value $M_t$ with a value farther in the future. The update is not a reassignment of the measured agility values; it is a change in the next time at which the agility test will be performed.

Suppose the current value of the counter is $M$ and the increment chosen by the reluctant-doubling schedule is $\Delta t$. The new target value is obtained by the single assignment

$$ M_t \leftarrow M+\Delta t . $$

The value of $M$ is the current time of the measurement, so the right-hand side must be formed from the old value of $M$ before the replacement is made. After the replacement, the next test is postponed until the counter reaches this new value of $M_t$.

The reluctant-doubling sequence determines the successive values of $\Delta t$. Its beginning is

$$ 1,1,2,1,1,2,4,1,\ldots , $$

so the successive targets are obtained by adding these increments to the current values of $M$. For example, if the present value is $M=0$, the first four updates give

$$ M_t=0+1=1, $$

$$ M_t=1+1=2, $$

$$ M_t=2+2=4, $$

and

$$ M_t=4+1=5. $$

Thus every execution of the update uses the current $M$ as its base and advances the next checking point by the selected $\Delta t$.

The agility threshold in Table 4 is the quantity against which AGILITY is compared when $M$ reaches $M_t$. The threshold depends on the number $\Delta f$ of flushes already performed. From the schedule in Table 4, the threshold is

$$ \operatorname{AGILITY}_{\rm threshold}

\frac{\psi}{2^{\Delta f}} . $$

Therefore the test performed after reaching $M_t$ is

$$ \operatorname{AGILITY}<\frac{\psi}{2^{\Delta f}} . $$

For $\Delta f=0$, the threshold is

$$ \psi . $$

For $\Delta f=1$, it is

$$ \frac{\psi}{2}. $$

For $\Delta f=2$, it is

$$ \frac{\psi}{4}. $$

In general, after $\Delta f$ previous flushes, the threshold has been divided by $2^{\Delta f}$. Hence the complete threshold specified by Table 4 is

$$ \boxed{\frac{\psi}{2^{\Delta f}}}. $$

This completes the proof. ∎