Lecture 24 (05/06/2026) - Prove MWU Expert's Theorem (Potential Function); Introduce Paging Problem
Scribes: Moinuddin Rahat and Michelle Lam
Topics covered:
- Introducing the Multiplicative Weight Updates (MWU) framework and the Weighted Majority algorithm
- Experts are assigned weights that decrease when they make mistakes
- Proving a mistake bound: the algorithm performs nearly as well as the best expert in hindsight using a potential function argument
- Introducing the paging problem (cache management in online settings)
- Discussing eviction strategies: LRU, LFU, FIFO, and optimal Farthest-in-Future
- Applying competitive analysis to evaluate paging algorithms
- Showing LRU and FIFO are -competitive and discussing resource augmentation
Experts’ Theorem
Section titled “Experts’ Theorem”In many situations, we need to make decisions repeatedly over time.
- We are given experts, where each expert provides a suggestion at every step.
- The decisions are binary, meaning there are only two possible choices (e.g., buy or sell).
- At each step, we choose an action based on the experts’ suggestions.
- At the end of each step, we receive feedback and can determine whether expert ‘s suggestion was correct or a mistake.
Goal: Design a strategy that performs nearly as well as the best expert in hindsight, even though we do not know this expert in advance.
Question
Section titled “Question”Is there a strategy that performs almost as well as the best expert? Can we design a method whose performance is close to the best expert in hindsight?
Weighted Majority Algorithm (MWU)
Section titled “Weighted Majority Algorithm (MWU)”We are given experts, indexed by .
- Initially, all experts are assigned equal weights:
- At each step , every expert has a weight .
Weight Update Rule
Section titled “Weight Update Rule”At step , the weights are updated as follows:
- If expert was correct:
- If expert was incorrect:
Here, is a small constant.
Decision Rule
Section titled “Decision Rule”At time step , we use the weighted votes of all experts:
- Compute the total weight of experts recommending each action.
- Choose Sell if:
- Otherwise, choose Buy.
Mistake Bound (Performance Guarantee)
Section titled “Mistake Bound (Performance Guarantee)”The number of mistakes made by the Weighted Majority (WM) algorithm satisfies:
More generally, for all experts :
In particular, this inequality holds when is the best expert in hindsight.
Theorem: Mistake Bound for MWU
Section titled “Theorem: Mistake Bound for MWU”After steps, let:
- : number of mistakes made by the WM algorithm so far
- : number of mistakes made by expert so far
Then, for all experts :
In particular, for the best expert:
Meaning of symbols:
- : number of rounds (time steps)
- : total mistakes made by the algorithm up to time
- : mistakes made by expert up to time
- : number of experts
- : a small parameter used in weight updates
Proof: Weighted Majority via Potential Function
Section titled “Proof: Weighted Majority via Potential Function”We prove the mistake bound using a potential function argument.
Step 1: Initialization and Weights
Section titled “Step 1: Initialization and Weights”- Initially, each expert has weight .
- After steps:
Each time expert makes a mistake, its weight is multiplied by . After mistakes, this results in an exponential decrease in weight.
Step 2: Potential Function
Section titled “Step 2: Potential Function”Define the potential function:
Initially: .
The potential function measures the total “trust” we place in all experts.
Step 3: Effect of a Mistake
Section titled “Step 3: Effect of a Mistake”Suppose the algorithm makes a mistake at time .
Partition the experts into two groups:
- : total weight of correct experts
- : total weight of incorrect experts
Then .
After updating the weights:
Since incorrect experts are penalized, the total weight decreases by .
Step 4: Key Inequality
Section titled “Step 4: Key Inequality”If the algorithm makes a mistake at time , then at least half of the total weight must have supported the wrong decision. Hence:
Substituting into the update from Step 3:
Step 5: After Multiple Mistakes (Upper Bound)
Section titled “Step 5: After Multiple Mistakes (Upper Bound)”If the algorithm makes mistakes total, then each mistake multiplies the potential by at most . Starting from :
Thus, each mistake causes the potential to shrink multiplicatively.
Step 6: Lower Bound via Any Expert
Section titled “Step 6: Lower Bound via Any Expert”For any expert :
The total weight is at least as large as any individual expert’s weight.
Step 7: Combine Bounds
Section titled “Step 7: Combine Bounds”Combining the upper and lower bounds on the potential function:
This relates the algorithm’s mistakes to the mistakes of any expert.
Step 8: Take Logarithms
Section titled “Step 8: Take Logarithms”Step 9: Rearrange
Section titled “Step 9: Rearrange”Rearranging:
Multiplying both sides by (reversing the inequality):
Step 10: Apply Logarithmic Inequalities (via Taylor Series)
Section titled “Step 10: Apply Logarithmic Inequalities (via Taylor Series)”Starting from Step 9, divide both sides by (which is positive) to isolate :
To bound this, we need two things going in opposite directions:
- A lower bound on the denominator , so the overall fraction stays an upper bound on .
- An upper bound on the numerator factor .
Both follow from the Taylor series. Since all omitted terms are positive:
truncating gives the bounds (for small ):
Applying the lower bound to the denominator and the upper bound to the numerator:
Result
Section titled “Result”For all experts :
In particular, this bound holds for the best expert in hindsight.
Intuition Behind the Potential Function Proof
Section titled “Intuition Behind the Potential Function Proof”The proof tracks a quantity called the potential function, defined as the total weight of all experts. This potential represents how much overall “trust” we place in the experts at any time.
- Good experts keep weight: Experts who make few mistakes retain relatively high weight over time.
- Bad experts lose weight: Experts who make mistakes repeatedly see their weight decrease exponentially.
- Mistakes reduce total weight: When the algorithm makes a mistake, at least half of the total weight supported the wrong decision. As a result, a significant portion of the weight is penalized, causing the total weight to decrease.
The key idea is to compare two views of the same quantity (the potential):
- An upper bound, showing that the total weight decreases quickly as the algorithm makes mistakes.
- A lower bound, showing that at least one good expert maintains relatively large weight.
By combining these two, we conclude that:
The total weight cannot decrease too fast unless the best expert also makes many mistakes.
Paging and Cache Eviction
Section titled “Paging and Cache Eviction”In many computing systems, we maintain a small, fast-access cache alongside a large, slow memory. When a requested item is already in the cache, it is served immediately. When it is not, a cache miss occurs: the item must be fetched from slower memory, and if the cache is full, an existing item must be evicted to make room.
- We are given a cache of size and a sequence of data requests .
- At each step, we receive a request . If is not in the cache, a cache miss occurs and we must evict some item to insert .
- The cost of an algorithm on a given sequence is the total number of cache misses it incurs.
- Eviction decisions must be made without knowledge of future requests, making this an online algorithm problem.
Goal: Design an eviction strategy that minimizes the number of cache misses, even without seeing future requests.
Cache Eviction Heuristics
Section titled “Cache Eviction Heuristics”We are given a cache of size and a request sequence .
- At each step , the cache holds at most items.
- When a cache miss occurs, the eviction policy determines which item to remove.
Eviction Policies
Section titled “Eviction Policies”At step , upon a cache miss, the following online policies can be applied:
-
LRU (Least Recently Used): Evict the item that has not been requested for the longest time. Concretely, for every item in the cache, we look at when it was last requested in the access sequence, and evict whichever was requested earliest.
-
LFU (Least Frequently Used): Track the cumulative access frequency of each cached item. Evict the item with the lowest frequency. Items accessed more often are assumed more likely to be needed again.
-
FIFO (First In, First Out): Evict the item that has been in the cache the longest — that is, the item that was brought into the cache earliest. This is different from LRU because LRU tracks when an item was last requested, while FIFO tracks when it was inserted into the cache. An item can be requested many times and still be the first evicted under FIFO if it was the first to enter.
All three policies are online algorithms because they operate using only information about past requests and require no knowledge of future requests.
Example (cache of size )
Consider the following request sequence:
After the first three requests, the cache is fully populated with no misses:
The next request is for item , which is not in the cache — a cache miss occurs, so the cost increases by 1. We must evict one of to make room. Each policy makes a different decision:
- LRU evicts item , since it was requested least recently among .
- LFU may evict any item, since all three have been requested exactly once. However, after and are requested again they will not be evicted when inserting because they will have a request frequency of 2.
- FIFO evicts item , since it was the first item to enter the cache.
Optimal Algorithm (OPT)
Section titled “Optimal Algorithm (OPT)”- Farthest in Future (God’s Algorithm): When a cache miss occurs, look at all items currently in the cache and identify which one will be requested farthest in the future. Evict that item. If an item in the cache will never be requested again, evict it first.
This algorithm was proven optimal by Bélády: no algorithm, even one with full knowledge of the future, can incur fewer cache misses. Since it requires complete knowledge of the entire request sequence, it is an offline algorithm and cannot be implemented in practice. However, it serves as a benchmark for competitive analysis.
Example
Using the same example as earlier:
After the first three requests: .
OPT looks ahead in the sequence and evicts item , since does not appear again in the future.
The cache after evicting the first item:
Resource Augmentation
Section titled “Resource Augmentation”Theorem (Sleator-Tarjan)
- Both LRU and FIFO are -competitive, where is the size of the cache.
- No online algorithm can be less than -competitive.
Since no online algorithm can beat -competitiveness in the standard setting, we ask: how much more cache do we need to give an online algorithm to be able to compete with OPT? This idea is formalized by resource augmentation.
- Suppose our online algorithm is given a cache of size , while OPT is restricted to a cache of size .
- Under this model, LRU and FIFO are -competitive against OPT.
Example: Suppose we are given a cache of size and OPT is given . Then:
So LRU and FIFO are roughly 2-competitive against an optimal algorithm with half the cache. We can compensate for not seeing the future by using a cache twice as large.