Optimal Experiment Sample Sizes for Bayesian A/B Tests

Demetri Pananos24 Feb 2026

Problem

A product team can enrol only a fixed number of subjects per week, so every experiment competes with the next one for traffic. Small experiments finish fast but rarely detect a real improvement. Large ones detect more, yet only a few fit in a quarter. Per-experiment power curves do not say which size to pick.

Example from the article: 2,500 subjects per week, experiments run back to back, and a prior of Normal(0.005,0.012) for the true effect.

Solution in brief

Compute the expected impact of one experiment at each sample size for a given decision rule. Multiply it by the number of experiments that fit in a quarter at that size. The sample size where this cumulative quarterly impact peaks is the size to use, and simulation then shows how widely the real outcome can scatter around that expectation.

Questions this case answers
  • How to pick the size of each experiment when a fixed traffic budget is split between many sequential experiments and bigger tests mean fewer tests
  • How to compare decision rules for shipping a change by expected cumulative impact rather than by error rates
  • How to choose the sample size of each A/B test when the team can enrol only a fixed number of subjects per week?
  • How to compare ship/no-ship decision rules by the impact they deliver over a quarter, not per experiment?

Tools and methods

  • Bayesian A/B test — each result is analysed with a prior on the effect and a ship rule.
  • Expected impact curve — closed-form approximation of impact per experiment against sample size N, checked by simulation.
  • Monte Carlo simulation of quarters — gives the spread of cumulative impact, not only its mean.
Continue reading — it's free

Google or a one-time email code. No password.