← Back to Data Scientist Mind Map
📈 Data ScientistID: ds-sample-size-formula-mde-derivation

Sample Size Derivation & MDE Budget

样本量公式严格推导与 MDE 估算
🎯Core Definition
The A/B Test Minimum Sample Size Formula & MDE Derivation establishes the exact sample requirements per variant under significance α\alpha and power 1−β1 - \beta; for continuous mean metrics, equating critical ZZ-score thresholds under H0H_0 and H1H_1 yields the closed-form sample size formula: n=(zα/2+zβ)2⋅2σ2δ2n = \frac{(z_{\alpha/2} + z_\beta)^2 \cdot 2\sigma^2}{\delta^2} (where δ=∣μT−μC∣\delta = |\mu_T - \mu_C| is target effect size, σ2\sigma^2 metric variance); for binomial ratio metrics (CTR/CVR with baseline probability pp), substituting σ2=pˉ(1−pˉ)\sigma^2 = \bar{p}(1-\bar{p}) derives: n=(zα/2+zβ)2⋅2pˉ(1−pˉ)δ2n = \frac{(z_{\alpha/2} + z_\beta)^2 \cdot 2 \bar{p}(1-\bar{p})}{\delta^2}; inverted under fixed traffic constraints, it computes the Minimum Detectable Effect: MDE=(zα/2+zβ)2σ2n\text{MDE} = (z_{\alpha/2} + z_\beta) \sqrt{\frac{2\sigma^2}{n}}.
💡Use Cases
Pre-experiment traffic budgeting, duration scheduling, and statistical sensitivity audits.
⚡Key Problems Solved
Underpowered tests miss real wins due to noisy variance, while overpowered tests waste valuable user traffic and delay product deployment cycles.
🎯Core Interview Exam Points
Fundamentals · Production Scenarios · Deep Dive
Core Def
Explain the core definition, underlying mechanism/math, and key principles of Sample Size Derivation & MDE Budget.
Use Cases
In production engineering, what are the primary use cases for Sample Size Derivation & MDE Budget and what core pain points does it solve?
🔥 High-Frequency Deep-Dive Questions
1
Derive the step-by-step mathematical proof of sample size n=(zα/2+zβ)2⋅2σ2δ2n = \frac{(z_{\alpha/2} + z_\beta)^2 \cdot 2\sigma^2}{\delta^2} from normal distribution quantile critical boundaries?
2
Explain why halving the target effect size δ\delta quadruples (4×4\times) required sample size due to the inverse-square law?
3
Derive effective sample size neff=2nTnCnT+nCn_{\text{eff}} = \frac{2 n_T n_C}{n_T + n_C} under skewed 90/10 traffic splits and quantify statistical power loss?
4
Why must online experiments run for integer weekly cycles (7 or 14 days) regardless of reaching sample size early to absorb weekly seasonality?
5
How to resolve sample size explosions on heavy-tailed revenue metrics via Winsorization, log transforms, or CUPED variance reduction?
🔗Foundational Prerequisite Cards (Click to Review)
Updated 2026-08-14
🎯
Verify Mastery: Practice Exam Questions for "Sample Size Derivation & MDE Budget"
Take pitfall multiple-choice questions with derivation options; mistakes are automatically logged.
🚀 Start Card Practice ➔
← Previous CardHypothesis Testing, Type I/II & PowerNext Card →P-hacking, Peeking & mSPRT Sequential

🔗 More Data Scientist Knowledge Cards

引用出处: TalentMe 450+ 工业级 AI 架构考点知识库 (Tech Vault) · 遵循 CC-BY-4.0 知识共享协议
URL: https://talentme.airsota.com/resources/tech/roadmap/mindmap/DS/card/ds-sample-size-formula-mde-derivation
中文速览与面试要点

样本量公式严格推导与 MDE 估算 (Sample Size Derivation & MDE Budget)

定义: 工业 A/B 测试每组所需最小样本量闭式公式与最小可检测效应 (Minimum Detectable Effect, MDE) 严格数学推导 (A/B Test Minimum Sample Size Formula & MDE Power Derivation) 是任何实验上线前计算“实验需要跑几天、分流百分比是多少”的黄金计算准则;在双样本均值检验下,设定显著性水平 与功效 1 - ,两组样本量相等的每组所需样本量公式严格推导为:n = (z_ /2 + z_ )^2 2 ^2 ^2(其中 = | _T - _C| 为预期效应绝对值, ^2 为指标总体方差);对于二项分布比率指标(如 CTR/CVR,均值为 p),方差替换为 ^2 = p(1-p),得到:n = (z_ /2 + z_ )^2 2 p(1- p) ^2;反之,在固定日活流量与实验天数(固定总样本量 n)下,可反解出系统能可靠检测出的最小效应阈值 MDE = (z_ /2 + z_ ) 2 ^2n。 使用场景: 实验前置流量分流规划、实验周期排期评估、微小增益业务场景下的功效算力预算。 解决的问题: 样本量过小会导致实验功效不足(即使有提升也因噪声过大无法达到统计显著),样本量过大会浪费宝贵的用户流量和拖慢产品迭代周期;样本量公式提供了精确的流量优化边界。

核心要点

  • 从正态分布分位数临界值定义出发,现场手写完整推导出样本量公式 n = (z_ /2 + z_ )^2 2 ^2 ^2 的每一步几何代数变换?
  • 当想要检测的提升幅度 缩小一半(例如从 2\% 缩小到 1\%)时,为什么所需样本量不是翻倍,而是剧增为原来的 4 倍(平方反比律)?
  • 不平衡分流 (Unequal Traffic Allocation: 如 90% 对照 vs 10% 实验): 如何使用调和平均数公式计算等效有效样本量 n_ eff = 2 n_T n_Cn_T + n_C?
  • 实验运行周期计算:为什么 A/B 测试通常必须跑满至少 1 到 2 个完整周(7~14 天),以消除“周内效应 (Day-of-Week Seasonality)”?
  • 长尾高方差指标(如用户消费金额 Revenue / GMV)的样本量爆炸问题:如何通过对数变换、极端值截断 (Winsorization) 或 CUPED 压缩方差?