The BIT algorithm is 7/4-competitive for list update #
This file formalizes the randomized BIT list-update algorithm of
Reingold, Westbrook, and Sleator, Randomized Competitive Algorithms for the List Update
Problem (see also Borodin and El-Yaniv, Online Computation and
Competitive Analysis, Chapter 1) in the list-update model of
CslibFrontier.DataStructure.ListUpdate.Basic and the oblivious-adversary randomized framework of
CslibFrontier.DataStructure.Online.Randomized.
Algorithm #
Each item x : α carries a single bit b x : Bool, initialized uniformly and independently at
random over α → Bool before the request sequence begins (bit). On request r, BIT flips
b r to !b r; if the new bit is true (equivalently b r = false before the step), it moves
r to the front of the list (moveToFront r l), and otherwise leaves the list unchanged
(bitStep, bitDet). In both branches the single-step cost in ListUpdate.problem α equals the
1-based position l.idxOf r + 1 (stepCost_bitStep), matching the Sleator–Tarjan access cost.
Proof outline #
Define the weighted inversion potential
bitPotential m b L = ∑ p ∈ inversionSet m L, bitWeight (b p.2),
where bitWeight false = 1 and bitWeight true = 2 (the number of accesses to p.2 needed to
move p.2 to the front and destroy the inversion).
- Online step: On request
r, ifb r = false, movingrto the front destroys all inversions(x, r)(each of weight1) and creates new inversions(r, y)only foryprecedingrin the offline listL(each of weightbitWeight (b y), withy ≠ r). Ifb r = true, the list is unchanged and every inversion(x, r)drops in weight from2to1. Combining both cases yields a pointwise bound whose excess term depends only onb rand{b y | L.idxOf y < L.idxOf r}. - Uniformity invariant and exact summing: Flipping
b ris an involution onα → Bool, so the current bit vector remains uniformly distributed at every step against an oblivious adversary. Pairing each bit vector with its flips atrandy(y ≠ r) gives exact natural- number sums: the excess term averages to(3 / 4) * L.idxOf r, and each offline inversion ins₀ → s'averages to3 / 2. - Telescoping: Summing across the whole schedule gives the exact split bound
E[BIT] + (3 / 4) * |reqs| ≤ (7 / 4) * accessCost + (3 / 2) * exchangeCost +(3 / 2) * inversions m₀ s₀(expectedCost_bit_add_le), hence(7 / 4, 0)-competitiveness from a common initial arrangement (bit_isCompetitive) and(7 / 4, (3 / 4) * n * (n - 1))-competitiveness across arbitrary initial arrangements (bit_isCompetitiveAnyInit). - Separation from deterministic strategies: By
ListUpdate.exists_ratio_violation_of_lt, no deterministic strategy is(7 / 4, b)-competitive for any additive constantbonceFintype.card α ≥ 8(not_det_isCompetitive_seven_fourths).
The primary journal text of [RWS94] was not inspected firsthand; no internal theorem or section numbers are claimed.
Main definitions #
Cslib.DataStructure.ListUpdate.BitMem: controller memory(list, bits)ofBIT.Cslib.DataStructure.ListUpdate.bitStep: single-step bit flip and conditional move-to-front transition.Cslib.DataStructure.ListUpdate.bitDet: deterministicBITstrategy for a fixed initial bit vector.Cslib.DataStructure.ListUpdate.bit: the randomizedBITstrategy as aRandStrategy.
Main results #
stepCost_bitStep:BITpays exactly the 1-based position of the requested item.expectedCost_bit_eq_sum: expected cost ofBITas the uniform average overα → Bool.expectedCost_bit_add_le: the Reingold–Westbrook–Sleator amortized bound split intoaccessCost,exchangeCost, and initial inversions.bit_isCompetitive,bit_isCompetitiveAnyInit:BITis(7 / 4, 0)-competitive from a common initial arrangement and(7 / 4, 3/4 * n * (n - 1))-competitive from arbitrary arrangements.not_det_isCompetitive_of_lt_rat,not_det_isCompetitive_seven_fourths: strict separation from all deterministic strategies forn ≥ 8.
References #
Controller memory for the BIT list-update strategy: the current list arrangement together
with one parity bit per item.
Single step of BIT on request r: flip m.bits r, and move r to the front iff the new bit
is true (i.e. m.bits r = false).
bitStep preserves IsArrangement.
Deterministic BIT strategy parameterized by an initial bit vector initBits : α → Bool.
The randomized BIT strategy: draw initial bits uniformly at random from α → Bool, then run
bitDet α.
In both branches, BIT pays exactly the 1-based position of the requested item.
Expected cost of bit α equals the uniform average of (bitDet α b).cost over all
b : α → Bool.
bitDet's costFrom depends only on the starting memory, not on the initBits parameter.
Summing any function of two distinct bits over α → Bool via coordinate pairing.
Pointwise potential inequalities #
Telescoping bound and competitiveness #
Scaling identity dividing k * x * |α → Bool| by d * |α → Bool| in ℝ≥0∞.
Expected-cost BIT bound ([RWS94]): for every valid offline
schedule states serving reqs from s₀, BIT started from m₀ satisfies
E[BIT] + (3 / 4) * |reqs| ≤ (7 / 4) * accessCost + (3 / 2) * exchangeCost +
(3 / 2) * inversions m₀ s₀.
BIT is (7 / 4, 0)-competitive against an oblivious adversary from a common initial
arrangement ([RWS94]).
BIT is (7 / 4, (3 / 4) * n * (n - 1))-competitive across arbitrary initial arrangements,
where n = Fintype.card α.
Separation from deterministic strategies #
No deterministic list-update strategy (viewed as a point-mass RandStrategy) achieves a
rational competitive ratio p / q < 2n / (n + 1) with any additive constant b.
For Fintype.card α ≥ 8, no deterministic strategy is (7 / 4, b)-competitive for any additive
constant b, whereas bit α is (7 / 4, 0)-competitive (bit_isCompetitive).