How many trials does a robot evaluation need?

Twenty trials cannot tell a 70% policy from an 80% policy. These two calculators show what your trial count can support.

What does k out of n tell you?

Observed rate
70.0%
Wilson interval at 95% confidence
[48.1%, 85.5%]

With 14 of 20 successes, the true success rate is plausibly anywhere from 48% to 85%.

How many trials to tell two policies apart?

Design
Trials per policy
294

To tell a 70% policy from an 80% policy at significance 0.05 with 80% power, run 294 independent trials per policy, 588 in total.

How the numbers are computed

The first calculator uses the Wilson score interval. The usual normal approximation, the rate plus or minus a multiple of its standard error, is unreliable at small n and near 0% or 100%: it can run past 100%, and for 20 of 20 successes it collapses to a single point. The Wilson interval stays inside 0% to 100% and keeps close to its stated coverage at the trial counts common in robot evaluation.

For independent trials, the second calculator uses the normal-approximation sample size for two proportions with a two-sided test and pooled variance under the null, without continuity correction. Here p is the mean of the two rates. For 70% against 80% at significance 0.05 and power 0.8 it gives 294 trials per policy.

n = (z1-α/2 √(2p(1-p)) + zpower √(pA(1-pA) + pB(1-pB)))² / (pA - pB)²

Running both policies on identical seeds or initial conditions removes the variation between scenes from the comparison. Only the seeds where the two policies disagree carry information, and McNemar's test uses those. The paired count uses the discordant-pair formula, where ψ is the fraction of seeds on which the policies disagree and δ is the difference between the two rates.

n = (z1-α/2 √ψ + zpower √(ψ - δ²))² / δ²

If the two policies succeeded independently, ψ would be pA(1-pB) + pB(1-pA) and pairing would save almost nothing. Policies on the same seeds usually agree more often than that, because hard scenes are hard for both, and each additional point of agreement lowers the count.

Want a second pair of eyes on your protocol? Protocol review, $450