Behavioural randomized online strategies against an oblivious adversary #
This file adds behavioural randomized online strategies to the online model of
CslibFrontier.DataStructure.Online.Basic, complementing the mixed-strategy RandStrategy model of
CslibFrontier.DataStructure.Online.Randomized.
Whereas a RandStrategy P draws a deterministic strategy from a single PMF (DetStrategy P) before
seeing any requests (and therefore covers only countably supported mixtures of deterministic
strategies), a BehavioralStrategy P maintains internal controller memory Mem, initializes it
deterministically via init : P.State → Mem, and updates it at each arrived request via a
PMF-valued transition step : Mem → P.Req → PMF Mem whose supported outcomes project to valid
transitions of P. Algorithms such as the randomized marking algorithm for paging toss fresh
uniform coins at unboundedly many steps and naturally inhabit BehavioralStrategy P.
Against an oblivious adversary — which fixes the entire request sequence reqs before any coin
is tossed — the expected cost from memory m on reqs is defined by backward recursion in ℝ≥0∞
(BehavioralStrategy.expectedCostFrom), and BehavioralStrategy.expectedCost starts from
init s₀. Memory-distribution helpers (runMemDist, expectedCostDist) push an arbitrary law
μ : PMF B.Mem forward one request at a time so that distribution-invariant analyses (such as
marking's uniform stale-subset law) reduce directly to step expectations.
Deterministic strategies embed as point-mass transitions (BehavioralStrategy.ofDetStrategy),
recovering deterministic costFrom, cost and competitiveness (expectedCostFrom_ofDetStrategy,
expectedCost_ofDetStrategy, isCompetitive_ofDetStrategy_iff).
Adaptive adversaries and Kuhn-type equivalence with RandStrategy are not formalized here.
Main definitions #
Cslib.DataStructure.Online.BehavioralStrategy: behavioural randomized online strategies withPMF-valued per-request memory transitions.BehavioralStrategy.stepExpectedCost,BehavioralStrategy.expectedCostFrom,BehavioralStrategy.expectedCost: single-step and backward-recursive multi-step expected online costs inℝ≥0∞.BehavioralStrategy.runMemDist,BehavioralStrategy.expectedCostDist: evolution and expected continuation cost from a probability distribution over controller memories.BehavioralStrategy.IsCompetitiveFrom,BehavioralStrategy.IsCompetitive,BehavioralStrategy.IsCompetitiveAnyInit: expected competitiveness against an oblivious adversary.BehavioralStrategy.ofDetStrategy: embedding of deterministic online strategies viaPMF.pure.
Main results #
BehavioralStrategy.expectedCostFrom_cons_eq_add,BehavioralStrategy.expectedCostDist_cons,BehavioralStrategy.expectedCostDist_append: linear decomposition of expected cost across single steps and concatenated request sequences.BehavioralStrategy.expectedCostFrom_le_mul_length: finiteness / linear upper bound when per-step costs are bounded.BehavioralStrategy.expectedCostFrom_ofDetStrategy,BehavioralStrategy.expectedCost_ofDetStrategy,BehavioralStrategy.isCompetitive_ofDetStrategy_iff,BehavioralStrategy.isCompetitiveAnyInit_ofDetStrategy_iff: deterministic agreement.
References #
A behavioural randomized online strategy for P. Its transition step sees only its internal
memory Mem and the newly arrived request P.Req, returning a discrete probability distribution
PMF Mem whose every supported outcome preserves ValidMem and projects to a valid transition of
P.
- Mem : Type
Internal controller memory maintained across requests.
Observable configuration in
P.Statecorresponding to internal memory.Deterministic online initialization from an initial configuration of
P.Randomized online transition consuming the current memory and arrived request.
Expected cost against an oblivious adversary #
Expected single-step cost of B when serving request r from internal memory m.
Expected total cost of B starting from internal memory m on the fixed request sequence
reqs, defined by backward recursion in ℝ≥0∞.
Expected total cost of B from initial configuration s₀ on the fixed request sequence reqs
chosen by an oblivious adversary.
Linear split of expectedCostFrom into the immediate expected step cost plus the expected
continuation cost.
If every supported transition of B incurs step cost at most w, then stepExpectedCost is at
most w on every valid memory.
If every supported transition of B incurs step cost at most w, then expectedCostFrom on
reqs is at most w * reqs.length on every valid memory.
Memory-distribution evolution #
Evolve a probability distribution μ over controller memories across a request sequence.
Expected continuation cost of B on reqs when the starting controller memory is drawn from
μ.
runMemDist preserves support validity across any request sequence.
One-step Bellman decomposition of expectedCostDist over a memory distribution μ.
Additivity of expectedCostDist across concatenated request sequences.
Competitive ratio predicates #
B is (c, b)-competitive from s₀ against an oblivious adversary when its expected cost on
every request sequence is at most c times any valid offline schedule's cost from s₀, plus
b.
B is (c, b)-competitive against an oblivious adversary when it is (c, b)-competitive from
every admissible initial state s₀ shared with the offline schedule.
B is (c, b)-competitive across arbitrary initial states when its expected cost from any
admissible s₀ is at most c times any valid offline schedule's cost from any admissible s_off,
plus b.
Competitiveness across arbitrary initial states implies same-initial-state competitiveness.
Monotonicity of IsCompetitive in the competitive ratio c and additive constant b.
Embedding deterministic strategies #
View a deterministic online strategy A : DetStrategy P as a behavioural strategy whose
per-request transitions are point masses PMF.pure (A.step m r).
Expected cost from m of ofDetStrategy A equals A.costFrom m reqs.
From any admissible initial configuration s₀, the expected cost of ofDetStrategy A equals
A.cost s₀ reqs.
For natural-number coefficients, ofDetStrategy A is (c, b)-competitive iff A is.
For natural-number coefficients, ofDetStrategy A is (c, b)-competitive across arbitrary
initial states iff A is.