Variance and covariance on the Boolean cube #
The covariance of two real functions on the cube is the sum of the products of their Fourier
coefficients on the nonempty sets (BitString.expect_sub_expect_mul_sub_expect_eq_sum)
O'Donnell, Proposition 1.16, as the variance is their Fourier weight on the
nonempty sets (BitString.expect_sub_expect_sq_eq_sum_fourierCoeff_sq).
For a Boolean function f read as the signs F = (-1) ^ f, write dist(f, b) for the relative
Hamming distance hammingDist f (fun _ => b) / 2 ^ n from f to the constant b; the constant
false reads as the sign 1. The two distances sum to one
(BitString.hammingDist_false_div_add_hammingDist_true_div), the mean of F is
1 - 2 dist(f, false) (BitString.expect_signVal), and the variance of F is
1 - (𝔼 F) ^ 2 = 4 dist(f, false) dist(f, true) (BitString.expect_sub_expect_sq_signVal,
BitString.expect_sub_expect_sq_signVal_eq_four_mul) O'Donnell, Fact 1.14. So
the variance is within a factor two of four times the distance ε to the nearer constant,
2 ε ≤ Var[F] ≤ 4 ε (BitString.two_mul_min_le_expect_sub_expect_sq_signVal,
BitString.expect_sub_expect_sq_signVal_le_four_mul_min)
O'Donnell, Proposition 1.15.
Main results #
Cslib.BitString.expect_sub_expect_mul_sub_expect_eq_sum: the covariance is the sum of the products of the Fourier coefficients on the nonempty sets.Cslib.BitString.expect_sub_expect_sq_signVal,Cslib.BitString.expect_sub_expect_sq_signVal_eq_four_mul: the variance of a Boolean function read as signs.Cslib.BitString.two_mul_min_le_expect_sub_expect_sq_signVal,Cslib.BitString.expect_sub_expect_sq_signVal_le_four_mul_min: the variance is between twice and four times the distance to the nearer constant.Cslib.BitString.expect_sub_expect_sq_signVal_pos: a nonconstant Boolean function has positive variance.
References #
The covariance is the sum of the products of the Fourier coefficients on the nonempty sets O'Donnell, Proposition 1.16.
The mean of a Boolean function read as signs is one minus twice its relative Hamming distance
to the constant false, whose sign is 1.
The relative Hamming distances from a Boolean function to the two constants sum to one.
The variance of a Boolean function read as signs is one minus its squared mean O'Donnell, Fact 1.14.
The variance of a Boolean function read as signs is four times the product of its relative Hamming distances to the two constants O'Donnell, Fact 1.14.
The variance is at least twice the distance to the nearer constant: a Boolean function
read as signs has variance at least 2 ε, where ε is its relative Hamming distance to the
nearer constant O'Donnell, Proposition 1.15.
The variance is at most four times the distance to the nearer constant: a Boolean function
read as signs has variance at most 4 ε, where ε is its relative Hamming distance to the
nearer constant O'Donnell, Proposition 1.15.
A nonconstant Boolean function read as signs has positive variance.