Processing math: 100%

Deriving Chernoff Bounds

Definitions

A sample space Ω is a set of outcomes Ω=a1,a2, with associated probabilities P(a1),. Each time we sample from Ω we recieve an outcome V(Ω). After k trials let Gk=ki=1V(Ω).

In this post we'll be developing methods to bound Gk.

Example

Let's say there's a lottery that either wins you $60, $1010, or nothing at all. It costs $10 to enter, so the net outcomes would be Ω={10,50,1000}, let's say with probabilities P(10)=90%, P(50)=9.9%, and P(1000)=0.1%.

After k trials, what are the odds that we won't loss money? That we'll make or lose more than $1000? To answer these questions, we'll be finding upper bounds on probabilities of the form P(GkZ).

Deriving

The expected value of each trial is E[V(Ω)]=aΩaP(a) We'll introduce an auxiliary variable, t>0, to modify the value of each outcome, E[etV(Ω)]=aΩeatP(a) We'll leave the value of t floating for now and resolve it towards the end of the post. We now show E[etGK]=E[etki=1V(Ω)]=ki=1E[etV(Ω)] because trials are independent=(E[etV(Ω)])k=(aΩeatP(a))k

Bounding the probability on the upper tail, GkZ, P(GkZ)=P(etGketZ) by monotonicityE[etGk]etZ by Markov's inequality=(aΩeatP(a))ketZ

To evaluate the bound we'll pick a t>0 that minimizes the RHS. Because it's convex, we can numerically find t using a binary search type algorithm,

const optimizer = (boundFn) => (lottery, k, z) => {
let t = 1e-10;
let step = 1;
let value = Infinity;
while(Math.abs(step) > 1e-10){
const proposal = t + step;
if(proposal <= 0){ step *= -0.5; continue; }
const prop_val = boundFn(lottery, k, z, proposal);
if(prop_val < value){
t = proposal;
value = prop_val;
} else {
step *= step<0? -0.5 : -1;
}
}
return value;
}
/**
* @param {Array} lottery - An array of pairs, eg [[value, probability], ...]
* @param {integer} k - Number of trials
* @param {number} z - The x-axis of the tail
* @return {number} An upper bound
* @example
* upperTail([[-5, 0.65], [5, 0.34], [95, 0.01]], 100, 0)
*/
const upperTail = optimizer((lottery, k, z, t) =>
Math.pow(lottery.reduce((acc, [a, p]) => acc + (p * Math.exp(a*t)), 0), k)
/ Math.exp(t * z));

Empirical Evaluation

Revisiting the example, if we buy k tickets, what are the odds we won't lose money, P(Gk0)? This may be somewhat difficult to answer, and so we'll ask for an upper bound on this probability. We plot the derived bound alongside probabilities found by monte carlo simulation,

Won't lose money


We'll make at least $1000


We won't lose more than $1000

Final Thoughts

Although this may not seem awfully tight, asymptotically, this is as good as it gets; a simple analysis shows that the bound is exponential in k, Θ(ck), for 0<c<1.

I'm also realizing that in the example I promised to give bounds on the probability of losing more than $1000, P(Gk<1000), however I only gave an upper bound, u, on the complement, P(Gk1000)u. We can easily perform a slight change to convert this into a lower bound on P(Gk<1000), P(Gk1000)uP(Gk<1000)1u