Skip to main content
Log in

On the Smoothness of Paging Algorithms

  • Published:
Theory of Computing Systems Aims and scope Submit manuscript

Abstract

We study the smoothness of paging algorithms. How much can the number of page faults increase due to a perturbation of the request sequence? We call a paging algorithm smooth if the maximal increase in page faults is proportional to the number of changes in the request sequence. We also introduce quantitative smoothness notions that measure the smoothness of an algorithm. We derive lower and upper bounds on the smoothness of deterministic and randomized demand-paging and competitive algorithms. Among strongly-competitive deterministic algorithms, LRU matches the lower bound, while FIFO matches the upper bound. Well-known randomized algorithms such as Partition, Equitable, or Mark are shown not to be smooth. We introduce two new randomized algorithms, called Smoothed-LRU and LRU-Random. Smoothed-LRU allows sacrificing competitiveness for smoothness, where the trade-off is controlled by a parameter. LRU-Random is at least as competitive as any deterministic algorithm but smoother.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price includes VAT (Netherlands)

Instant access to the full article PDF.

Institutional subscriptions

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5

Similar content being viewed by others

Notes

  1. See the Appendix for the proof.

  2. See the Appendix for the proof.

  3. See the Appendix for the proof.

  4. See the Appendix for the proof.

  5. See the Appendix for the proof.

  6. Note that the conference version of this article [25] incorrectly claimed Smoothed −LRU k, i to be \((1,\delta (\frac {k+i}{2i+1}+1))\)-smooth.

  7. See the Appendix for the proof.

  8. See the Appendix for the proof.

  9. See the Appendix for the proof.

References

  1. Achlioptas, D., Chrobak, M., Noga, J.: Competitive analysis of randomized paging algorithms. Theoretical Comput. Sci. 234 (1-2), 203–218 (2000). https://doi.org/10.1016/S0304-3975(98)00116-9. http://www.sciencedirect.com/science/article/pii/S0304397598001169

    Article  MathSciNet  MATH  Google Scholar 

  2. Aho, A., Denning, P., Ullman, J.: Principles of optimal page replacement. J. ACM 18(1), 80–93 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  3. Axer, P., et al.: Building timing predictable embedded systems. ACM Trans. Embed. Comput. Syst. 13(4), 82:1–8:372 (2014). https://doi.org/10.1145/2560033

    Article  Google Scholar 

  4. Becchetti, L., Leonardi, S., Marchetti-Spaccamela, A., Schäfer, G., Vredeveld, T.: Average-case and smoothed competitive analysis of the multilevel feedback algorithm. Math. Oper. Res. 31(1), 85–108 (2006). https://doi.org/10.1287/moor.1050.0170

    Article  MathSciNet  MATH  Google Scholar 

  5. Beckmann, N., Sanchez, D.: Talus: a Simple Way to Remove Cliffs in Cache Performance. In: 21St IEEE International Symposium on High Performance Computer Architecture, HPCA 2015, Burlingame, CA, USA, February 7-11, 2015, pp. 64–75 (2015). https://doi.org/10.1109/HPCA.2015.7056022

  6. Belady, L.A.: A study of replacement algorithms for virtual-storage computer. IBM Syst. J. 5(2), 78–101 (1966)

    Article  Google Scholar 

  7. Borodin, A., El-Yaniv, R.: Online computation and competitive analysis. Cambridge University Press, New York (1998)

    MATH  Google Scholar 

  8. Brodal, G.S., Moruz, G., Negoescu, A.: Onlinemin: a fast strongly competitive randomized paging algorithm. Theory Comput. Syst. 56(1), 22–40 (2015). https://doi.org/10.1007/s00224-012-9427-y

    Article  MathSciNet  MATH  Google Scholar 

  9. Cazorla, F.J., et al.: PROARTIS: Probabilistically analyzable real-time systems. ACM Trans. Embed. Comput. Syst. 12(2s), 94:1–94:26 (2013). https://doi.org/10.1145/2465787.2465796

    Article  Google Scholar 

  10. Chaudhuri, S., Gulwani, S., Lublinerman, R.: Continuity and robustness of programs. Commun. ACM 55(8), 107–115 (2012). https://doi.org/10.1145/2240236.2240262

    Article  MATH  Google Scholar 

  11. Doychev, G., et al.: CacheAudit: A tool for the static analysis of cache side channels. ACM Trans. Inf. Syst. Secur 18(1), 4:1–4:32 (2015). https://doi.org/10.1145/2756550

    Article  Google Scholar 

  12. Doyen, L., Henzinger, T., Legay, A., Nickovic, D.: Robustness of Sequential Circuits. In: ACSD ’10, pp 77–84 (2010). https://doi.org/10.1109/ACSD.2010.26

  13. Dwork, C.: Differential privacy. In: Bugliesi, M., Preneel, B., Sassone, V., Wegener, I. (eds.) ICALP ’06, Part II, LNCS, vol. 4052, pp 1–12. Springer (2006). https://doi.org/10.1007/11787006_1

  14. Fiat, A., Karp, R.M., Luby, M., McGeoch, L.A., Sleator, D.D., Young, N.E.: Competitive paging algorithms. J. Algorithms 12(4), 685–699 (1991)

    Article  MATH  Google Scholar 

  15. Kleene, S.: Automata studies, chap. Representation of events in nerve nets and finite automata. Princeton University Press, Princeton (1956)

    Google Scholar 

  16. Komm, D., Královic, R., Královic, R., Mömke, T.: Randomized online algorithms with high probability guarantees. In: STACS ’14, vol. 25, pp 470–481 (2014)

  17. Koutsoupias, E., Papadimitriou, C.: Beyond competitive analysis. SIAM J. Comput. 30(1), 300–317 (2000). https://doi.org/10.1137/S0097539796299540

    Article  MathSciNet  MATH  Google Scholar 

  18. Liu, C.L.: Some memory aspects of finite automata. Tech. Rep. 411 Massachusetts Institute of Technology (1963)

  19. Mattson, R.L., Gecsei, J., Slutz, D.R., Traiger, I.L.: Evaluation techniques for storage hierarchies. IBM Syst. J. 9(2), 78–117 (1970)

    Article  MATH  Google Scholar 

  20. McGeoch, L., Sleator, D.: A strongly competitive randomized paging algorithm. Algorithmica 6, 816–825 (1991). https://doi.org/10.1007/BF01759073

    Article  MathSciNet  MATH  Google Scholar 

  21. Motwani, R., Raghavan, P.: Randomized algorithms. Cambridge University Press, New York (1995)

    Book  MATH  Google Scholar 

  22. Perles, M., Rabin, M., Shamir, E.: The theory of definite automata. IEEE Trans. Electron. Comput. 12(3), 233–243 (1963). https://doi.org/10.1109/PGEC.1963.263534

    Article  MathSciNet  MATH  Google Scholar 

  23. Raghavan, P., Snir, M.: Memory versus randomization in on-line algorithms (Extended Abstract). In: Ausiello, G., Dezani-Ciancaglini, M., Rocca, S.R.D. (eds.) ICALP ’89, Lecture Notes in Computer Science, vol. 372, pp 687–703. Springer (1989). https://doi.org/10.1007/BFb0035792

  24. Reineke, J., Grund, D.: Sensitivity of cache replacement policies. ACM Trans. Embed. Comput. Syst. 12(1s), 42:1–42:18 (2013). https://doi.org/10.1145/2435227.2435238

    Article  Google Scholar 

  25. Reineke, J., Salinger, A.: On the smoothness of paging algorithms. In: Sanità, L., Skutella, M. (eds.) Approximation and Online Algorithms - 13th International Workshop, WAOA 2015, Patras, Greece, September 17-18, 2015. Revised Selected Papers, Lecture Notes in Computer Science, vol. 9499, pp 170–182. Springer (2015). https://doi.org/10.1007/978-3-319-28684-6_15

  26. Sleator, D.D., Tarjan, R.E.: Amortized efficiency of list update and paging rules. Commun. ACM 28(2), 202–208 (1985)

    Article  MathSciNet  Google Scholar 

  27. Spielman, D.A., Teng, S.H.: Smoothed analysis of algorithms: why the simplex algorithm usually takes polynomial time. J. ACM 51(3), 385–463 (2004). https://doi.org/10.1145/990308.990310

    Article  MathSciNet  MATH  Google Scholar 

  28. Wilhelm, R., et al.: The worst-case execution-time problem—overview of methods and survey of tools. ACM Trans. Embed. Comput. Syst. 7(3), 36:1–36:53 (2008). https://doi.org/10.1145/1347375.1347389

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jan Reineke.

Additional information

This work was partially supported by the German Research Council (DFG) as part of the project “PEP: Precise and Efficient Prediction of Good Worst-case Performance for Contemporary and Future Architectures” and as part of the Transregional Collaborative Research Center “Automatic Verification and Analysis of Complex Systems” (SFB/TR 14 AVACS).

We would like to sincerely thank the anonymous reviewers for their help in improving this paper.

Most of the reported work was carried out while the second author was a postdoctoral researcher at Saarland University.

A preliminary version of this work appeared at the 13th Workshop on Approximation and Online Algorithms (WAOA) [25].

Appendix

Appendix

Theorem 3 (Smoothness of OPT)

OPT is (1, 2δ)-smooth. This is tight.

Proof

For the lower bound consider the following two sequences σ δ and \(\sigma ^{\prime }_{\delta }\)with \({\Delta }(\sigma _{\delta },\sigma ^{\prime }_{\delta })\,=\,\delta \): σ δ = (1,…, k, 1,…, k)δ+1 and σ δ′ = (1,…, k, 1,…, k, x)δ(1,…, k, 1,…, k),where σ ldenotes the concatenation of l copies of σ and x∉{1,…, k}.Clearly, OPT(σ δ ) = k as σ δ contains only k distinct pages. Further, under optimal replacement every request to x faultsin \(\sigma ^{\prime }_{\delta }\) and it replaces one of the pages 1,…, k,which results in an additional fault later on. So, \(\text {OPT}(\sigma ^{\prime }_{\delta }) \geq k + 2\delta \).

We show that OPTis (1, 2, 1)-smooth,which implies the theorem by Corollary 1. Let σ and σ be two sequences such that Δ(σ, σ ) = 1.We will show that there exists an algorithm A such that A(σ ) ≤ O P T(σ) + 2,from which the theorem follows since OPT(σ ) ≤ A(σ ).Let A be an offline paging algorithm serving σ .On the identical prefix of σ and σ,A will act exactly as OPTdoes on σ.This implies that right before the difference, the caches C OPT of OPTand C A of A have the same pages. No matter what the difference between thesequences is, the different request can only make the caches of A and OPT differ by at most one page: if it is an insertion of p in σ that results in a hit for A, then C OPT = C A ;otherwise p evicts a page q and fetches p. If the difference is a deletion of p from σ ,then if p is a hit, C OPT = C A ,and otherwise OPT evicts some page q and fetches p. If the difference is a substitution of p in σ by r in σ , then if either of the requests is a hit this is equivalent tothe cases above, and if they are both misses, A evicts what OPTevicts. In all cases, after the difference either C A = C OPT,or C A = (C OPT ∖{q}) ∪{p}for some pages p and q, with pq. At this point the number of faults of A exceeds those of OPT by at most one. We now show that A can manage to incur at most one more fault than OPTin the rest of the sequence.

Let ρ be the suffix of σ and σ after the difference and let A i (ρ)and OPT i (ρ) denote the number of faults of the algorithms on the suffix up torequest i. We now claim that A can be such that after every request ρ i either (1) A i (ρ) ≤OPT i (ρ)and either C A = C OPTor C A = (C OPT ∖{q}) ∪{p},for some pages p and q with pq,or (2) A i (ρ) =OPT i (ρ) + 1and C A = C OPT.If at any point C A = C OPT,then A acts like OPTfor the rest of the suffix and the claim is true.

We show that this invariant holds after every request ρ i ,which implies that A(ρ) ≤OPT(ρ) + 1and hence that A(σ ) ≤OPT(σ) + 2.

Initially A 0(ρ) =OPT0(ρ)andassume that C A = (C OPT ∖{q}) ∪{p}. A actsas follows on ρ i :

  • If ρ i C A and ρ i C OPT, A does nothing and the invariant holds.

  • If ρ i C A and ρ i C OPT,then ρ i = p and A does nothing. It holds that A i (ρ) ≤OPT i (ρ).If OPTevicts a page q q,then C A = (C OPT ∖{q}) ∪{q }and the invariant holds. If OPTevicts q then both caches are equal and the claim is true.

  • If ρ i C A and ρ i C OPT, A i (ρ) ≤OPT i (ρ)still holds. If OPT evicts q, A evicts p, and the caches are equal. Otherwise A evicts the same page as OPT and C A = (C OPT ∖{q}) ∪{p}.

  • If ρ i C A and ρ i C OPT,then ρ i = q. A i (ρ) =OPT i (ρ) + 1, A evicts p and C A = C OPT.

Theorem 10 (Lower bound for strongly-competitive randomized paging algorithms)

No strongly-competitive randomized paging algorithm is (1, δ(H k 𝜖), δ)-smooth for any 𝜖 > 0 and any δ > 0.

Proof

For any H k -competitivealgorithm A and any 𝜖 > 0,we show how to construct sequences \(\sigma _A^{\prime }(d)\) and σ A (d)with \({\Delta }(\sigma _A^{\prime }(d), \sigma _A(d))=d\),such that \(A(\sigma _A^{\prime }(d))-A(\sigma _A(d)) > {\Delta }(\sigma _A^{\prime }(d), \sigma _A(d))\cdot (H_k-\epsilon )\),for all d greater than some constant c. So A is not (1, d(H k 𝜖), d)-smoothfor any d > c,which by the contrapositive of Corollary 2 implies that A is not (1, d(H k 𝜖), d)-smoothfor any d > 0.

Fiat et al. [14] show how to construct a “bad” sequence for a given arbitrary randomizedalgorithm consisting of requests to k + 1distinct pages and anarbitrary number of k-phases, in each of which the algorithm is guaranteed to incur at least H k misses, while the optimal offline algorithm incurs only one miss. The optimal algorithmincurs exactly one miss in each k-phase upon the request to the single page that was notrequested in the previous phase.

We adapt the construction of Fiat et al. as follows, maintainingthe property that the constructed “bad” sequence consists of k + 1distinct pages. A page is called marked if it has already been requested in thecurrent k-phase and unmarked otherwise. Whenever it is possible to incur a cost of\(H_k-\frac {\epsilon }{2}\)in a k-phase by requesting only unmarked pages, we do so. We call such phases type I.Whenever, this is not possible, we can construct a type II phase that results in more than H k + η misses, where η > 0depends on 𝜖.Type-II phases may only happen a finite number of times for each occurrenceof a type-I phase: otherwise, the sequence would be a counterexample to the H k -competitivenessof A. Thus, for any d we can construct a sequence \(\sigma _A^{\prime }(d)\)that includes exactly d type-I phases.

From the resulting “bad” sequence \(\sigma _A^{\prime }(d)\)we obtain the “good” sequence σ A (d)by deleting one request from each of the type-I phases. By construction, each page isonly requested once in a type-I phase. By deleting the one request to the page thatis not requested in the following phase, we reduce the number of k-phases inthe sequence by one. As a consequence, the resulting “good” sequence contains nd phases, where n is thenumber of phases of \(\sigma _A^{\prime }(d)\).Including compulsory misses, the optimal offline algorithm incurs (k + n − 1) − d misses. As A is strongly competitive, it incurs at most H k ⋅ (k + n − 1 − d) + β misses on σ A for someconstant β.On the other hand, by construction, the number of expected misses on\(\sigma _A^{\prime }\) is at least\(k+(n-1)\cdot H_k-d\cdot \frac {\epsilon }{2}\), and weget:

$$A(\sigma_A^{\prime}(d)) - A(\sigma_A(d)) \geq k\cdot(1-H_k) + d\cdot\left( H_k - \frac{\epsilon}{2}\right) - \beta,$$

which is greater than d ⋅ (H k 𝜖)for large enough valuesof d. As, by construction \(d = {\Delta }(\sigma _A^{\prime }(d), \sigma _A(d))\)this proves the theorem.

It remains to show how to construct type-I and type-II phases with the properties discussedabove. As in Fiat et al.’s construction, each phase, type I or type II, consists of k subphases. Each subphase consists of requests to at most one previously unmarkedpage and an arbitrary number of requests to marked pages. We call a subphasetype I, if it consists of a single request to an unmarked page and incurs at least\(\frac {1}{u}-\epsilon _i\)expectedmisses, where 𝜖 i is an additional parameter that controls the reduction in expected faults we are willing to pay for a type-Isubphase, and u = ki + 1denotes the number of unmarked pages in subphase i. Thus, a phase is of type I if all of itssubphases are type I. As long as all subphases of a current phase have been of type I, we will tryto continue the construction with another type-I subphase. If this turns out to be impossible, wewill construct a type-II subphase, which compensates for the reductions in misses in theprevious type-I subphases. If there has already been at least one type-II subphase in thecurrent phase, the construction finishes the phase exactly following Fiat et al.’s originalconstruction.

During the construction of the sequence, the adversary maintains for each of the requested pages itsprobability p i of not being in the cache. This is possible, because the adversary knows the probabilitydistribution used by A. Let M be the set of marked pages at the start of the subphase and let\(p_M = {\sum }_{i \in M} p_i\)be the probability that a marked page is not cached. Similarly, let\(p_{NM} = 1-p_M = {\sum }_{i \not \in M} p_i\).

If a type-I phase is still possible, and there is an unmarked page j with\(p_j \geq \frac {1}{u} - \epsilon _i\)theadversary requests this page to create a type-I subphase. Note that such an unmarked page alwaysexists for the first subphase of each phase: the most-recently-used page is cached withprobability 1,and so among the k other, unmarked pages, at least one must have a miss probability of\(\frac {1}{k}\). If there is no suchunmarked page, then \(p_{NM} < u\cdot (\frac {1}{u} - \epsilon _i) = 1-\epsilon _i\cdot u\) and consequently p M = 1 − p N M 𝜖 i u.For the first subphase where no type-I subphase can be constructed, and thus p M 𝜖 i u, the adversary requeststhe marked page l with l = arg max iM p i .Let μ = p l . As there are i marked pages and p M 𝜖 i u, μ mustbe at least \(\frac {\epsilon _i\cdot u}{i} = \frac {\epsilon _i\cdot (k-i+1)}{i} \geq \frac {\epsilon _i}{k}\)for 1 < ik.The adversary can now generate requests to marked pages using the following loop:

While the expected number of faults in subphase i is less than\(\frac {1}{u}+\frac {\epsilon _i}{2k}\), and while\(p_M > \frac {\epsilon _i u}{2 k}\), request a Markedpage l such that l = arg max iM p i .

This loop is guaranteed to terminate, as each iteration adds at least\(\frac {\epsilon _i u}{2 k i}\)to the expected number faults in the subphase. Remember that i remains constantwithin a subphase. If the total expected number of faults ends up exceeding\(\frac {1}{u}+\frac {\epsilon _i}{2k}\),an arbitrary request is made to an unmarked page. Otherwise, the unmarked pagewith the highest probability value is requested. Its fault probability is at least\(\left (1-\frac {\epsilon _i\cdot u}{2k}\right )\cdot \frac {1}{u} = \frac {1}{u} - \frac {\epsilon _i}{2k}\).Taking into account the initial request to a marked page that contributed at least\(\frac {\epsilon _i}{k}\)faults, the subphase has anexpected number of at least \(\frac {1}{u} + \frac {\epsilon _i}{2k}\)faults.

If there has already been at least one type-II subphase in the current phase, weapply the original construction of Fiat et al. to obtain a subphase that incurs at least\(\frac {1}{u}\)faults: If there is anunmarked page j with \(p_j \geq \frac {1}{u}\),access j and end the subphase. Otherwise, access the marked page m with m = arg max iM p i . Let μ = p m . Theadversary can now generate requests to marked pages using the following loop:

While the expected number of faults in subphase i is less than\(\frac {1}{u}\), and while p M > μ, request a marked page l such that l = arg max iM p i .

This loop is guaranteed to terminate, as each iteration adds at least\(\frac {\mu }{i}\)to theexpected number faults in the subphase. If the total expected number of faults ends up exceeding\(\frac {1}{u}\),an arbitrary request is made to an unmarked page. Otherwise, the unmarked pagewith the highest probability value is requested. Its fault probability is at least\(\frac {1-\mu }{u}\).Thus, the expected number of faults of the subphase is at least\(\mu + \frac {1-\mu }{u} \geq \frac {1}{u}\).

For a given 𝜖, we canchoose the parameters 𝜖 i such that if all subphases end up as type I, and thus the phase itselfends up as type I, the expected number of faults per phase is at least\(H_k - \frac {\epsilon }{2}\): the sum of theparameters 𝜖 i needs to beless than or equal to \(\frac {\epsilon }{2}\).Further, by picking 𝜖 i such that \(\frac {\epsilon _i}{2k} > \eta + {\sum }_{1 \leq j < i} \epsilon _j\)for some η > 0,we can make sure that a type-II phase will have an expected number of misses greater than H k + η.

Such 𝜖 i and η can be obtained, e.g., asfollows: Pick arbitrary γ > 0, η > 0, 𝜖1′ > 0.For i > 1, let\(\epsilon _i^{\prime } = 2k\cdot (\gamma +\eta ^{\prime }+{\sum }_{1 \leq j < i} \epsilon _j^{\prime })\). We canthen choose \(\epsilon _i = \frac {\epsilon }{2}\cdot \frac {\epsilon _i^{\prime }}{{\sum }_{1 \leq j \leq k} \epsilon _j^{\prime }}\) and \(\eta = \frac {\epsilon }{2}\cdot \frac {\eta ^{\prime }}{{\sum }_{1 \leq j \leq k} \epsilon _j^{\prime }}\). □

Theorem 11 (Smoothness of Partition and Equitable)

For any cache size k ≥ 2, there is an 𝜖 > 0, such that neither Partition nor Equitable is (1 + 𝜖, γ, 1)-smooth for any γ . Also, Partition and Equitable are (H k , 2δ H k )-smooth.

Proof

The fact that the two policies are (H k , 2δ H k )-smoothfollows immediately from Theorem 4 and the fact that the two policies are H k -competitivewith additive constant 0.

Koutsoupias and Papadimitriou [17] introduced the layer representation, a sequence (L 1,…, L k )of k sets of pages that compactly represents the current work function. For both Partition and Equitable, the probability of being in a particular configuration is determined by thecurrent work function and thus its layer representation. See Achlioptas et al. [1] for moredetails.

Let ω = (L 1,…, L k )and let p be the next page to be requested. Then the layer representation of the work function isupdated as follows:

$$\omega^{p} = \left\{\begin{array}{ll} (p, L_1, \dots, L_{j-1}, L_j \cup L_{j+1} - \{p\}, L_{j+2}, \dots, L_k) & if p \in L_j \wedge j < k\\ (p, L_1, \dots, L_{k-1}) & if p \in L_k\\ (p, L_1 \cup L_2, L_3, \dots, L_k) & if p \not\in \bigcup_{i=1}^{k} L_i \end{array}\right. $$

In the following, to save space, we will omit braces in the representation of the sets L i , i.e. (a b c, d, e) = ({a, b, c},{d},{e}).

Starting from an empty cache, and the corresponding empty layer representation, the sequence σ = y, x, k − 1, k − 2,…, 1, 0, k − 2, k − 3,…, 1, 0yieldsthe following layers:

$$(0, 1, \dots, k-2, (k-1)xy).$$

The sequence σ = y, x, k − 1, k − 2,…, 1, 0, k − 1, k − 2,…, 1, 0, on the otherhand, with Δ(σ , σ) = 1yields the following layers, in which all pages are revealed:

$$(0, 1, \dots, k-2, k-1).$$

In the following, we show how to extend these two sequences to yieldan unbounded difference in the expected number of faults. An arrow indicates a request to pagep with a hit probability of h 1under prefix σ and ahit probability of h 2 under prefix σ. The hit probabilities apply to Partition. We later discuss where the hit probabilities differ for Equitable.

Table 11

Observe that the layers at the end of the above sequence are equal to the layers at thebeginning of the sequence up to renaming. So we can extend the sequence arbitrarily achieving thesame hit probabilities on both sides.

It remains to compute the expected number of hits and misses on the the sequence σ . Summing up the hitprobabilities for prefix σ ,we get:

$$\begin{array}{@{}rcl@{}} && 0 + \sum\limits_{i=0}^{k-3} \frac{k-i-1}{k-i} + 0 + \frac{1}{2}\cdot\frac{k-1}{k} + \sum\limits_{i=0}^{k-3} \frac{i+1}{i+2}\\ &=& \left( k-H_k-\frac{1}{2}\right) + \frac{1}{2}\cdot\frac{k-1}{k} + \left( k-H_{k-1}-1\right)\\ &=& 2k - 2H_k + \frac{1}{k} + \frac{1}{2}\cdot\frac{k-1}{k} - \frac{3}{2}\\ &=& 2k - 2H_k - 1 + \frac{1}{2k}. \end{array} $$

As there are 2k − 1requests on the sequence, the expected number of misses for prefix σ is

$$2H_k - \frac{1}{2k}. $$

Summing up the hit probabilities for prefix σ, we get:

$$\begin{array}{@{}rcl@{}} && \frac{1}{3} + \sum\limits_{i=0}^{k-3} 1 + 0 + 0 + \sum\limits_{i=0}^{k-3} \frac{i+2}{i+4}\\ &=& \frac{1}{3} + k-2 + \left( k-2H_{k+1}+\frac{5}{3}\right)\\ &=& 2k - 2H_{k+1}, \end{array} $$

which yields an expected number of misses for prefix σ of

$$2H_{k+1}-1 = 2H_k - \frac{k-1}{k+1}. $$

The hit probabilities on the sequence above are the same under Equitable as under Partition, except forthe request to page k − 1.Under Equitable this request has a hit probability of\(\frac {1}{2}-\frac {1}{k(k+1)}\).So the number of expected misses under Equitable for prefix σ is

$$\begin{array}{@{}rcl@{}} && 2H_k-\frac{1}{2k} + \frac{k-1}{2k} - \left( \frac{1}{2}-\frac{1}{k(k+1)}\right)\\ &=& 2H_k-\frac{1}{k+1}. \end{array} $$

For prefix σ, Equitable and Partition behave exactly the same. Observe that in both cases, the number of expected missesfor prefix σ is lower than for prefix σ .As we can arbitrarily extend the sequence presented above, for any cache size k ≥ 3, there is an 𝜖, such that neither Equitablenor Partitionare (1 + 𝜖, γ, 1)-smoothfor any γ.

For a cache size of 2,consider the sequences σ = 4, 3, 2, 1, 0and σ = 3, 2, 1, 0, with Δ(σ , σ) = 1, which yield layers (0, 1234) and (0, 123), respectively.The sequence 4, 5, 6, 7, 1, 4, 7, 0, 2 yields the following layers and hit probabilities under both Equitable and Partition:

Table 12

The final layers are equal up to renaming to the initial layers, so we canextend the sequence arbitrarily achieving the same hit probabilities on bothsides. As the expected number of hits differs depending on the two prefixes, \(\frac {9}{20}\)for σ versus\(\frac {9}{14}\)for σ, this proves thetheorem for k = 2. □

Theorem 12 (Smoothness of Mark)

Let \(\alpha =\max _{1< \ell \leq k}\left \{\frac {\ell (1+H_{k}-H_{\ell })}{\ell -1+H_{k}-H_{\ell -1}}\right \}={\Omega }(H_{k})\) , where k is the cache size. Mark is not (α𝜖, γ, 1)-smooth for any 𝜖 > 0 and any γ . Also, Mark is (2H k − 1, δ(4H k − 2))-smooth.

Proof

The upper bound follows from the fact that Mark is 2H k − 1competitive with additive constant 0 [1]and Theorem 4. For the lower bound, we construct sequences σ and σ with Δ(σ, σ ) = 1 such that Mark(σ ) ≥ α Mark(σ) + β,where β is a constant. Consider the k-phase partition of σ and let σ h denote the h thphase of σ.The sequence σ will be such that its phases will be shifted to the left with respect to those of σ.More specifically, if i h and \(i^{\prime }_h\)are the indices of the first page of σ h and \(\sigma ^{\prime }_h\), respectively, then for all h ≥ 3, \(i_h = i_h^{\prime }+\ell -1\),where is a parameter satisfying 2 ≤ k.After an initial setup that includes the difference between the sequences, each phase of σ and σ will consist of exactly k pages. For a given phase and sequence we call a page old if it was requested in the previous phase and new otherwise. Since thereare k requests per phase, no pages are repeated during a phase. A phase for σ will consist of new pages followed by k old ones. In turn, a phase for σ starts with one new page, followed by k + 1old pages, and ends with − 2new pages (see Fig. 6).

Fig. 6
figure 6

New (n) and old (o) pages in each phase in σ and σ for the lower bound of Mark. Vertical bars between pages indicate the boundaries of phases

Since at the end of a phase h all pages of the phase are in Mark’s cache, a newpage in phase h + 1 is always a fault. On the other hand, a request for the j th old page in the phasehas a fault probability of n j /(kj + 1),where n j is the number of new pages in the phase before the request to this page [7]. Then, the expected number of missesin a phase of σ is \(\ell +{\sum }_{j=1}^{k-\ell }\frac {\ell }{k-j+1}=\ell (1+H_k-H_{\ell })\), while the expected numberof misses in a phase of σ is \(1+{\sum }_{j=1}^{k-\ell +1}\frac {1}{k-j+1} + \ell -2=\ell -1+H_k-H_{\ell -1}\).

We now show that given a phase \(\sigma ^{\prime }_h\)as described above, with σ satisfying \(i_h = i_h^{\prime }+\ell -1\), wecan construct σ h and moreover we can maintain the configuration for the next phase. Since \(i_h = i_h^{\prime }+\ell -1\), the first request in i h coincides with thelast new page of \(\sigma ^{\prime }_h\).This page can be any new page not requested so far, and hence is also new for σ h . Now k old pages followin \(\sigma ^{\prime }_h\). Note thatthe first − 1pages of\(\sigma _h^{\prime }\)belong to phase σ h−1. This leaves k + 1of possible pages in σ h−1that can be old for σ. We request those pagesnext. The first k are oldin \(\sigma ^{\prime }_h\) and the last one is theone that starts phase \(\sigma ^{\prime }_{h+1}\).From then, we request − 1 new pages that have not been requested before and hence are new for both σ and σ . Since there have been already k + 2 + − 1 = k + 1 distinct pages requested in σ h , the last of these − 1 pages marks the start of the (h + 1)st phase of σ and \(i_{h+1}=i_{h+1}^{\prime }+\ell -1\).

Finally, we show that the configuration of phases described above can be reached with one differencebetween σ and σ and a constant number of misses on both sequences. An example sequence is shown below for any k and l. The structure of the phases described above is satisfied starting from the third phase of the sequences.

$$\begin{array}{llllllllllllllllllllllllllll} & & &&&&&&&&&&&&&&\mathrm{n}&\!\ldots\! &\mathrm{n}&\mathrm{n}& \mathrm{o}&\!\ldots\!&\mathrm{o}&\mathrm{n}&\mathrm{n}&\!\ldots\! & \mathrm{n} & \mathrm{n}\\ \sigma^{\prime}\!:\! & x_0 & x_1 & x_2 & \!\ldots\! & x_{k-1} & |x_k &x_1 & x_2 & \!\ldots\! & x_{\ell-1} & y_{1} & x_1 & y_{2} & \!\ldots\! & y_{k-\ell}& |y_{k-\ell+1} & \!\ldots\! & y_{k-1} & y_{k} & y_{1} & \!\ldots\! & y_{k-\ell} & |x_1 & x_2 & \!\ldots\! & x_{\ell-1}& x_{\ell}\\ \sigma\!:\! & & x_1 & x_2 & \!\ldots\! & x_{k-1} & x_k &x_1 & x_2 & \!\ldots\! & x_{\ell-1} & |y_{1} & x_1 & y_{2} & \!\ldots\! & y_{k-\ell}& y_{k-\ell+1} & \!\ldots\! & y_{k-1} & |y_{k} & y_{1} & \!\ldots\! & y_{k-\ell} & x_1 & x_2 & \!\ldots\! & x_{\ell-1}& |x_{\ell}\\ && &&&&&&&&&&&&&&& &&\mathrm{n}& \mathrm{o}&\!\ldots\!&\mathrm{o}&\mathrm{o}&\mathrm{n}&\!\ldots\! & \mathrm{n} & \mathrm{n}\\ \end{array}$$

For each phase h the ratio between faults in \(\sigma _h^{\prime }\) and σ h is \(\frac {\ell (1+H_k-H_{\ell })}{\ell -1+H_k-H_{\ell -1}}\). Taking = ⌈H k ⌉it is easy to showthat this ratio is Θ(H k ).By the argument above the sequences can be extended to an arbitrarylength maintaining the phase configurations and the theorem follows. □

Theorem 14 (Smoothness of EOA)

EOA is \((1,\delta (1+\frac {k}{2k-1}))\) -smooth. This is tight.

Proof

We show that EOA is (1, 1 + k/(2k − 1), 1)-smooth.The theorem follows from Corollary 1. Let σ be a sequence and let σ i denote the i-th request in σ.We denote by d i the reuse distance of σ i ,i.e., the number of requests since the last request to this page in σ,not including σ i (so, for example, if σ i−1 and σ i are requests to the same page, then d i = 0).If σ i is the first request to this page, then d i = .Consider a page p in EOA’s cache. On a request for another page, p is evicted with probability 1/k and thus the probability that p is still in cache after d requests to other pages is (1 − 1/k)d.Hence, the probability of any request σ i being a hit is \((1-1/k)^{d_i}\) and therefore \(\text {EOA}(\sigma )={\sum }_{i=1}^{|\sigma |} 1-(1-1/k)^{d_i}\).

Let σ be a sequence resulting from one change to σ.Assume that this change is an insertion of a new page p that is not requested elsewhere in σ.The insertion of p increases the reuse distance of allrequests after p whose previous request was before p. Let \(d_i^{\prime }\)denote the reuse distances of request i in σ .For simplicity of notation, assume that if p is requested at index j in σ ,then we add a request σ j to σ for an empty page (which has distance d j = 0,does not affect other reuse distances, nor requires any action from EOA). Hence, indices inboth sequences correspond to the same pages (but for the request to p).

Let S denote the set of indices of requests whose distances increase in σ compared to the ones they had in σ after the insertion of \(\sigma ^{\prime }_j=p\).That is, \(S=\{i \mid i>j, d_i^{\prime }\ge i-j\}\).Then \(d_j^{\prime }=\infty \), \(d_i^{\prime }=d_i+1\)if iS,and \(d_i^{\prime }=d_i\)otherwise. Hence,

$$\begin{array}{@{}rcl@{}} {\text{EOA}}(\sigma^{\prime})-{\text{EOA}}(\sigma) &=& \left( \sum\limits_{i=1}^{|\sigma^{\prime}|} 1-\left( 1-\frac{1}{k}\right)^{d_i^{\prime}}\right)- \left( \sum\limits_{i=1}^{|\sigma|} 1-\left( 1-\frac{1}{k}\right)^{d_i}\right) \end{array} $$
(6)
$$\begin{array}{@{}rcl@{}} &=& 1+\sum\limits_{i \in S}\left( 1-\frac{1}{k}\right)^{d_i}-\left( 1-\frac{1}{k}\right)^{d_i+1} \end{array} $$
(7)
$$\begin{array}{@{}rcl@{}} &=&1+\frac{1}{k}\sum\limits_{i \in S}\left( 1-\frac{1}{k}\right)^{d_i} \end{array} $$
(8)

We now show that for all S and valid distances d i , \({\sum }_{i \in S}(1-1/k)^{d_i}\le k^2/(2k-1)\) andhence EOA(σ ) −EOA(σ) ≤ 1 + k/(2k − 1) ≤ 2.

Let iS and let i < j be the largestindex such that \(\sigma _{i^{\prime }}=\sigma _i\).Then, d i = ii − 2 ≥ 0(recall that σ j does not contribute to the reuse distance). It is convenient to represent d i as a pair (a i , b i ), where a i is the number ofrequests strictly between \(\sigma _{i^{\prime }}\) and σ j and b i is the number ofrequests strictly between σ j and σ i .Thus, d i = a i + b i .Let \(\vec {d_S}=\{ (a_i,b_i) \}_{i=1}^{|S|}\)denote a configuration of reuse distances of requests with indices in S, and let\(h_{S,d}={\sum }_{i \in S}(1-1/k)^{d_i}\). We claimthat h S, d ismaximal when, after the request j, all previous requests are requested in reverse order. This is, S = {j + 1,…, 2j − 1}, andfor all d i , a i = b i = ij − 1. First, we argue that themaximum of h S, d is attainedwhen S = {j + 1,…, 2j − 1}, for some configuration\(\vec {d_S}\). The size of S can be atmost j − 1, as there cannot bemore than j − 1requests whoseprevious requests are before σ j .Now, assume that S does not contain an index from j + 1to 2j − 1. Let t 1be the smallest such index. Then, either there exists an index t 0 < j such that \(\sigma _{t_0}\) is not requestedafter σ j or the nextrequest to \(\sigma _{t_0}\) is after t 1. In either case, wecan modify σ to obtain S (and the correspondingconfiguration \(d^{\prime }=d_{S^{\prime }}\))that includes t 1bymaking \(\sigma _{t_1}=\sigma _{t_0}\), with\(h_{S^{\prime },d^{\prime }}\ge h_{S,d}\). Suppose that\(\sigma _{t_0}\)was not requestedafter σ j . Then,making \(\sigma _{t_1}=\sigma _{t_0}\)implies\(h_{S^{\prime },d^{\prime }}= h_{S,d}+(1-1/k)^{t_1-t_0-2} \ge h_{S,d}\). Otherwise, \(\sigma _{t_0}\) is requested againat index t 2 > t 1. In thiscase, by making \(\sigma _{t_1}=\sigma _{t_0}\), \(h_{S^{\prime },d^{\prime }}= h_{S,d}-(1-1/k)^{t_2-t_0-2}+(1-1/k)^{t_1-t_0-2}\). Since t 2 > t 1, \(h_{S^{\prime },d^{\prime }} \ge h_{S,d}\). Thus, the largestvalue of h S, d is obtained for S = {j + 1,…, 2j − 1}. We now fix S to be thisset and show that h S, d ismaximized when for all iS, a i = b i = ij − 1.

Let \(\vec {d_S}=\{ (a_i,b_i) \}_{i=1}^{|S|}\)be a configuration of reuse distances. We say that a configuration\(\vec {d_S}\) is valid if forall pairs i 1, i 2in\(\vec {d_S}\)with i 1i 2, \(a_{i_1}\ne a_{i_2}\) and\(b_{i_1} \ne b_{i_2}\). Sincein a sequence only one request can start and end at each index, any configuration built from reuse distances of a subset S of indices in an actual sequence is valid.

We now show that the maximum h S, d is attained when a i = b i = ij − 1for all iS,i.e., for \(\vec {d_S}=\{(0,0),(1,1),\ldots ,(j-2,j-2)\}\) and d i = 2i for i = 0,…, j − 2. In this case,we say that \(\vec {d_S}\) is a diagonal.

Suppose, to the contrary, that \(\vec {d_S}\) isa valid configuration that maximizes h S, d and is not a diagonal. Then, since \(\vec {d_S}\) isvalid, there must exist at least two pairs \((a_{i_1},b_{i_1})\) and \((a_{i_2},b_{i_2})\)in\(\vec {d_S}\)with\(a_{i_1}\ne b_{i_1}\) and\(a_{i_2}\ne b_{i_2}\) and,furthermore, \(a_{i_1} > a_{i_2}\) and \(b_{i_1} < b_{i_2}\).Let \(\vec {d^{\prime }_S}\)be a new configuration created by removing these two pairs from\(\vec {d_S}\) and addingthe pairs \((a_{i_1},b_{i_2})\) and\((a_{i_2},b_{i_1})\). It is easy to see that\(\vec {d^{\prime }_S}\) is also a valid configuration.In fact, \(\vec {d^{\prime }_S}\)corresponds toexchanging requests \(\sigma _{j+b_1}\) and \(\sigma _{j+b_2}\)in σ.

We show that \(h_{S,d^{\prime }}> h_{S,d}\).Let c = (1 − 1/k).Then \(h_{S,d^{\prime }}-h_{S,d}= c^{a_{i_2}+b_{i_1}}+c^{a_{i_1}+b_{i_2}}-(c^{a_{i_1}+b_{i_1}}+c^{a_{i_2}+b_{i_2}})\).Since c < 1, \(a_{i_1} > a_{i_2}\), and\(b_{i_1} < b_{i_2}\), then\(c^{a_{i_1}}<c^{a_{i_2}}\) and\(c^{b_{i_1}}>c^{b_{i_2}}\). Hence, \(c^{a_{i_2}}(c^{b_{i_1}}-c^{b_{i_2}})> c^{a_{i_1}}(c^{b_{i_1}}-c^{b_{i_2}}) \Rightarrow c^{a_{i_2}+b_{i_1}}-c^{a_{i_2}+b_{i_2}}> c^{a_{i_1}+b_{i_1}}-c^{a_{i_1}+b_{i_2}} \Rightarrow c^{a_{i_2}+b_{i_1}}+c^{a_{i_1}+b_{i_2}} > c^{a_{i_1}+b_{i_1}}+c^{a_{i_2}+b_{i_2}} \). Therefore, \(h_{S,d^{\prime }}> h_{S,d}\), andhence h S, d is not maximal. Since for a fixed set S there is a finite number of configurations\(\vec {d_S}\), the maximum of h S, d exists and it must beattained when \(\vec {d_S}\) is a diagonal.Then, for all S and d S , \(h_{S,d}\le {\sum }_{i=0}^{j-2}(1-1/k)^{2i} \le {\sum }_{i=0}^{\infty }(1-1/k)^{2i} = k^2/(2k-1)\).

We have shown an upper bound on the number of extra misses of EOA when σ is the result of an insertion of a new page p into σ.

It remains to argue that this is an upper bound when p is not a new page, or when the change is a substitution or deletion.

  • Insertion: We compare the expected number of misses to the case of σ considered above. First, suppose ρ is a sequence resulting from inserting ρ j = p in σ that had been requested before but not after. Let j < j be the largest index with \(\rho _{j^{\prime }}=p^{\prime }\).The miss probability of ρ j is 𝜖 < 1, whereas the miss probability of \(\sigma ^{\prime }_j\) is 1. Furthermore, the reuse distances of other pages are at least as large in σ as they are in ρ.Hence EOA(σ ) > EOA(ρ).Suppose now that the insertion is of a page that is requested later but not before. Let j > j be the smallest index such that \(\rho _{j^{\prime }}=\rho _j\).Then, the miss probability of both \(\sigma ^{\prime }_j\) and ρ j is 1 and the miss probability of \(\sigma _{j^{\prime }}\) is larger than that of \(\rho _{j^{\prime }}\).In addition, the reuse distance of other pages are at least as large in σ as they are in ρ.Thus, EOA(σ ) > EOA(ρ).Finally, suppose that ρ j is requested both before and after (at index j )and that the reuse distances of requests at j and j are d and d ,respectively. The expected number of misses of these requests is \(2-c^d-c^{d^{\prime }}\).On the other hand, the expected number of misses on these requests on σ is \(2-c^{d+d^{\prime }+1}\).Since c < 1, \(c^{d+d^{\prime }}\le c^d\), \(c^{d+d^{\prime }}\le c^{d^{\prime }}\),and thus \(c^{d+d^{\prime }+1}=c\cdot c^{d+d^{\prime }}\le c^d+c^{d^{\prime }}\).Hence, \(2-c^{d+d^{\prime }+1}\ge 2-c^d-c^{d^{\prime }}\),and since the expected number of misses on therest of the requests is equal for both sequences, EOA(σ ) > EOA(ρ).

  • Deletion: Let σ be the sequence resulting from deleting σ j from σ.We argue that EOA(σ ) ≤EOA(σ).Suppose that σ j is not requested later, then the reuse distances of pages in σ are at most those on σ,and EOA(σ)includes the non-zero miss probability of σ j ,which is not present in EOA(σ ).Hence, EOA(σ ) ≤EOA(σ).Suppose now that σ j is requested later in σ,but not earlier. Let j > j be the smallest index such that \(\sigma _{j^{\prime }}=\sigma _j\).Then the expected number of misses of these pages in σ is at least 1, while the probability of miss of σ j in σ is 1. Again, the reuse distance of other pages in σ are at least those in σ and thus EOA(σ ) ≤EOA(σ).Finally, assume that σ j is requested before and after in σ(at index j )and that the reuse distances of requests at j and j are d and d .The expected number of misses of these requests in σ is \(m(\sigma )=2-c^d-c^{d^{\prime }}\),while the expected number of misses of \(\sigma _{j^{\prime }}\)in σ is \(m(\sigma ^{\prime })=1-c^{d+d^{\prime }}\).We claim that m(σ ) ≤ m(σ).This is true if \(c^d+c^{d^{\prime }}\le 1+c^{d+d^{\prime }}\).Let b = d + d and let f(x) = c x + c bx,for 0 ≤ xb.It is easy to verify that f(x)is maximized at x = 0and x = b,and hence \(f(x)\le 1+c^{d+d^{\prime }}\).Once again, since the reuse distances of other pages in σ are at most those in σ,it holds that EOA(σ ) ≤EOA(σ).

  • Substitution: Since a substitution is a deletion followed by an insertion, and adeletion cannot increase the expected number of misses, the expected number of missesdue to a substitution cannot be larger than those created by an insertion.

Lower Bound For the lower bound we consider a sequence that realizes the analysis done above for the upperbound. Let ρ = x 1 x 2x m be a sequence of m requests, all to distinct pages, and let ρ be this sequencebut reversed. Let σ = (ρ ρ )δ and let σ = (ρ y 1 ρ )(ρ y 2 ρ )…(ρ y δ ρ ), where y 1,…, y δ are distinct pagesnot requested in ρ.Clearly, Δ(σ, σ ) = δ.Let d i be the reuse distance of the i-th page in each repetition of ρ in σ. Then, thisdistance in σ equals d i + 1. The reusedistances in ρ are equal in both sequences. Hence, the expected difference in number of misses in each repetition of ρ is given by (8)above with d i = 2i.Then, for the entire sequence we have:

$$\begin{array}{@{}rcl@{}} {\text{EOA}}(\sigma^{\prime})-{\text{EOA}}(\sigma)&=&\delta\left( 1+\frac{1}{k}\sum\limits_{i=0}^{m-1}\left( 1-\frac{1}{k}\right)^{2i}\right)=\delta\left( 1+\frac{k}{2k-1}\left( 1-\left( 1-\frac{1}{k}\right)^{2m}\right)\right) \end{array} $$

For any 𝜖 > 0, thereexists m such that \({\text {EOA}}(\sigma ^{\prime })-{\text {EOA}}(\sigma )>\delta (1+\frac {k}{2k-1}-\epsilon )\). □

Lemma 4 (Decomposition of Smoothed-LRU in terms of Step-LRU)

For all ages a ,

$$P(\textit{hit}_{\textsc{Smoothed}\text{-}LRU_{k,i}}(a)) = \frac{1}{2i+1}\left( 1\cdot P(\textit{hit}_{\textsc{Step}\text{-}\text{LRU}_{k,0}}(a)) + \sum\limits_{j=1}^{i} 2\cdot P(\textit{hit}_{\textsc{Step}\text{-}\text{LRU}_{k,j}}(a))\right). $$

Proof

We perform a case distinction on the age a:

  1. 1.

    For a < ki,all of the above summands are one and the equality holds.

  2. 2.

    For ak + i,all summands are zero and the equality holds as well.

  3. 3.

    For kia < k,we get

    $$\begin{array}{@{}rcl@{}} &&\frac{1}{2i+1}\left( 1\cdot P(\textit{hit}_{\textsc{Step}-\text{LRU}_{k,0}}(a)) + \sum\limits_{j=1}^i 2\cdot P(\textit{hit}_{\textsc{Step}-\text{LRU}_{k,j}}(a))\right)\\ &=& \frac{1}{2i+1}\left( 1 + \sum\limits_{j=1}^{k-a-1} 2\cdot 1 + \sum\limits_{j=k-a}^i 2\cdot \frac{1}{2}\right)\\ &=& \frac{1}{2i+1}\left( 1 + 2\cdot(k-a-1) + 1\cdot(i-(k-a)+1)\right)\\ &=& \frac{k+i-a}{2i+1} = P(\textit{hit}_{\textsc{Smoothed}-LRU_{k,i}}(a)) \end{array} $$
  4. 4.

    For ka < k + i,we get

    $$\begin{array}{@{}rcl@{}} &&\frac{1}{2i+1}\left( 1\cdot P(\textit{hit}_{\textsc{Step}-\text{LRU}_{k,0}}(a)) + \sum\limits_{j=1}^i 2\cdot P(\textit{hit}_{\textsc{Step}-\text{LRU}_{k,j}}(a))\right)\\ &=& \frac{1}{2i+1}\left( 1\cdot 0 + \sum\limits_{j=1}^{a-k} 2\cdot 0 + \sum\limits_{j=a-k+1}^i 2\cdot \frac{1}{2}\right)\\ &=& \frac{1}{2i+1}\left( 0 + 0 + 1\cdot(i-(a-k+1)+1)\right)\\ &=& \frac{k+i-a}{2i+1} = P(\textit{hit}_{\textsc{Smoothed}-LRU_{k,i}}(a)) \end{array} $$

Proposition 2 (Step-LRU as a mixed strategy)

There is a probability distribution \(d : {\mathcal A} \rightarrow \mathbb {R}\) over a finite set of deterministic paging algorithms \({\mathcal A}\) using a fast memory of size k , such that for all sequences σ ,

$$\textsc{Step}\text{-LRU}_{k,i}(\sigma) = \sum\limits_{A \in {\mathcal A}} d(A)\cdot A(\sigma). $$

Proof

Consider the following deterministic paging algorithm, called Det-Step-LRU,which is parameterized by k and i: Det-Step-LRU always caches the ki youngest pages. In addition, it caches i of the 2i pages whose ages are between ki and k + i − 1.

Upon a miss to a page of age ak + i, Det-Step-LRUreplaces the page of age k + i − 1if it is in the fast memory. Otherwise, it replaces the page of age ki − 1,which is guaranteed to be cached before the request. Upon a miss to a page of age a < k + i, Det-Step-LRUalways replaces the page of age ki − 1.

Instead of starting with an empty cache, the fast memory is initially filledwith k “dummy” pages, which may not be requested later on. The first ki of these “dummy” pages get assigned ages 0to ki − 1.A further parameter, D ⊆{ki,…, k + i − 1}with |D| = i,controls the assignment of ages to the remaining i “dummy” pages. We denote by Det-Step-LRU k, i, D the algorithm that arises when the dummy pages initially assume the ages specified in D.

We argue that Step-LRU k, i results from the uniform distribution over the set of deterministic algorithms \({\mathcal A} = \{\textsc {Det-Step}\text {-LRU}_{k,i,D} \mid D \subseteq \{k-i, \dots , k+i-1\}, |D|=i\}\):

$$\textsc{Step}\text{-LRU}_{k,i}(\sigma) = \sum\limits_{A \in {\mathcal A}} \frac{1}{{2i \choose i}}\cdot A(\sigma). $$

To see this, consider two arbitrary algorithms\(A_1, A_2 \in {\mathcal A}\) defined by D 1, D 2with D 1D 2.We claim that after processing an arbitrary sequence σ, the set of ages of cachedpages differ between A 1 and A 2. We prove this byinduction on the length of σ:Clearly this holds for |σ| = 0as D 1D 2.Assume the statement holds before a request. We perform a case distinction on the age a of the requested page:

  1. 1.

    If a < ki,both caches hit and the set of cached ages does not change in either of the two caches.

  2. 2.

    If ak + i,then both caches must miss. If one of the two caches stores age k + i − 1and the other does not, then one replaces the page with age ki − 1and the other does not. If neither of the caches stores age k + i − 1,then they both replace the page with age ki − 1,which they have in common. If they both store age k + i − 1,they also replace a common page.

  3. 3.

    If kia < k + i,there are three cases to consider:

    1. (a)

      Both caches hit: then there is no change in the set of cached pages.

    2. (b)

      Both caches miss: then both replace a common page, the page with age ki − 1.

    3. (c)

      If one cache misses and the other hits, then one replaces the page with age ki − 1and the other does not.

Initially, all of the \(2i \choose i\)algorithms in \(\mathcal {A}\) differ from each other regarding the set of ages of cached pages. Based on the reasoning above theycontinue to differ from each other after an arbitrary request sequence. As there are exactly\(2i \choose i\)possibilities ofchoosing i of the 2i pages with age ki to k + i − 1,each of the possibilities is covered by exactly one algorithm in\(\mathcal {A}\)at any point in time. Apage with age a between ki and k + i − 1iscontained in exactly half of these possibilities, and thus the hit probability is exactly\(\frac {1}{2}\)in the uniformdistribution over \(\mathcal {A}\). □

Theorem 17 (Smoothness of LRU-Random)

Let k = 2. LRU -Random is \((1,\frac {17}{6}\delta )\) -smooth.

Proof

Similar to the proof of the smoothness of Random (Theorem 13), we will look at the distances between cache state distributions.Recall that in order to prove an upper bound on the smoothness of Random,we defined a potential function based on the distance between two state distributions,which we defined as the minimum cost to transfer probability mass from one distributionto another. We showed that the distance between any two distributions D and D is an upper bound on the difference between the expected number of misses of RAND when serving the same sequence starting from D and D .

In the case of LRU-Random we use a similar argument, but we consider only the distances between singleton distributions(i.e., distributions with only one cache state) as well as distances between the distributionsthat result from one page request when the initial distribution consists of only onestate. We use these distances to bound the expected difference in number of misses of Random when starting from different cache states.

Recall the definition of the earth mover’s distance between distributions D and D , whichwe used in the proof of Theorem 13:

$$ {\Delta}(D, D^{\prime}) := \min_{\alpha} \sum\limits_{s\in D,s^{\prime} \in D^{\prime}} \alpha(s, s^{\prime})\cdot d(s,s^{\prime}) $$
(9)

In the equation above, α is a function denoting the amount of probability mass to be transferred from states in D to states in D , which satisfiesthat for all s, \({\sum }_{s^{\prime }} \alpha (s,s^{\prime })=p_s\) and for all s , \({\sum }_{s} \alpha (s,s^{\prime })=p_{s^{\prime }}\), where p s and\(p_{s^{\prime }}\)are the probabilityof states s and s in D and D ,respectively. d(⋅,⋅)is the cost to transfer mass between two states. In the proof of Theorem 13 we explicitly defined d(s, s )in terms of the number of common pages between cache states s and s . Inthis proof we do not give an explicit definition for this cost. Instead, we use concrete values for aset of cache states, as shown in Table 2.

Table 2 Distances between pairs of states

Let f p (s, s ) = [ps ] − [ps]be the difference between the number of faults incurred by LRU-Randomwhen accessing p withcache states s and s (thus f p (s, s ) ∈{−1, 0, 1})and let D p (s)be the resulting distribution when requesting p in state s. Then, all pairs of states s, s inTable 2 satisfy:

$$ d(s,s^{\prime}) \ge \max_p\{f_p(s,s^{\prime}) + {\Delta}(D_p(s),D_p(s^{\prime}))\}, $$
(10)

In Table 2 we show the least possible values for d(s, s )that satisfy (10) and (9). As (10) and (9) are monotone in d(s, s ), we could compute these values using a Kleene iteration starting from the bottom element d(s, s ) = 0for all pairs of cachestates s, s . As an example, weverify the entry for states s = [0 1]and s = [2 0](see Example 1).

Note that we only consider cache states that are full. See the discussionin the preamble of Theorem 13 for a justification. Also, we only consider pairsof states that have at least one page in common, as we do not need to know d(s, s )for other cases in the remainder of the proof. Under this restriction, every pair of states thathas at least one page in common is equal up to renaming to one of the cases in the table.

Example 1

For states s = [0 1]and s = [2 0], we verifythat f p (s, s ) + Δ(D p (s), D p (s )) ≤ 2 for eachrequest p ∈{0, 1, 2, 3}:

  • p = 0: Since 0 is a hit for both states f 0(s, s ) = 0 − 0 = 0.The resulting distributions are D 0([0 1]) = {[0 1]}and D 0([2 0]) = {[0 2]}.Then, Δ(D 0([0 1]), D 0([2 0])) = d([0 1], [0 2]) = 3/2as shown in Table 2. Hence, f 0(s, s ) + Δ(D 0(s), D 0(s )) = 3/2.

  • p = 1: Page 1 is a hit for s and a miss for s and thus f 1(s, s ) = 1 − 0 = 1.The resulting distributions are D 1([0 1]) = {[1 0]}and D 1([2 0]) = {[1 2]2/3, [1 0]1/3},where the subscript is the probability of each state (weomit the probability when it equals 1). To compute Δ(D 1([0 1]), D 1([2 0])),we make α([1 0], [1 0]) = 1/3and α([1 0], [1 2]) = 2/3.Hence, Δ(D 1([0 1]), D 1([2 0])) ≤ 1/3 ⋅ d([1 0], [1 0]) + 2/3 ⋅ d([1 0], [1 2]). d([1 0], [1 0]) = 0and d([1 0], [1 2]) = d([0 1], [0 2]) = 3/2by renaming pages and using the entry in the table. Thus, Δ(D 1([0 1]), D 1([2 0])) ≤ 1and f 1(s, s ) + Δ(D 1(s), D 1(s )) ≤ 2.

  • p = 2:Page 2 is a miss for s and a hit for s and thus f 2(s, s ) = 0 − 1 = −1.The resulting distributions are D 2([0 1]) = {[2 0]2/3, [2 1]1/3}and D 2([2 0]) = {[2 0]}.In Δ(D 2([0 1]), D 2([2 0])),we make α([2 0], [2 0]) = 2/3and α([2 1], [2 0]) = 1/3.Hence, Δ(D 2([0 1]), D 2([2 0])) ≤ 1/3 ⋅ d([2 1], [2 0]) + 2/3 ⋅ d([2 0], [2 0]). d([2 0], [2 0]) = 0and d([2 1], [2 0]) = d([0 1], [0 2]) = 3/2.Thus, Δ(D 2([0 1]), D 2([2 0])) ≤ 1/2and f 2(s, s ) + Δ(D 2(s), D 2(s )) ≤−1/2.

  • p = 3:Page 3 is a miss for both s and s and thus f 3(s, s ) = 1 − 1 = 0.The resulting distributions are D 3([0 1]) = {[3 0]2/3, [3 1]1/3}and D 3([2 0]) = {[3 2]2/3, [3 0]1/3}.In Δ(D 3([0 1]), D 3([2 0])),we can make α([3 0], [3 0]) = 1/3, α([3 0], [3 2]) = 1/3,and α([3 1], [3 2]) = 1/3.Hence, Δ(D 3([0 1]), D 3([2 0])) ≤ 1/3 ⋅ d([3 0], [3 0]) + 1/3 ⋅ d([3 0], [3 2]) + 1/3 ⋅ d([3 1], [3 2]). d([3 0], [3 0]) = 0,and d([3 0], [3 2]) = d([3 1], [3 2]) = d([0 1], [0 2]) = 3/2.Thus, Δ(D 3([0 1]), D 3([2 0])) ≤ 1and f 3(s, s ) + Δ(D 3(s), D 3(s )) ≤ 1.

We see then that for all possible requests p, f p (s, s ) + Δ(D p (s), D p (s ))is at most 2 and hence d([0 1], [2 0])in Table 2 satisfies (10) and (9).

Let LRUR D (σ) denote the expected number of faults of LRU-Random(σ) when starting from a probability state distribution D, and let {s} denote the singleton distribution with state s. Let \(m(\sigma ,s,s^{\prime })=\text {LRUR}_{\{s^{\prime }\}}(\sigma )-\text {LRUR}_{\{s\}}(\sigma )\), and let m(s, s ) = max σ m(σ, s, s ). We claim that for any pair of states s and s that satisfy Inequality (10), m(s, s ) ≤ d(s, s ).

We prove this by induction on the number of page requests n. Let n = 1 and let s and s be two states. Let m n(s, s ) be m(s, s ) restricted to sequences of length n. Then, m 1(s, s ) = max p{f p (s, s )} and since Δ(D, D ) ≥ 0 for any pair of distributions and d(s, s ) satisfies Inequality (10), then d(s, s ) ≥ m 1(s, s ). Now assume that the claim is true for sequences of length n. We prove that it holds for sequences of length n + 1. Let σ be a sequence of length n and let pσ be the concatenation of page p and σ. Then for a pair of states s and s ,

$$\begin{array}{@{}rcl@{}} m(p\cdot\sigma,s,s^{\prime}) & = & f_p(s,s^{\prime}) + {\text{LRUR}}_{D_p(s^{\prime})}(\sigma)-{\text{LRUR}}_{D_p(s)}(\sigma)\\ & = & f_p(s,s^{\prime}) + \sum\limits_{s_i^{\prime}\in D_p(s^{\prime})}{\text{LRUR}}_{\{s_i^{\prime}\}}(\sigma) \cdot w^{\prime}(s_i^{\prime})\\ &&-\sum\limits_{s_i\in D_p(s)}\text{LRUR}_{\{s_i\}}(\sigma) \cdot w(s_i) \end{array} $$
(11)

In the last equation, w(s i ) and \(w^{\prime }(s_i^{\prime })\) are the probabilities of state s i in D p (s) and state \(s_i^{\prime }\) in D p (s ). We rewrite (11) by pairing states in both distributions and assigning a weight \(\alpha (s_i,s_j^{\prime })\) to each pair \((s_i,s_j^{\prime })\) that satisfies \(\forall s_i\in D_p(s), w(s_i) = {\sum }_{s_j^{\prime }\in D_p(s^{\prime })} \alpha (s_i,s_j^{\prime })\) and \(\forall s_j^{\prime }\in D_p(s^{\prime }), w^{\prime }(s_j^{\prime }) = {\sum }_{s_i\in D_p(s)} \alpha (s_i,s_j^{\prime })\):

$$\begin{array}{@{}rcl@{}} m(p\cdot\sigma,s,s^{\prime}) & = & f_p(s,s^{\prime}) + \sum\limits_{s_i\in D_p(s), s_j^{\prime}\in D_p(s^{\prime})}(\text{LRUR}_{\{s_j^{\prime}\}}(\sigma)\\ &&-\text{LRUR}_{\{s_i\}}(\sigma))\cdot\alpha(s_i,s_j^{\prime})\\ & \le & f_p(s,s^{\prime}) + \sum\limits_{s_i\in D_p(s), s_j^{\prime}\in D_p(s^{\prime})}m^n(s_i,s_j^{\prime})\cdot\alpha(s_i,s_j^{\prime}) \end{array} $$

Above, α defines a transfer of mass from distribution D p (s) to D p (s ). We pick α to be the minimum cost transfer of mass when the cost of transferring mass between states s i and \(s_j^{\prime }\) is \(d(s_i,s_j^{\prime })\). Since by the inductive hypothesis \(m^n(s_i,s_j^{\prime }) \le d(s_i,s_j^{\prime })\), we have

$$\begin{array}{@{}rcl@{}} m(p\cdot\sigma,s,s^{\prime}) & \le & f_p(s,s^{\prime}) + \sum\limits_{s_i\in D_p(s), s_j^{\prime}\in D_p(s^{\prime})}d(s_i,s_j^{\prime})\cdot\alpha(s_i,s_j^{\prime})\\ & = & f_p(s,s^{\prime}) + {\Delta}(D_p(s),D_p(s^{\prime})) \end{array} $$

Therefore, m n+1(s, s ) ≤ max p{f p (s, s ) + Δ(D p (s), D p (s ))}≤ d(s, s ), which proves the claim.

Now we are almost ready to prove the theorem. We will consider a pair of initial states and will show an upper bound on the expected difference between the number of misses that can be reached after an insertion, deletion, or substitution. Let \(m_{p,q}(s,s^{\prime }) = \max _{\sigma }\{\text {LRUR}_{\{s^{\prime }\}}(q\cdot \sigma )-\text {LRUR}_{\{s\}}(p\cdot \sigma )\}\). Let m p (s, s ) = m p, p (s, s ) and let m(s, s ) = m ⊥,⊥(s, s ), where ⊥ is an empty request.

In the following, we will make use of the following inequality:

$$\begin{array}{@{}rcl@{}} m_{p,q}(s, s^{\prime}) \leq [q \not\in s^{\prime}] - [p \not\in s] + \sum\limits_{s_i \in D_p(s), s_j^{\prime} \in D_q(s^{\prime})} \alpha(s_i, s_j^{\prime}) \cdot m(s_i, s_j^{\prime}), \end{array} $$
(12)

where α is any transfer of mass between distributions D p (s) and D q (s ), i.e. α satisfies \(\forall s_i\in D_p(s), w(s_i) = {\sum }_{s_j^{\prime }\in D_p(s^{\prime })} \alpha (s_i,s_j^{\prime })\) and \(\forall s_j^{\prime }\in D_q(s^{\prime }), w^{\prime }(s_j^{\prime }) = {\sum }_{s_i\in D_p(s)} \alpha (s_i,s_j^{\prime })\), where w(s i ) and \(w^{\prime }(s_j^{\prime })\) are the probabilities of state s i in D p (s) and state \(s_j^{\prime }\) in D p (s ). We prove the above inequality as follows:

$$\begin{array}{@{}rcl@{}} m_{p,q}(s, s^{\prime}) & = & \max_{\sigma}\{{\text{LRUR}}_{\{s^{\prime}\}}(q\cdot\sigma)-{\text{LRUR}}_{\{s\}}(p\cdot\sigma)\}\\ & = & [q \not\in s^{\prime}] - [p \not\in s] + \max_{\sigma} \{\text{LRUR}_{D_q(s^{\prime})}(\sigma)-\text{LRUR}_{D_p(s)}(\sigma)\}\\ & = & [q \not\in s^{\prime}] - [p \not\in s] + \max_{\sigma} \{\sum\limits_{s_j^{\prime}\in D_q(s^{\prime})}{\text{LRUR}}_{\{s_j^{\prime}\}}(\sigma) \cdot w^{\prime}(s_j^{\prime})\\ &&-\sum\limits_{s_i\in D_p(s)}\text{LRUR}_{\{s_i\}}(\sigma) \cdot w(s_i)\}\\ & = & [q \not\in s^{\prime}] - [p \not\in s] + \max_{\sigma} \{\sum\limits_{s_i\in D_p(s), s_j^{\prime}\in D_p(s^{\prime})}(\text{LRUR}_{\{s_j^{\prime}\}}(\sigma)\\ &&-\text{LRUR}_{\{s_i\}}(\sigma))\cdot\alpha(s_i,s_j^{\prime})\}\\ & \leq & [q \not\in s^{\prime}] - [p \not\in s] + \sum\limits_{s_i\in D_p(s), s_j^{\prime}\in D_p(s^{\prime})} \max_{\sigma}\{ {\text{LRUR}}_{\{s_j^{\prime}\}}(\sigma)\\ &&-{\text{LRUR}}_{\{s_i\}}(\sigma)\}\cdot\alpha(s_i,s_j^{\prime})\\ & = & [q \not\in s^{\prime}] - [p \not\in s] + \max_{\sigma} \{\sum\limits_{s_i\in D_p(s), s_j^{\prime}\in D_p(s^{\prime})}m(s_i, s_j^{\prime})\cdot\alpha(s_i,s_j^{\prime})\} \end{array} $$

Inequality (12) allows us to bound m p, q (s, s ) by determining the distributions D p (s) and D q (s ), which result after accessing p and q, respectively, and picking a “good” transfer of mass α between these two distributions, i.e., an α that minimizes the upper bound on m p, q (s, s ). Intuitively, a good α will match up similar states in D p (s) and D q (s ).

We will now prove that m p, q (s, s) ≤ 17/6, which implies the theorem. If p = q, m p, q (s, s) = 0. Assume pq. Let ⊥ be an empty request. We consider the insertion (p = ⊥), deletion (q = ⊥), and substitution cases, and all possible non-redundant requests p, q. Let s = [0 1] be a cache state, where the left page is the most-recently-used one. For some pairs of initial states, when the distance between states shown in Table 2 is a good enough upper bound on the expected number of misses we use that value.

In each of the inequalities below we apply (12). In most cases, either D p (s) or D q (s ) is a singleton distribution. In those cases, there is only one possible transfer of mass α between the two distributions. The exceptions to this rule are the cases, where both p and q result in misses in s and s , respectively. Then, both D p (s) and D q (s ) contain two elements and different transfers of mass α are possible.

  • Insertion:

    1. 1.

      m ⊥,1([0 1], [0 1]) = m([0 1], [1 0]) ≤ 1/2

    2. 2.

      \(m_{\bot ,2}([0\ 1],[0\ 1]) \le 1 + \max _p\{\frac {2}{3}m_p([0\ 1],[2\ 0]) +\frac {1}{3}m_p([0\ 1],[2\ 1])\}\).

      Let p ∈{0, 1, 2, 3}. We compute m p ([0 1], [2 0]):

      1. (a)

        \(m_0([0\ 1],[2\ 0]) \le 0+ m([0\ 1],[0\ 2]) \leq \frac {3}{2}\)

      2. (b)

        \(m_1([0\ 1],[2\ 0]) \le 1+ \frac {2}{3}m([1\ 0],[1\ 2]) +\frac {1}{3}m([1\ 0],[1\ 0]) \le 1+ \frac {2}{3}\cdot \frac {3}{2}+0 = 2\)

      3. (c)

        \(m_2([0\ 1],[2\ 0]) \le -1+ \frac {2}{3}m([2\ 0],[2\ 0]) +\frac {1}{3}m([2\ 1],[2\ 0]) \le -1+ 0+ \frac {1}{3}\cdot \frac {3}{2} = -\frac {1}{2}\)

      4. (d)

        \(m_3([0\ 1],[2\ 0]) \le 0+ \frac {1}{3}m([3\ 0],[3\ 0]) +\frac {1}{3}m([3\ 1],[3\ 2])+\frac {1}{3}m([3\ 1],[3\ 2]) \le 0+ \frac {1}{3}\cdot \frac {3}{2}+\frac {1}{3}\cdot \frac {3}{2} = 1\)

      Case (d) above is the first one, where different transfers of mass α are possible, as both D 3([0 1]) and D 3([2 0]) are non-singleton. We have [3 1], [3 0] ∈ D 3([0 1]) with w([3 1]) = 1/3 and w([3 0]) = 2/3 and [3 0], [3 2] ∈ D 3([2 0]) with w ([3 0]) = 1/3 and w ([3 2]) = 2/3. Picking α([3 0], [3 0]) = 1/3, α([3 0], [3 2]) = 1/3, and α([3 1], [3 2]) = 1/3 results in the above inequality.

      We compute m p ([0 1], [2 1]):

      1. (a)

        \(m_0([0\ 1],[2\ 1]) \le 1+ \frac {2}{3}m([0\ 1],[0\ 2]) +\frac {1}{3}m([0\ 1],[0\ 1]) \le 1+ \frac {2}{3}\cdot \frac {3}{2}+0 = 2\)

      2. (b)

        \(m_1([0\ 1],[2\ 1]) \le 0+ m([1\ 0],[1\ 2]) = \frac {3}{2}\)

      3. (c)

        \(m_2([0\ 1],[2\ 1]) \le -1+ \frac {2}{3}m([2\ 0],[2\ 1]) +\frac {1}{3}m([2\ 1],[2\ 1]) \le -1+ \frac {2}{3}\cdot \frac {3}{2}+0 = 0\)

      4. (d)

        \(m_3([0\ 1],[2\ 1]) \le 0+ \frac {2}{3}m([3\ 0],[3\ 2]) +\frac {1}{3}m([3\ 1],[3\ 1]) \le \frac {2}{3}\cdot \frac {3}{2}+0 = 1\)

      Again case (d) is the only case where different transfers of mass are possible, and we pick the one that yields the best bound.

      Plugging in the results in m ⊥,2([0 1], [0 1]) we obtain: \(m_{\bot ,2}([0\ 1],[0\ 1])\le 1 + \frac {2}{3}m_1([0\ 1],[2\ 0]) +\frac {1}{3}m_1([0\ 1],[2\ 1])=\frac {17}{6}\)

  • Deletion:

    1. 1.

      m 1,⊥([0 1], [0 1]) = m([1 0], [0 1]) ≤ 1/2

    2. 2.

      \(m_{2,\bot }([0\ 1],[0\ 1]) \le -1 + \frac {2}{3}m([2\ 0],[0\ 1]) +\frac {1}{3}m([2\ 1],[0\ 1])=-1 +\frac {2}{3}\cdot \frac {3}{2} + \frac {1}{3}\cdot 2 = \frac {2}{3}\)

  • Substitution:

    1. 1.

      m 0,1([0 1], [0 1]) = m ⊥,1([0 1], [0 1]) ≤ 1/2

    2. 2.

      m 0,2([0 1], [0 1]) = m ⊥,2([0 1], [0 1]) ≤ 17/6

    3. 3.

      m 1,0([0 1], [0 1]) = m 1,⊥([0 1], [0 1]) ≤ 1/2

    4. 4.

      \(m_{1,2}([0\ 1],[0\ 1]) \le 1 + \max _p\{\frac {2}{3}m_p([1\ 0],[2\ 0]) +\frac {1}{3}m_p([1\ 0],[2\ 1])\}\).

      Let p ∈{0, 1, 2, 3}. We compute m p ([1 0], [2 0]):

      1. (a)

        \(m_0([1\ 0],[2\ 0]) \le \frac {3}{2}\) (equivalent to m 1([0 1], [2 1]) in Insertion)

      2. (b)

        m 1([1 0], [2 0]) ≤ 2 (equivalent to m 0([0 1], [2 1]) in Insertion)

      3. (c)

        m 2([1 0], [2 0]) ≤ 0 (equivalent to m 2([0 1], [2 1]) in Insertion)

      4. (d)

        m 3([1 0], [2 0]) ≤ 1 (equivalent to m 3([0 1], [2 1]) in Insertion)

      We compute m p ([1 0], [2 1]):

      1. (a)

        m 0([1 0], [2 1]) ≤ 2 (equivalent to m 1([0 1], [2 0]) in Insertion)

      2. (b)

        \(m_1([1\ 0],[2\ 1]) \le \frac {3}{2}\) (equivalent to m 0([0 1], [2 0]) in Insertion)

      3. (c)

        \(m_2([1\ 0],[2\ 1]) \le -\frac {1}{2}\) (equivalent to m 2([0 1], [2 0]) in Insertion)

      4. (d)

        m 3([1 0], [2 1]) ≤ 1 (equivalent to m 3([0 1], [2 0]) in Insertion)

      Therefore, \(m_{1,2}([0\ 1],[0\ 1]) \le 1 + \frac {2}{3}m_1([1\ 0],[2\ 0]) +\frac {1}{3}m_1([1\ 0],[2\ 1])=\frac {17}{6}\).

    5. 5.

      \(m_{2,0}([0\ 1],[0\ 1]) = m_{2,\bot }([0\ 1],[0\ 1]) \leq \frac {2}{3}\)

    6. 6.

      \(m_{2,1}([0\ 1],[0\ 1]) = m_{2,\bot }([0\ 1],[0\ 1]) + m_{\bot ,1}([0\ 1],[0\ 1]) \le \frac {2}{3} +\frac {1}{2} = \frac {7}{6}\)

    7. 7.

      \(m_{2,3}([0\ 1],[0\ 1]) \le 0 + \frac {2}{3}m([2\ 0],[3\ 0]) +\frac {1}{3}m([2\ 1],[3\ 1])=\frac {2}{3}\cdot 2 + \frac {1}{3}\cdot 2 = 2\)

      From the substitution cases, case 7 is the most interesting: The accesses to 2 and 3 both result in misses. Inequality (12) allows us to match up the cases where the same page is replaced.

The maximum of all the upper bounds derived above is 17/6 and hence

$$\text{LRU-}\textsc{Random}(\sigma^{\prime})-\text{LRU-}\textsc{Random}(\sigma)\le 17/6=2.8\bar{3}$$

for any σ and σ with Δ(σ, σ ) = 1. Corollary 1 implies the theorem. □

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Reineke, J., Salinger, A. On the Smoothness of Paging Algorithms. Theory Comput Syst 62, 366–418 (2018). https://doi.org/10.1007/s00224-017-9813-6

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00224-017-9813-6

Keywords

Navigation