Rent, Lease or Buy: Randomized Algorithms for …rawitzd/Talks/ski-talk.pdfRent, Lease or Buy 1 / 24...
Transcript of Rent, Lease or Buy: Randomized Algorithms for …rawitzd/Talks/ski-talk.pdfRent, Lease or Buy 1 / 24...
Rent, Lease or Buy 1 / 24
Rent, Lease or Buy:
Randomized Algorithms for Multislope Ski Rental
Zvi LotkerBen-Gurion University
Boaz Patt-Shamir Dror RawitzTel Aviv University
Rent or Buy Dilemma
⊲ Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 2 / 24
Sleeping Baby Problem:
� You finally managed to put baby to sleep
Rent or Buy Dilemma
⊲ Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 2 / 24
Sleeping Baby Problem:
� You finally managed to put baby to sleep
� Baby will wake up at some unknown timein the future
Rent or Buy Dilemma
⊲ Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 2 / 24
Sleeping Baby Problem:
� You finally managed to put baby to sleep
� Baby will wake up at some unknown timein the future
� Should parent stay awake or go to sleep?When should the parent go to sleep?
– Going to sleep −→ fixed effort– Staying awake −→ effort per time unit
Rent or Buy Dilemma
⊲ Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 3 / 24
Question:How do we measurethe quality of our solution?
Rent or Buy Dilemma
⊲ Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 3 / 24
Question:How do we measurethe quality of our solution?
Competitive Analysis:
� Worst case analysis:Baby tries to make parent’s lifeas hard as possible
Rent or Buy Dilemma
⊲ Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 3 / 24
Question:How do we measurethe quality of our solution?
Competitive Analysis:
� Worst case analysis:Baby tries to make parent’s lifeas hard as possible
� Our solution is comparedto best solution whenfuture is known in advance
Ski Rental
Rent or Buy
⊲ Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 4 / 24
Discrete Version:
� Ski Rental Problem:
– Vacation at ski resort– End of vacation is unknown– Cost of skis is ¤B, rent is ¤1/day– Should we rent or buy the skis?– When should we buy?
Ski Rental
Rent or Buy
⊲ Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 4 / 24
Discrete Version:
� Ski Rental Problem:
– Vacation at ski resort– End of vacation is unknown– Cost of skis is ¤B, rent is ¤1/day– Should we rent or buy the skis?– When should we buy?
� Optimal Offline Cost:
– Rent, if vacation isshorter than B days
– Buy at t = 0, otherwise
timeB
cost
B
Ski Rental
Rent or Buy
⊲ Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 5 / 24
Optimal Online Strategies:
� 2-competitive deterministic strategy[Karlin et al. 88]
– Buy after B days timeB
cost
B
Ski Rental
Rent or Buy
⊲ Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 5 / 24
Optimal Online Strategies:
� 2-competitive deterministic strategy[Karlin et al. 88]
– Buy after B days timeB
cost
B
�e
e−1 -competitive randomized strategy [Karlin et al. 94]
– Buy at time t ≤ B chosenaccording to some distribution
Ski Rental
Rent or Buy
⊲ Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 5 / 24
Optimal Online Strategies:
� 2-competitive deterministic strategy[Karlin et al. 88]
– Buy after B days timeB
cost
B
�e
e−1 -competitive randomized strategy [Karlin et al. 94]
– Buy at time t ≤ B chosenaccording to some distribution
– Oblivious adversary
Ski Rental
Rent or Buy
⊲ Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 5 / 24
Optimal Online Strategies:
� 2-competitive deterministic strategy[Karlin et al. 88]
– Buy after B days timeB
cost
B
�e
e−1 -competitive randomized strategy [Karlin et al. 94]
– Buy at time t ≤ B chosenaccording to some distribution
– Oblivious adversary
– There exists a distribution,for which the best competitive factor is e
e−1
Rent, Lease or Buy
Rent or Buy
Ski Rental
⊲Rent, Lease orBuy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 6 / 24
Sleeping Problem:
� Price of sleep increases with its depth� Sleep rent decreases with its depth
awake closing eyes naping asleep
Rent, Lease or Buy
Rent or Buy
Ski Rental
⊲Rent, Lease orBuy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 6 / 24
Sleeping Problem:
� Price of sleep increases with its depth� Sleep rent decreases with its depth
awake closing eyes naping asleep
Extended Ski Rental:
� Mixed rent and buy options� Pure buy or pure rent may not exist
Multislope Ski Rental
Rent or Buy
Ski Rental
Rent, Lease or Buy
⊲Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 7 / 24
Problem Definition:
� Several states/slopes
– Slope i: bi + ri · t
– bi+1 > bi for all i
– ri+1 < ri for all i
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
� End time is unknown� Which slope should we buy? When?
Multislope Ski Rental
Rent or Buy
Ski Rental
Rent, Lease or Buy
⊲Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 7 / 24
Problem Definition:
� Several states/slopes
– Slope i: bi + ri · t
– bi+1 > bi for all i
– ri+1 < ri for all i
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
� End time is unknown� Which slope should we buy? When?
� Online Buying Costs:Say we are in slope i, how much do we pay for slope j?
Multislope Ski Rental
Rent or Buy
Ski Rental
Rent, Lease or Buy
⊲Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 7 / 24
Problem Definition:
� Several states/slopes
– Slope i: bi + ri · t
– bi+1 > bi for all i
– ri+1 < ri for all i
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
� End time is unknown� Which slope should we buy? When?
� Online Buying Costs:Say we are in slope i, how much do we pay for slope j?
– Additive Model: bj − bi
– From-scratch Model: bj
– Non-Additive Model: bij
Offline Strategy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
⊲ Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 8 / 24
Offline Strategy:
� Knows end time in advance� Buys a slope at time 0 according to end time
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
Offline Strategy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
⊲ Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 8 / 24
Offline Strategy:
� Knows end time in advance� Buys a slope at time 0 according to end time
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
opt(t)
s1 s2 s3
Competitive Analysis:The online strategy is compared to the offline strategy
Previous Results & Applications
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
⊲ Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 9 / 24
Non-additive/from-scratch models:
� Online Capital Investments:
– Deter. 6.83-competitive strategy(slopes may arrive over time)[Azar et al. 99]
– Deter. lower bound 3.618Random. 2.88-competitive strategy[Damaschke 03]
Previous Results & Applications
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
⊲ Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 9 / 24
Non-additive/from-scratch models:
� Online Capital Investments:
– Deter. 6.83-competitive strategy(slopes may arrive over time)[Azar et al. 99]
– Deter. lower bound 3.618Random. 2.88-competitive strategy[Damaschke 03]
� Rerouting in ATM networks:
– 4-competitive deterministic strategy(slopes may be concave)[BCN 00]
Previous Results & Applications
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
⊲ Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 10 / 24
Energy Saving:
� Slopes are hibernation modes
Previous Results & Applications
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
⊲ Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 10 / 24
Energy Saving:
� Slopes are hibernation modes
� Additive model [IGS 02]:
– Deterministic 2-competitive strategy
� Non-additive model [AIS 04]:
– Algorithm that computesbest deterministic strategy
– Algorithm that computes beststrategy given distribution of idle period length(complexity depends on #bins in histogram)
Our Results
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
⊲ Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 11 / 24
Two slopes without pure buy:
� Deterministic Strategy:
– Buy at s where r0s = b1 + r1s
– Competitive ratio is 1 + r0−r1r0
time
cost
b1
s
r0t
b1 + r1t
Our Results
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
⊲ Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 11 / 24
Two slopes without pure buy:
� Deterministic Strategy:
– Buy at s where r0s = b1 + r1s
– Competitive ratio is 1 + r0−r1r0
time
cost
b1
s
r0t
b1 + r1t
� Our Results [LPR08a]:
– Randomized ee−1+
r1r0
-competitive strategy
– Matching lower bound (using Yao’s Lemma)
Our Results
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
⊲ Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 12 / 24
Multislope Ski Rental [LPR08b]:
� Additive Model:
– Randomized e−rk/r0
e−1 -competitive strategy(Decomposition into k classical ski rental instances)
– Main Result:Algorithm that computesbest randomized strategy
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
opt(t)
s1s2 s3
Our Results
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
⊲ Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 12 / 24
Multislope Ski Rental [LPR08b]:
� Additive Model:
– Randomized e−rk/r0
e−1 -competitive strategy(Decomposition into k classical ski rental instances)
– Main Result:Algorithm that computesbest randomized strategy
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
opt(t)
s1s2 s3
� Non-additive Model
– Randomized e-competitive strategy(Repeated doubling)
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 13 / 24
Randomized strategy:
� “Distribution” on buying time
time
cost
b1
s
r0t
b1 + r1t
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 13 / 24
Randomized strategy:
� “Distribution” on buying time
time
cost
b1
s
r0t
b1 + r1t
� p1(t) — prob. of buying slope 1 until t
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 13 / 24
Randomized strategy:
� “Distribution” on buying time
time
cost
b1
s
r0t
b1 + r1t
� p1(t) — prob. of buying slope 1 until t
� Expected rent at time t:
r0 · (1 − p1(t)) + r1 · p1(t) = r0 + (r1 − r0)p1(t)
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 13 / 24
Randomized strategy:
� “Distribution” on buying time
time
cost
b1
s
r0t
b1 + r1t
� p1(t) — prob. of buying slope 1 until t
� Expected rent at time t:
r0 · (1 − p1(t)) + r1 · p1(t) = r0 + (r1 − r0)p1(t)
� We spend as much as possible on buying for t ≤ s:
r0 + (r1 − r0)p1(t) + b1 ·ddtp1(t) = c · r0
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 13 / 24
Randomized strategy:
� “Distribution” on buying time
time
cost
b1
s
r0t
b1 + r1t
� p1(t) — prob. of buying slope 1 until t
� Expected rent at time t:
r0 · (1 − p1(t)) + r1 · p1(t) = r0 + (r1 − r0)p1(t)
� We spend as much as possible on buying for t ≤ s:
r0 + (r1 − r0)p1(t) + b1 ·ddtp1(t) = c · r0
� Solution with boundary condition p1(0) = 0:
p1(t) =r0(c − 1)
r0 − r1(e
r0−r1b1
t− 1)
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 14 / 24
� Guess: strategy stops buying at time s
time
cost
b1
s
r0t
b1 + r1t
� For t ≥ s = b1r0−r1
:
p1(t) = p1(s) = r0(c−1)r0−r1
(e − 1)
c · r1 = r0 + (r1 − r0)p1(s)
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 14 / 24
� Guess: strategy stops buying at time s
time
cost
b1
s
r0t
b1 + r1t
� For t ≥ s = b1r0−r1
:
p1(t) = p1(s) = r0(c−1)r0−r1
(e − 1)
c · r1 = r0 + (r1 − r0)p1(s)
⇓
c =e
e − 1 + r1r0
Two Slopes without Pure Buy
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
⊲ Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 14 / 24
� Guess: strategy stops buying at time s
time
cost
b1
s
r0t
b1 + r1t
� For t ≥ s = b1r0−r1
:
p1(t) = p1(s) = r0(c−1)r0−r1
(e − 1)
c · r1 = r0 + (r1 − r0)p1(s)
⇓
c =e
e − 1 + r1r0
⇓
p1(t) =
et·
r0−r1b1 −1
e−1+r1r0
t ≤ s
e−1e−1+
r1r0
t > s
Two Slopes — Strategy & Examples
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
⊲Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 15 / 24
� Probability of beingat slope 1 at time t: p1(t) =
et·
r0−r1b1 −1
e−1+r1r0
t ≤ s
e−1e−1+
r1r0
t > s
� Strategy: choose t at random according to p1
Two Slopes — Strategy & Examples
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
⊲Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 15 / 24
� Probability of beingat slope 1 at time t: p1(t) =
et·
r0−r1b1 −1
e−1+r1r0
t ≤ s
e−1e−1+
r1r0
t > s
� Strategy: choose t at random according to p1
� Examples:
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1 1.2 1.4
0
0.2
0.4
0.6
0.8
1
0 0.2 0.4 0.6 0.8 1 1.2 1.4
r1/r0 = 0, c = e
e−1≈ 1.582 r1/r0 = 0.5, c = e
e−0.5≈ 1.2254
Classical ski rental Pr[No buy] = 12e−1
Multislope Ski Rental
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
⊲Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 16 / 24
� Multiple Slopes:
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
opt(t)
s1 s2 s3
� Optimal Solution:Buys slope at time 0 and stays on it
Multislope Ski Rental
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
⊲Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 16 / 24
� Multiple Slopes:
time
cost
Slope 0 Slope 1
b1
Slope 2
b2
Slope 3
b3
opt(t)
s1 s2 s3
� Optimal Solution:Buys slope at time 0 and stays on it
� Additive Model:
– We pay bj − bi for moving from i to j
– W.l.o.g. we always go from slope i to slope i + 1
Strategies & Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
⊲Strategies &Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 17 / 24
� Randomized Strategy:
– Should we move to the next slope?– When do we move to the next slope?– Probability distribution over deterministic strategies
Strategies & Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
⊲Strategies &Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 17 / 24
� Randomized Strategy:
– Should we move to the next slope?– When do we move to the next slope?– Probability distribution over deterministic strategies
� Randomized Profile:
– pi(t) — probability of beingin slope i at time t
–∑
i pi(t) = 1 for all t ≥ 0
Strategies & Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
⊲Strategies &Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 17 / 24
� Randomized Strategy:
– Should we move to the next slope?– When do we move to the next slope?– Probability distribution over deterministic strategies
� Randomized Profile:
– pi(t) — probability of beingin slope i at time t
–∑
i pi(t) = 1 for all t ≥ 0
� Plan:
– Every strategy induces a profile– Find best profile– Construct strategy
Profiles Costs
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
⊲ Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 18 / 24
� Rent:
– Expected rent at time t: Rp(t)△
=∑
i
pi(t) · ri
– Expected rental cost at time t:
∫ t
0Rp(z)dz
Profiles Costs
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
⊲ Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 18 / 24
� Rent:
– Expected rent at time t: Rp(t)△
=∑
i
pi(t) · ri
– Expected rental cost at time t:
∫ t
0Rp(z)dz
� Buy:
– Expected buying cost at time t: Bp(t)△
=∑
i
pi(t) · bi
Profiles Costs
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
⊲ Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 18 / 24
� Rent:
– Expected rent at time t: Rp(t)△
=∑
i
pi(t) · ri
– Expected rental cost at time t:
∫ t
0Rp(z)dz
� Buy:
– Expected buying cost at time t: Bp(t)△
=∑
i
pi(t) · bi
� Total:
– Expected cost at time t: Bp(t) +
∫ t
0Rp(z)dz
Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
⊲ Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 19 / 24
Chain of Transformations:
� Profile
⇛ Continuous profileContinuous in t
⇛ Prudent profileOnly one or two consecutive active slopes
⇛ Tight profileMoves to the next slope as soon as possible
Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
⊲ Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 19 / 24
cont.
Chain of Transformations:
� Profile
⇛ Continuous profileContinuous in t
⇛ Prudent profileOnly one or two consecutive active slopes
⇛ Tight profileMoves to the next slope as soon as possible
Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
⊲ Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 19 / 24
prud.
Chain of Transformations:
� Profile
⇛ Continuous profileContinuous in t
⇛ Prudent profileOnly one or two consecutive active slopes
⇛ Tight profileMoves to the next slope as soon as possible
Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
⊲ Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 19 / 24
tight
Chain of Transformations:
� Profile
⇛ Continuous profileContinuous in t
⇛ Prudent profileOnly one or two consecutive active slopes
⇛ Tight profileMoves to the next slope as soon as possible
Prudent Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
⊲ Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 20 / 24
prud.
cont.
Continuous to Prudent:
� ∀t two (or one) consecutive slopes are determinedsuch that buying cost is preserved
⇛ Rent may only decrease
Prudent Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
⊲ Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 20 / 24
tight
prud.
Continuous to Prudent:
� ∀t two (or one) consecutive slopes are determinedsuch that buying cost is preserved
⇛ Rent may only decrease
Prudent to Tight:
� Buy next slope as soon as possible⇛ Rent may only decrease
Prudent Profiles
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
⊲ Prudent Profiles
Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 20 / 24
tight
Continuous to Prudent:
� ∀t two (or one) consecutive slopes are determinedsuch that buying cost is preserved
⇛ Rent may only decrease
Prudent to Tight:
� Buy next slope as soon as possible⇛ Rent may only decrease
Theorem: There exists a tight optimal profile
Computing Tight Profile
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
⊲ Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 21 / 24
Computing tight profile for a given c:
� Solve series of diff. equations:
ddtBp(t) + Rp(t) = c · d
dtopt(t)
⇛ For tight profiles
ddtpi(t) + α · pi(t) = β
Computing Tight Profile
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
⊲ Tight Profile
Algorithm
Examples
Conclusion
Rent, Lease or Buy 21 / 24
Computing tight profile for a given c:
� Solve series of diff. equations:
ddtBp(t) + Rp(t) = c · d
dtopt(t)
⇛ For tight profiles
ddtpi(t) + α · pi(t) = β
� Solve equation using boundary conditions:
– Initially: p0(0) = 1 and pi(0) = 0 for i > 0– Next boundary condition determined by events:
⊲ pi(t) = 1 for some slope i
⊲ddtopt(t) changes
– O(k) events
Algorithm
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
⊲ Algorithm
Examples
Conclusion
Rent, Lease or Buy 22 / 24
Algorithm:Binary search for best competitive ratio c ∈ [1, e
e−1]
Algorithm
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
⊲ Algorithm
Examples
Conclusion
Rent, Lease or Buy 22 / 24
Algorithm:Binary search for best competitive ratio c ∈ [1, e
e−1]
Computing a Strategy:
� Let p be a tight profile� X ∼ U(0, 1)� Move from slope i − 1 to slope i at t s.t. pi(t) = X
Algorithm
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
⊲ Algorithm
Examples
Conclusion
Rent, Lease or Buy 22 / 24
Algorithm:Binary search for best competitive ratio c ∈ [1, e
e−1]
Computing a Strategy:
� Let p be a tight profile� X ∼ U(0, 1)� Move from slope i − 1 to slope i at t s.t. pi(t) = X
Theorem:A randomized (c + ε)-competitive strategycan be found in O(k log 1
ε) time,
where c is the best possible competitive ratio
Three Slopes — Examples
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
⊲ Examples
Conclusion
Rent, Lease or Buy 23 / 24
0.2 0.4 0.6 0.8 1.0t
0.2
0.4
0.6
0.8
1.0
Prob
0.2 0.4 0.6 0.8 1.0t
0.2
0.4
0.6
0.8
1.0
Prob
0.2 0.4 0.6 0.8 1.0t
0.2
0.4
0.6
0.8
1.0
Prob
p0 p1 p2
Conclusion
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
⊲ Conclusion
Rent, Lease or Buy 24 / 24
Summary of Results:
� Two Slopes without Pure Rent:
– ee−1+r1/r0
-competitive strategy
– Matching lower bound
� Additive Model:
– Randomized e−rk/r0
e−1-competitive strategy
– Algorithm that computes best randomized strategy
� Non-additive Model:
– Randomized e-competitive strategy
Conclusion
Rent or Buy
Ski Rental
Rent, Lease or Buy
Multislope SkiRental
Offline Strategy
Prev. Results
Our Results
Two Slopes
Strategy &Examples
Multislope SkiRental
Strategies & Profiles
Profile Costs
Profiles
Prudent Profiles
Tight Profile
Algorithm
Examples
⊲ Conclusion
Rent, Lease or Buy 24 / 24
Summary of Results:
� Two Slopes without Pure Rent:
– ee−1+r1/r0
-competitive strategy
– Matching lower bound
� Additive Model:
– Randomized e−rk/r0
e−1-competitive strategy
– Algorithm that computes best randomized strategy
� Non-additive Model:
– Randomized e-competitive strategy
Open Problems:
� Compute best randomized strategy for non-additive model� Improve general upper bound for additive model