research32 min studyLesson 91 in Engineering

Experiment design and statistical power

Turn a systems performance claim into an experiment with a meaningful effect size, independent units, and an uncertainty budget.

On this page

What you’ll understand

  • Define an experimental unit and a practically relevant effect.
  • Estimate sample size under explicit distributional assumptions.
  • Separate an exploratory finding from a confirmatory comparison.

A new scheduler completes one training run seven percent faster. That observation might reflect the scheduler, a cooler machine, a different sequence of batches, or ordinary variation between runs. Research begins by deciding which explanation the experiment can distinguish. Write the claim before collecting the confirmatory measurements: for a named workload and hardware configuration, the proposed scheduler reduces mean completion time by at least a useful amount while meeting the same quality target. A narrow, testable claim is more valuable than an impressive unexplained number.

Choose the unit that actually receives the intervention

The experimental unit is the independently assigned entity: perhaps a complete training run, a machine-day, or a randomized service request. Ten thousand steps inside one run do not automatically provide ten thousand independent replications. They share initial weights, cache state, hardware, and often strongly correlated load. Treating them as independent understates uncertainty. Record nested measurements for diagnosis, but estimate uncertainty at the assignment level or use a model that represents the dependence.

Blocking can reduce noise by comparing alternatives within the same hardware or time window. A paired experiment might run both schedulers on each of several workload seeds, with execution order randomized within each pair. Pairing is useful only when the pairing variable induces meaningful correlation. Avoid always running the baseline first, because warm caches, thermal drift, or background traffic would then be confounded with the treatment. Define exclusion rules and failure handling before discovering which runs favor the proposal.

SE⁡(dˉ)=sdn\operatorname{SE}(\bar d)=\frac{s_d}{\sqrt n}
For n independent paired differences d with finite variance, sd is their sample standard deviation. This estimates uncertainty of the mean difference; it is not the spread of individual run times.↔ Scroll wide equations horizontally.

Plan for an effect worth detecting

Power is the probability that a specified test rejects its null under a specified alternative. It depends on effect size, variability, sample count, and the analysis procedure. Decide the smallest improvement that would justify adoption, rather than choosing the effect after inspecting results. Estimate variability from an independent pilot or conservative historical evidence. If the pilot is tiny or the workload has heavy tails, a normal approximation can be optimistic; simulation or a design-specific calculation may be needed.

The usual two-sided normal planning expression for paired mean differences assumes independent, approximately normal differences and a known or reasonably estimated standard deviation. It is an approximation when variability is estimated. A small-sample t calculation may require more runs. Repeatedly checking significance and stopping at the first favorable result also changes the error rate. Predeclare a fixed sample plan or a valid sequential procedure. Detecting a nonzero effect with power calculated at δ does not establish an improvement of at least δ; an adoption rule should compare an appropriate effect interval with its practical threshold.

n≈((z1−α/2+z1−β)σdδ)2n\approx\left(\frac{(z_{1-\alpha/2}+z_{1-\beta})\sigma_d}{\delta}\right)^2
For the paired normal planning model, δ is the nonzero mean difference to detect, σd the difference standard deviation, α the two-sided false-positive probability, and 1−β the target power. Round up and revisit uncertain assumptions.↔ Scroll wide equations horizontally.

Report the decision and its limits

Present the effect estimate and an interval, along with individual run outcomes, rather than only a p-value. A statistically detectable one-millisecond gain can still be operationally irrelevant. Conversely, an inconclusive result is compatible with a useful improvement if the experiment is too noisy. Report quality failures and resource costs alongside speed; a scheduler that silently drops difficult examples has changed the task. Distinguish an intention-to-run comparison from an analysis restricted to successful runs.

If many configurations were explored, identify that stage as exploratory and reserve fresh runs for confirmation. Include negative outcomes and sensitivity to workload composition. An interval from one machine family describes uncertainty within that experiment, not automatic generalization to every cluster. The next experiment should challenge the weakest assumption: alternate hardware, a different load regime, or independent implementation. This makes the research program cumulative rather than a sequence of isolated favorable screenshots.

Budget a paired scheduler experiment

A pilot suggests paired completion-time differences have standard deviation 6 seconds. Detect a 3-second mean reduction with two-sided α=0.05 and approximately 80% power. Each pair requires two ten-minute runs.

  1. Use the planning normal quantiles 1.96 and 0.84; their sum is 2.80.

  2. Compute (2.80 × 6 / 3)² = 31.36, then round up to 32 independent pairs.

  3. Thirty-two pairs require 64 runs, or 640 machine-minutes before setup and failures.

  4. This is an approximate plan, not a power certificate: validate pilot variance, account for the small-sample procedure, and randomize order within each pair.

The result

Plan approximately 32 pairs and at least 10 hours 40 minutes of machine time, then refine using the actual test and variance uncertainty.

Explore the model

Interactive lab

Interactive lab · probability

Count independent successful replications

Vary success probability p and independent trial count n to inspect the exact binomial distribution with mean np and variance np(1−p). Treat success as a predeclared binary run criterion. The diagram does not calculate power for a paired continuous-time test or resample experimental observations.

Count independent successful replicationsThese are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Current readings: Mean · np: 5; Variance · np(1−p): 2.5; Total probability: 1. All parameters are adjustable with the labeled controls below.03581000.070.150.220.3Successes kP(X = k)k = 0 · P = 9.77e-4
Exact probabilityHighlighted outcomeMean np
Mean · np
5
Variance · np(1−p)
2.5
Total probability
1
t = 0 s

These are exact binomial probabilities for independent trials with one fixed success probability. Playback tours the distribution; it does not resample outcomes. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.

Look forMore independent observations narrow relative uncertainty, but a binomial assumption must match the recorded outcome.

Check your understanding

A researcher records 10,000 correlated step timings from one run per scheduler. What most threatens the reported narrow confidence interval?

Try it yourself

Under the same paired normal planning model, what happens to the required sample count if the target effect is halved and the standard deviation stays fixed? Explain why changing the significance threshold after observing results is a separate issue.

Take a moment to make a prediction or work it out on paper. Open a hint when you need one.

Give me a hint

The effect appears in a squared denominator; error control depends on the complete decision procedure.

Compare with the solution

Halving δ multiplies the approximate sample count by four. The original 31.36 becomes 125.44, so at least 126 pairs under this approximation. Choosing a threshold after viewing favorable outcomes changes the procedure's false-positive behavior; more samples alone do not repair that selection.

Take it with you

  • Count independent assignment units rather than convenient log entries.
  • Power is conditional on an effect, variability, and a specified analysis.
  • Report practical effect size, uncertainty, quality, and resource cost together.

Read further

Original sources and deeper explanations to follow at your own pace.

Optional progress, saved in this browser when available. Revisit any lesson at any time.

Lesson not marked complete.