TactivergeLite

Lite / Intelligent Robotic Systems / Week 32

How many runs is enough?

One run says the new filter halves the error. The next run says it makes things worse. How many runs before you believe either?

About 35 min · 3 goals · Checked by automated tests · Full interactive version

Why should I care?

Noisy sensors and random disturbances mean any single run can mislead. Repeating trials estimates how much results wobble, and the standard error tells you how many runs you need before a difference stands out from the wobble.

Predict

To halve the uncertainty (standard error) of a mean, how many more trials do you need?

  1. Twice as many
  2. Four times as many
  3. One more
Guess first, then reveal

Four times as many, because SE = SD/√n. Doubling √n means quadrupling n. Precision gets expensive fast.

Discover

Run the fusion lab several times with the same settings but different noise. Note the final error each time, then compute the mean and SD of five runs by hand. Change the noise level and repeat: how does the SD change?

What the interactive shows (text version)

In the fusion lab, repeating a run with different noise gives slightly different final errors; their standard deviation grows with the noise setting.

You can also open the interactive on the full site when you have a faster connection.

Understand

Mean ± SD, with n

Report repeated trials as mean ± standard deviation (n = …). The sample SD, √(Σ(x − x̄)²/(n − 1)), describes how much single runs vary. Always state n and whether the ± is SD or SE.

Standard error and sample size

The standard error SE = SD/√n describes how uncertain the mean is. To reach a target SE, you need n ≥ (SD/target)². Run a few pilot trials to estimate the SD, then choose n so the SE is small compared with the difference you care about.

Seeds and run order

In simulation, a seed fixes the random noise and disturbances, so a run can be repeated exactly and both methods can face identical conditions. On hardware, randomise the run order so drifts (battery, temperature, wear) spread across conditions instead of favouring one.

Explain it another way

Intuitive

One coin toss tells you little about a coin; a hundred tell you a lot. Each extra toss helps a bit less than the last.

Technical

Sample means are themselves random; their spread shrinks as 1/√n. Seeded simulations remove nuisance variation between conditions (common random numbers), which makes comparisons much more sensitive.

Mathematical

Pilot SD = 4 cm, target SE = 1 cm: n ≥ (4/1)² = 16. Target 0.5 cm: n ≥ 64.

Applied

Simulation studies of controllers and planners typically run every method on the same list of seeds and report the mean and spread across them.

Worked example 1

Five docking errors: 12, 15, 11, 14, 13 mm. Report them.

Mean = 65/5 = 13 mm. Deviations −1, 2, −2, 1, 0; squares sum 10; SD = √(10/4) ≈ 1.58 mm. Report 13.0 ± 1.6 mm (mean ± SD, n = 5). SE = 1.58/√5 ≈ 0.71 mm.

Common mix-ups

Practice

Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.

mm

trials

Practice 4. Why run both controllers on the same list of seeds?
Practice 5. Which number tells a user how much a single run of the robot will vary?

Apply it

Run five pilot trials of any lab or Build metric, compute mean ± SD, and use it to choose n for an SE of one tenth of the mean. State whether that n is affordable.

Reflect

When would you accept fewer trials than the formula suggests?

Write your answer on paper or in your own notes. Lite never stores what you write.

← Change one thingWrite the plan before the runs →