Your current click-through rate is 10%. How many users per arm does an A/B test need to detect an absolute increase to 11%, with a two-sided significance level of 5% and 80% power?

ML systems and evaluation, Online experiments
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can turn a significance level, power and effect size into a sample size, and know what drives it.

Key idea

For two proportions, n≈(z1−α/2+z1−β)2 [p1(1−p1)+p2(1−p2)](p2−p1)2 per arm. Here zq is the point below which a standard normal variable falls with probability q: z0.975=1.96 and z0.8≈0.84.

Steps

  1. State the test: H0:pA=pB against H1:pA≠pB, with α=0.05 (false-positive rate) and power 1−β=0.8 at the minimum detectable effect Δ=0.01.
  2. Explain the formula: the difference of the two sample proportions has standard error (p1(1−p1)+p2(1−p2))/n, and the gap Δ must be z1−α/2+z1−β standard errors wide.
  3. Variance term: 0.1×0.9+0.11×0.89=0.09+0.0979=0.1879.
  4. (1.96+0.84)2=2.802=7.84, so n≈7.84×0.1879/0.012≈ 14,730 users per arm, or about 29,500 in total.
  5. Interpret: n∝1/Δ2, so detecting a 0.5-point lift needs about four times as many users. Fix the sample size in advance; stopping as soon as p<0.05 ("peeking") inflates the false-positive rate.

Common mistakes

How long your answer should be

The formula and three lines of arithmetic; about 3 minutes.

Last checked on 4 December 2026.

Read this

Previous in ML systems and evaluation: How do accuracy, F1 score and ROC-AUC compare as evaluation metrics for a binary classifier, and when is each appropriate, considering threshold dependence, class imbalance and whether each measures ranking quality or decision quality (use a small confusion-matrix example)?
Next in ML systems and evaluation: A calibrated fraud model outputs p=P(fraud∣x). Missing a fraud costs ₹10,000 and flagging a legitimate transaction costs ₹1,000 in review effort. Derive the cost-minimising threshold. What would you do if the model were not calibrated?