The analysis template
- The standard recipe for streaming algorithms, this one included: bound the expectation, bound the variance, apply Chebyshev's inequality
10:50. - Goal:
Pr[ | ‖y‖₂² − ‖x‖₂² | > ε‖x‖₂² ]is small (a third, or 1%) — which is exactly the statement‖y‖₂² = (1 ± ε)‖x‖₂²11:34,12:18. - Chebyshev bounds it by
E[(‖y‖₂² − E‖y‖₂²)²] / (ε²‖x‖₂⁴)— "just Markov after you square things"12:55.
Step 1 — the estimator is unbiased
yᵣ = (1/√m) Σᵢ σᵣᵢ xᵢ15:01.- Squaring gives a diagonal part
(1/m) Σᵢ σᵣᵢ² xᵢ²plus a cross partΣ_{i≠j} σᵣᵢσᵣⱼ xᵢxⱼ15:01. σᵣᵢ² = 1, and the cross terms vanish because independence makesE[σᵣᵢσᵣⱼ] = E[σᵣᵢ]·E[σᵣⱼ] = 015:55.- So
E[yᵣ²] = ‖x‖₂²/m, and summing themrows by linearity:E[‖y‖₂²] = ‖x‖₂²14:00,16:32.
Step 2 — the variance
- With the expectation pinned down, the Chebyshev numerator is
Var[‖y‖₂²]by definition17:15. - Independent entries of
Π⇒ independent coordinates ofy⇒ variances add:Var[‖y‖₂²] = Σᵣ Var[yᵣ²]17:15,17:51. Var[yᵣ²] = E[yᵣ⁴] − (E[yᵣ²])², and the subtracted term is‖x‖₂⁴/m²18:34,19:32.
Computing the fourth moment
- Expanding
yᵣ⁴produces roughlyn⁴monomials in the signs; push the expectation inside by linearity20:39. - Monomial shapes:
σᵣᵢ⁴;σᵣᵢ²σᵣⱼ²;σᵣᵢ³σᵣⱼ; and three-index terms — the exponents must sum to 421:06,21:27,21:48. - Key cancellation: independent factors split, and
E[sign^{odd}] = 0, so every monomial with an odd exponent dies — the same mechanism as the moment-based Chernoff proof from an earlier problem set22:32,22:56. - Terms with even exponents lose their randomness entirely, since a squared sign is
126:22. - What survives:
(1/m²)·[ Σᵢ xᵢ⁴ + c·Σ_{i≠j} xᵢ²xⱼ² ]. The lecturer initially omits the multinomial constantc(an audience member catches it; he believesc = 3, and notes it does not matter)22:56,24:12,24:58. - Since
Σᵢ xᵢ⁴ + Σ_{i≠j} xᵢ²xⱼ² = ‖x‖₂⁴, the(E[yᵣ²])²term cancels cleanly, leavingVar[yᵣ²] ≤ 2‖x‖₂⁴/m²23:35,25:38.
Step 3 — setting m
- Summing over the
mrows:Var[‖y‖₂²] ≤ 2‖x‖₂⁴/m26:47. - Chebyshev: failure probability
≤ (2/m)·‖x‖₂⁴ · 1/(ε²‖x‖₂⁴) = 2/(mε²)— the norms cancel27:13. - Choosing
m = 6/ε²drives the failure probability below1/327:13.
Conclusion of the base algorithm: O(1/ε²) words of space give a (1 ± ε) estimate of ‖x‖₂² with probability at least 2/3 28:58.