The formula itself isn't hard once you remember it: n per group = ((z_alpha/2 + z_beta)^2 * 2 * sigma^2) / delta^2, then double it and ceil.
Start by clarifying the assumptions: two-sample z-test, equal group sizes, and known variance estimated from the baseline array. Derive the sample size formula using the standard normal quantiles for the significance level and power, then compute the required total sample size as twice the per-group size, rounding up to the nearest integer.
Pro tip: Mention that in practice, you'd use the baseline variance but also consider using a pooled variance or a more robust method if the metric is skewed; also note that the formula assumes independent observations and no peeking, which is critical for valid A/B tests.
Confirm that the baseline array provides the variance (or standard deviation) of the metric, and that the test is two-sided with equal group sizes. State that the z-test assumes known variance and normally distributed data (or large samples).
Use the standard formula for two-sample z-test: n per group = ( (z_{1-α/2} + z_{1-β})^2 * (σ_1^2 + σ_2^2) ) / Δ^2, where σ_1^2 = σ_2^2 = variance from baseline, and Δ is the minimum detectable effect. Total sample size = 2 * n per group.
Calculate the z-scores for the given significance level (α) and power (1-β) using the inverse normal CDF. Compute the variance from the baseline array, then substitute into the formula.
Since sample size must be an integer, round up the per-group size to the nearest whole number, then double it to get the total sample size. Return that integer.
Mention that this is a simplified calculation; in practice, you might adjust for unequal group sizes, use t-test for small samples, or account for multiple testing. Also note that the baseline variance might be estimated from historical data.
AI-generated suggestions, not part of the candidate's original notes. May be inaccurate — verify before relying on them.