A/B test: sample size per group
A statistics problem from Statisticsdrill. Solve it with one answer box, with a fresh sample on every attempt and the worked steps and spreadsheet function in the answer, and it is checked the moment you submit.
The task
You plan an A/B test on a page that converts at 4% and want to detect a rise to 5% with a two-sided test at α = 0.05 and 90% power. Use n = (z_α/2 + z_β)² × [p1(1 - p1) + p2(1 - p2)] / (p2 - p1)², with z_α/2 = 1.96 and z_β = 1.28. How many visitors are needed in each group? Round up. Give a whole number.
What this problem teaches
Halving the difference you want to detect roughly quadruples the sample size.
A hint if you get stuck
Add the two z values and square the sum, multiply by the sum of the two variances p(1 - p), and divide by the squared difference. Always round a sample size up.
Try it now, free, no account needed
The first 15 tasks on Statisticsdrill are free. Open it on the practice page, solve it, and get instant feedback with a hint. A free account adds the worked solution; Pro unlocks every task, timed mode and the certificate.
Open this problemMore problems in Inference
- Critical t value for an interval
- Margin of error for a mean (t)
- Confidence interval for a proportion
- Sample size for a mean
- Sample size for a proportion
- One-sample t statistic
- Two-sided t test: p-value and decision
- One-sided t test: p-value and decision
- Two-proportion z test
- Paired t test
- Chi-square test of independence (2 x 3)
- Chi-square 2 x 2: p-value and decision
- Two-sample t test (pooled)
- Welch t test: degrees of freedom and decision
- Confidence interval for a difference of means
- Chi-square goodness of fit
- One-way ANOVA F statistic
- Power of a one-sided z test
- Bonferroni: how many tests survive
- Benjamini-Hochberg: how many discoveries
- Margin of error for a mean (z, σ known)
- One-sample z test (σ known)
- One-proportion z test
- Effect size: Cohen's d
- Chi-square: expected count of a cell