M1-004M1: Mathematics & Statistics FundamentalsProbability FoundationsMedium
⚡Flashcard Drill➔Mastery:

Explain Linearity of Expectation and Additivity of Variance, Highlighting Necessary Preconditions

📐 Mathematical Definition
E[aX+bY]=aE[X]+bE[Y],Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y)\mathbb{E}[aX+bY]=a\mathbb{E}[X]+b\mathbb{E}[Y],\qquad \mathrm{Var}(X+Y)=\mathrm{Var}(X)+\mathrm{Var}(Y)+2\mathrm{Cov}(X,Y)
⚡ One-Sentence Core Answer
Expectation is universally linear without any independence assumptions; variance additivity strictly requires zero pairwise covariance (uncorrelatedness).

📌 Key Takeaways

  • •
    Linearity of expectation holds universally across any arbitrary joint distribution, even under complete mutual dependence.
  • •
    Variance additivity Var(X+Y)=Var(X)+Var(Y)\text{Var}(X+Y)=\text{Var}(X)+\text{Var}(Y) requires Cov(X,Y)=0\text{Cov}(X, Y)=0.
  • •
    CUPED variance reduction in online experimentation fundamentally exploits non-zero covariance to cancel noise.

📐 Mathematical Derivations

By definition of discrete or continuous integration, E[aX+bY]=∫∫(ax+by)p(x,y)dxdy=a∫x(∫p(x,y)dy)dx+b∫y(∫p(x,y)dx)dy=aE[X]+bE[Y]E[aX + bY] = \int\int (ax + by)p(x, y)dxdy = a\int x(\int p(x,y)dy)dx + b\int y(\int p(x,y)dx)dy = aE[X] + bE[Y]. No independence or distributional constraints are needed. For variance, Var(X+Y)=E[((X+Y)−(E[X]+E[Y]))2]=Var(X)+Var(Y)+2Cov(X,Y)\text{Var}(X+Y) = E[((X+Y) - (E[X]+E[Y]))^2] = \text{Var}(X) + \text{Var}(Y) + 2\text{Cov}(X, Y). Hence, additivity holds if and only if Cov(X,Y)=0\text{Cov}(X, Y) = 0. If XX and YY are negatively correlated, the variance of their sum is strictly smaller than the sum of variances.

🏭 Production Trade-offs

In A/B testing and metric evaluation: (1) Sample means reliably estimate population means regardless of internal user interactions because expectation is unconditionally linear. (2) For ratio metrics like Click-Through Rate ∑Clicks∑Impressions\frac{\sum \text{Clicks}}{\sum \text{Impressions}}, numerator and denominator are strongly correlated across user clusters, so standard variance formulas fail and delta method or bootstrap must be used. (3) CUPED constructs Y∗=Y−θ(X−E[X])Y^* = Y - \theta (X - E[X]) with optimal θ=Cov(Y,X)Var(X)\theta = \frac{\text{Cov}(Y, X)}{\text{Var}(X)}, reducing variance to Var(Y)(1−ρ2)\text{Var}(Y)(1 - \rho^2).
⚠️ Common Interview Pitfalls
  • ✕
    Assuming variance is linear or additive when variables are correlated.
  • ✕
    Confusing 'uncorrelated' (Cov=0\text{Cov}=0) with 'statistically independent' (only equivalent for joint Gaussian distributions).
🎯 Interviewer Follow-up Inquiries
  • ?
    How does the Delta Method approximate the expectation and variance of non-linear transformations g(X)g(X)?
  • ?
    Why does cluster randomization require hierarchical variance estimation instead of simple i.i.d. variance additivity?
⚡
Test muscle memory on this topic via 3-Layer Flashcards
Active Recall: Mentally formulate Prompt ➔ Math Derivation ➔ Benchmark Implementation in 3 minutes.
🎯 Drill This Card Now➔
📚

Associated Knowledge Base Guides & Mindmaps

Explore the comprehensive technical article, exam cards, and global architecture tree.

← PreviousM1-003: Define Independence vs. Conditional Independence, and Why Naive Bayes Works Despite Strong Violations📋Back to BankNext →M1-005: Formulate Markov's and Chebyshev's Inequalities, and Contrast Their Tightness and Applications
中文速览与面试要点

解释期望的线性性与方差的可加性,并说明各自需要什么条件。

期望线性无条件成立;方差可加需要不相关(独立是充分条件)。

核心要点

  • 期望的线性性 E[aX+bY]=aE[X]+bE[Y] 对任意随机变量成立(不要求独立、不要求同分布),因为期望是积分算子,积分天然线性。这是统计推断最重要的工具——它保证了'样本均值是总体均值的无偏估计'这一结论无需任何分布假设。 方差的可加性 则不然:Var(X+Y)=Var(X)+Var(Y)+2Cov(X,Y),只有当 Cov=0(不相关)时才能简化为相加;独立是 Cov=0 的充分条件但非必要(存在不相关但依赖的例子,如 X~U(-1,1) 与 Y=X²)。
  • 这两个性质直接支撑 A/B 测试的理论基础:① 由期望线性,处理组与对照组的样本均值差是 ATE 的无偏估计;② 由方差可加,两组独立时差值方差 = 两组方差之和,故标准误可解析计算。更重要的是方差可加的反面—— 若引入与指标相关的协变量,可以通过扣除其解释的方差来降低估计方差 :这就是 CUPED(Y^cv=Y−θ(X−X̄),θ=Cov(Y,X)/Var(X)),方差降低比例恰为相关系数平方 ρ²。工业界实践中,用实验前的同指标作为协变量常能降低 30–50% 方差,等效于免费获得数倍样本量。
  • 期望线性是 A/B 测试能用样本均值估计总体均值的根基
  • 方差可加在 A/B 分组独立时成立(CUPED 正是利用相关性降方差)

常见陷阱

  • 以为方差可加也无需条件
  • 误认为不相关等价于独立