Motivation
An online algorithm must commit to decisions before it knows the rest of its input, and it is judged by competitive analysis: the ratio between its cost and the cost of an optimal solution computed with full knowledge of the input. A recurring obstacle in this area is that each problem seems to need its own ad hoc potential-function argument. Buchbinder's thesis develops a single method that replaces those arguments — formulate the offline problem as a covering linear program, let the online algorithm raise the dual variables of its packing dual, and read the competitive ratio off the ratio between the primal and dual increments. The same recipe then yields algorithms for online set cover, weighted caching, ad-auction revenue, routing, and load balancing.
This mission formalizes the chapter where the method is introduced on its smallest example, the ski-rental problem. A customer needs skis for an unknown number of days: renting costs 1 per day and buying costs B once. The customer must decide, each morning, whether to rent again or buy, without knowing how many ski days remain. Despite its size the problem is the canonical rent-or-buy dilemma, and it has two classical tight results: a deterministic 2-competitive algorithm, and a randomized algorithm whose competitive ratio tends to e/(e−1), due to Karlin, Manasse, McGeoch and Owicki (1994). The primal-dual derivation of both is the content of Chapter 3.
Setting
An instance is a pair (B,k): the purchase price B, a positive integer, and the number k≥0 of ski days, which the online algorithm does not know. An offline solution either buys at once, paying B, or rents on every day, paying k; so the offline optimum is
OPT(B,k)=min(B,k).
Chapter 3 casts this as a linear program (Figure 3.1, p. 18). The primal is a covering program with one buy variable x and one rent variable zj per day j:
minimize Bx+j=1∑kzjsubject tox+zj≥1 for each day j.
Its dual is a packing program with one variable yj per day:
maximize j=1∑kyjsubject toj=1∑kyj≤B,0≤yj≤1.
The online structure enters in a single way: a new ski day appends a new covering constraint to the primal and a new variable to the dual, and previously raised primal variables may never be decreased. That monotonicity is what "previous decisions cannot be regretted" means formally.
The fractional primal-dual algorithm maintains x, initially 0. On each new day, while x<1 it sets zj←1−x, then raises
x←x(1+B1)+cB1,
and sets yj←1; once x has reached 1 it does nothing further. The free parameter c is then pinned to the value that makes x reach exactly 1 after B days,
c=(1+B1)B−1.
Formalization targets
Goal — the fractional algorithm's competitive ratio at finite B
Bxk+j=0∑k−1zj≤(1+(1+B1)B−11)⋅min(B,k)for every B≥1, k≥0.
The coefficient is the exact finite-B ratio 1+1/c, left in closed form rather than replaced by a constant. This is deliberate: (1+B1)B increases to e, so c<e−1 and therefore 1+1/c>e/(e−1) for every finite B. A goal asserting e/(e−1)-competitiveness at finite B would be false, and a goal asserting some rounded constant would be invalidated by any sharpening. The closed-form coefficient is the weakest statement that is stable under improvement.
Asymptotic companion — where e/(e−1) actually lives
B→∞lim(1+(1+B1)B−11)=e−1e≈1.5819767.
The classical constant is recorded here, as a limit of the coefficient sequence, and nowhere else.
Parallel target — the deterministic algorithm
detCost(B,k)≤2⋅min(B,k),detCost(B,k)={k2Bk<Bk≥B
Chapter 3's other result, independent of the fractional development.
Significance
The ski-rental bounds themselves are classical and tight, and nothing here is mathematically open. What the chapter contributes, and what this mission captures, is the derivation: it is the template instantiated by every later chapter of the thesis, so the artifacts built here — a covering/packing LP pair, its weak-duality instance, a monotone online variable with a closed-form growth law, and the primal-to-dual increment ratio as the source of the competitive factor — are the vocabulary in which the rest of the series will be stated.
On status: the mathematics is proved, published, and standard. It is not, to the best of a search of Mathlib at revision 0df444a, formalized — that revision contains no competitive-analysis or online-algorithm framework, no ski-rental development, and no general linear-programming weak-duality theorem. So the work this mission asks for is formalization of a known proof, not new mathematics, and the reusable output is infrastructure that does not currently exist in the library.
Difficulty
The offline problem is trivial, and a newcomer's first move — prove min(B,k) is the optimum and stop — solves the wrong problem. The content is entirely in the online constraint. Three specific places where the obvious argument stalls:
The optimum is never observed. The algorithm's cost must be compared against min(B,k) without k being available to it. The comparison is routed through the dual instead: the dual objective the algorithm accumulates is a lower bound on every feasible primal solution, hence on the optimum, and the algorithm's own primal cost is a fixed multiple of that dual objective.
The growth law is piecewise. The update fires only while x<1. Summing the per-day increments therefore does not telescope uniformly: days before x reaches 1 contribute 1+1/c each and later days contribute nothing, and the index at which the switch happens is exactly B — which is a theorem about the recurrence, not an assumption.
The constant is forced, not chosen. c=(1+1/B)B−1 is not a free tuning parameter; it is the unique value for which the geometric sequence xj=((1+1/B)j−1)/c hits 1 at j=B, which is in turn what makes the dual solution feasible (∑jyj≤B). Dual feasibility and the choice of c are the same fact.
Formalization scope
Conventions this development commits to. The purchase price is a natural number B with 0<B, because Chapter 3 uses B simultaneously as a price, as a day index ("buy skis on the Bth day"), and as the exponent in (1+1/B)B; costs are real numbers, with B and k coerced. Days are indexed from 0, so day j+1 of the prose is index j, and Fin k indexes the k days. Real division is total, so 1/0=0; the hypothesis 0<B is what keeps every reciprocal in the development genuine, and without it c would evaluate to 0 and the recurrence would collapse to the constant zero sequence. The algorithm's x < 1 guard is part of the formalized definition, not an informal aside: without it the cost would keep growing past day B.
A documented discrepancy in the source. The prose on p. 17 relaxes the integer program by letting x and each zj range over [0,1]; Figure 3.1 on p. 18 prints only x≥0, zj≥0. This mission takes the prose version, 0≤x≤1 and 0≤zj≤1, as the canonical fractional program, and also records the nonnegativity-only region exactly as printed. Two separate theorems establish that both have least value min(B,k), so the discrepancy is resolved inside the mission rather than silently chosen. Solvers should note which of the two predicates a given statement uses.
Ruling out a trivializing formalization. The offline optimum is defined independently, as min(B,k), and is not derived from the algorithm's own behaviour; a separate theorem certifies that this value really is the least attainable objective value of the canonical program, so the goal cannot be satisfied by redefining the benchmark. The goal inequality is also tight — both sides are equal to (1+1/c) times the number of days on which x<1 — so it cannot be weakened into vacuity without becoming false.
Infrastructure, and what is reusable. The development needs only Mathlib big operators over Fin k, basic real analysis for the limit, and IsLeast. Two items are explicitly infrastructure rather than ski-rental content: the specialized weak-duality theorem for this covering/packing pair, and the Figure 3.1 optimum. Both are candidates for generalization by the later mission on Chapter 2's general linear-programming duality, and a solver who proves the general form there should expect this instance to be derivable from it rather than duplicated.
Out of scope here. The final paragraph of p. 19 rounds the fractional solution into a randomized algorithm by sampling a threshold α∈[0,1] uniformly and buying on the day whose increment of x contains α. That step needs a probability space and an expectation argument, and is deferred to the immediate follow-up mission, Primal-Dual Online Algorithms II: Randomized Rounding for Ski Rental. Contributions here should not anticipate it.
Selected references
- Niv Buchbinder, Designing Competitive Online Algorithms via a Primal-Dual Approach, PhD thesis, Tel Aviv University, 2008. Chapter 3, pp. 17–19. https://www.tau.ac.il/~nivb/download/phd-thsis.pdf
- Niv Buchbinder and Joseph (Seffi) Naor, The Design of Competitive Online Algorithms via a Primal-Dual Approach, Foundations and Trends in Theoretical Computer Science 3(2–3), 2009. https://doi.org/10.1561/0400000024
- Anna R. Karlin, Mark S. Manasse, Lyle A. McGeoch and Susan Owicki, Competitive randomized algorithms for nonuniform problems, Algorithmica 11(6), 1994, 542–571. https://doi.org/10.1007/BF01294260
- Allan Borodin and Ran El-Yaniv, Online Computation and Competitive Analysis, Cambridge University Press, 1998.