Randomized ski rental: the ratio 1 / (1 - (1 - 1/B)^B) ≤ e/(e-1), tight #
This file determines the best expected competitive ratio of randomized online strategies for the
discrete ski-rental problem SkiRental.problem B (integer purchase price B ≥ 1, one request per
ski day) against an oblivious adversary, in the model of
CslibFrontier.DataStructure.Online.Randomized. The ratio is
randomizedRatio B = 1 / (1 - (1 - 1/B)^B) = B^B / (B^B - (B-1)^B)
(randomizedRatio_eq),
for example 4/3 for B = 2 and 27/19 for B = 3. It is at most and tends to
e/(e-1) ≈ 1.582 (randomizedRatio_le, tendsto_randomizedRatio; monotonicity in B is not
proved), and it is below the deterministic 2 - 1/B of
CslibFrontier.DataStructure.Online.SkiRental
for every B ≥ 2 (randomizedRatio_lt_two_sub).
Upper bound. The strategy randomRentThenBuy B rents for t ∈ {0, …, B-1} days and buys on
day t + 1, choosing t with probability proportional to
buyWeight B t = (B-1)^(B-1-t) * B^t = B^(B-1) * (1 - 1/B)^(B-1-t) (buyWeight_eq), i.e. it buys
on day i with probability proportional to (1 - 1/B)^(B-i). Its expected cost on n ski days is
exactly randomizedRatio B * min n B (expectedCost_randomRentThenBuy), so it is
randomizedRatio B-competitive with no additive constant (randomRentThenBuy_isCompetitive), hence
e/(e-1)-competitive (randomRentThenBuy_isCompetitive_exp). This equalizing strategy is due to
Karlin, Manasse, McGeoch, and Owicki, Competitive randomized algorithms for nonuniform
problems; see also the textbook treatment of rent-or-buy in
Borodin and El-Yaniv, Online Computation and Competitive Analysis.
Lower bound. Every randomized strategy has a request sequence with OPT ≥ 1 and
randomizedRatio B * OPT ≤ E[ALG] (exists_randomized_witness), so no randomized strategy is
(c, 0)-competitive for any c < randomizedRatio B (not_isCompetitive_of_lt). The proof is the
easy direction of Yao's principle (RandStrategy.exists_le_mul_expectedCost) with the adversary
distribution adversary B: ski k + 1 days with weight (B-1)^k * B^(B-2-k) for k < B - 1, and
2B - 1 days with weight (B-1)^(B-1). Against it every deterministic strategy, which on these
lengths behaves like a rent-then-buy strategy (SkiRental.exists_rentThenBuy_cost_eq), has mean
cost at least randomizedRatio B times the mean optimum (le_sum_advWeight_mul_cost,
sum_advWeight_mul_min).
For any fixed B, ratios are stated with additive constant 0: the deterministic break-even
strategy is already (1, B - 1)-competitive (breakEven_isCompetitive_one), so for fixed B an
additive constant trivializes the ratio. Asymptotically as B → ∞, however, any fixed finite
additive constant b is negligible: for every c < e/(e-1) and finite b, once B is
sufficiently large, no randomized strategy is (c, b)-competitive
(not_isCompetitive_eventually_of_lt).
Continuous-time randomized ski rental (with exact competitive ratio e/(e-1) for every purchase
price B > 0) is in CslibFrontier.DataStructure.Online.SkiRental.Continuous.
Main definitions #
SkiRental.randomizedRatio:1 / (1 - (1 - 1/B)^B).SkiRental.buyWeight,SkiRental.rentDays,SkiRental.randomRentThenBuy: the equalizing randomized strategy.SkiRental.advDays,SkiRental.advWeight,SkiRental.adversary: the matching oblivious adversary distribution.
Main results #
randomizedRatio_eq,randomizedRatio_le,tendsto_randomizedRatio,randomizedRatio_lt_two_sub: the ratio isB^B / (B^B - (B-1)^B) ≤ e/(e-1), tends toe/(e-1), and beats2 - 1/B.expectedCost_randomRentThenBuy,randomRentThenBuy_isCompetitive,randomRentThenBuy_isCompetitive_exp: the upper bound.exists_randomized_witness,not_isCompetitive_of_lt,not_isCompetitive_eventually_of_lt: the matching lower bound for fixedB(without additive constant) and asymptotically asB → ∞(with any fixed finite additive constant).
References #
The ratio #
The optimal randomized competitive ratio for discrete ski rental with purchase price B:
1 / (1 - (1 - 1/B)^B).
randomizedRatio B = B^B / (B^B - (B-1)^B); for instance 4/3 at B = 2.
randomizedRatio B as an extended real is the ratio of the natural numbers B^B and
B^B - (B-1)^B.
randomizedRatio B ≤ e/(e-1), from (1 - 1/B)^B ≤ e⁻¹.
randomizedRatio B → e/(e-1) as B → ∞, from (1 - 1/B)^B → e⁻¹.
For B ≥ 2 randomization helps: randomizedRatio B < 2 - 1/B, the optimal deterministic
ratio (SkiRental.breakEven_mul_cost_le, SkiRental.exists_ratio_violation_of_lt).
Arithmetic of the two distributions #
Writing B = m + 1, these identities are the finite geometric sums behind the equalizing
strategy and the equalizing adversary.
The equalizing randomized strategy #
Unnormalized probability that the equalizing strategy rents for t < B days and buys on day
t + 1: (B-1)^(B-1-t) * B^t.
The equalizing randomized ski-rental strategy of [KMMcGO94]: draw the
number of rented days t from rentDays B, then rent for t days and buy on day t + 1.
Exact expected cost of the equalizing strategy. On n ski days randomRentThenBuy B
pays randomizedRatio B * min n B in expectation, i.e. exactly randomizedRatio B times the
offline optimum.
Upper bound [KMMcGO94]: against every valid offline schedule, the
expected cost of randomRentThenBuy B is at most randomizedRatio B times the schedule's cost.
randomRentThenBuy B is randomizedRatio B-competitive against an oblivious adversary, with
no additive constant.
randomRentThenBuy B is e/(e-1)-competitive against an oblivious adversary, for every
purchase price B ≥ 1.
The matching lower bound #
Every deterministic strategy pays at least B^B against the weighted adversary, i.e. at
least randomizedRatio B times the weighted optimum B^B - (B-1)^B.
Lower bound. Every randomized ski-rental strategy μ has, against an oblivious adversary,
a request sequence and a valid offline schedule with OPT ≥ 1 and
randomizedRatio B * OPT ≤ E_μ[ALG]. At B = 0 the ratio is 0 and one rented day is a
witness.
No randomized ski-rental strategy is (c, 0)-competitive against an oblivious adversary for
any c < randomizedRatio B; with randomRentThenBuy_isCompetitive, randomizedRatio B is the
optimal randomized ratio.
Asymptotic randomized lower bound with additive constant ([KMMcGO94];
[BElY98]): for every competitive ratio c < e/(e-1) and every finite additive
constant b, once the purchase price B is sufficiently large, no randomized ski-rental strategy
is (c, b)-competitive against an oblivious adversary.