Required sample size
Before Tokopedia launches a test, someone has to answer "how long do we run it?" — and an underpowered test is the worst outcome available, because weeks of traffic produce a result nobody can act on.
The sample size per variant for a two-proportion test is:
n = (z_alpha + z_beta)^2 * 2 * p * (1 - p) / mde^2
where p is the baseline rate and mde is the minimum detectable effect in absolute percentage points. power_z holds the two z-values: alpha_two_sided_05 for 5% significance and beta_power_80 for 80% power.
From experiment_plan, return each experiment with users_per_variant — the formula above, rounded up to a whole user. Order by experiment.
Schema
| experiment | TEXT |
| baseline_rate | NUMERIC(6,4) |
| mde | NUMERIC(6,4) |
| kind | TEXT |
| z | NUMERIC(6,4) |
Basic
The example input, expected output, and walkthrough for this question unlock with a Basic plan.
Basic
This is a Basic question
Premium practice questions unlock with a Basic plan. The full solution, expected output, and grading are available to Basic members.