Lite / Independent Engineering Research / Week 32
Randomisation and confounding
You test gripper A all morning and gripper B all afternoon. B looks worse. Is it the gripper, or the tired battery?
Why should I care?
Confounders are the most common reason a careful-looking experiment gives the wrong answer. Randomisation is the cheapest protection ever invented: it costs nothing but a seed.
- Identify a confounder that varies with the condition.
- Compare blocked, alternating, counterbalanced and randomised trial orders.
- Explain why repeating a confounded design does not remove its bias.
Predict
True effect 0, battery drains steadily, all A trials first then all B. On average, what will B − A show?
- About 0
- A negative 'effect' caused by the battery
- A positive effect
- It depends only on noise
Guess first, then reveal
B always runs on a weaker battery, so the drift appears as a false negative effect. Repeating this design gives the same wrong answer every time.
Discover
Set the true effect to 0 and drift to 10. Compare the bias over 300 repeats for each trial order. Then set drift to 0: does the order still matter? Finally set a true effect of 2 with drift 10: which schedule recovers it?
What the interactive shows (text version)
The confounding simulator plots 24 trial scores in order; circles are condition A and squares condition B. A battery drift lowers later trials. Choosing the order (blocked, alternating, ABBA, randomised) changes the estimated effect; the readout gives the average bias over 300 repeated sessions.
Watch (optional)
Watch for: Note how random assignment and blinding are introduced, and which confounders each protects against.
Control groups, randomisation and blinding: the ideas that make a comparison fair, explained with everyday examples.
“Controlled Experiments: Crash Course Statistics #9” by CrashCourse (opens YouTube; streaming video uses a lot of data)
The video is optional. Everything you need is in this lesson's text.
Understand
Confounders
A confounder affects the outcome and changes along with the condition. Time of day, battery level, simulator warm-up, operator fatigue and the order of trials are classic ones. If a confounder is perfectly aligned with the condition, no statistics can separate them.
Breaking the link
Randomising the order makes the confounder independent of the condition on average. Counterbalancing (ABBA) cancels linear drift by design. Blocking groups trials by a known nuisance (e.g. per battery) and compares within blocks. All are better than 'all A then all B'.
Bias versus noise
Randomisation turns bias into noise: the confounder still adds variation, but it no longer pushes the estimate one way. More runs then shrink the noise. More runs of a confounded design only make you more confident in the wrong answer.
Explain it another way
Intuitive
If you always test the new shoes on downhill runs and the old ones uphill, the new shoes will look fast whatever they are.
Technical
Random assignment ensures that, in expectation, every pre-existing or time-varying factor is balanced between conditions, so E[estimate] = true effect.
Mathematical
With linear drift −D·t over n trials, blocked ordering gives bias ≈ −D/2 (the B block sits half a session later); randomised ordering gives bias with mean 0.
Applied
Simulators have confounders too: caches warming, adaptive step sizes, thermal state of a modelled motor. Seeded random ordering of conditions applies there as well.
Worked example 1
Drift lowers scores by 10 points over a 24-trial session. Blocked order, no true effect. Expected estimate?
A trials sit at positions 0–11 (average drop ≈ 2.4), B at 12–23 (≈ 7.6). Estimate ≈ −5.2: a false effect about half the total drift.
Common mix-ups
Alternating ABAB is as good as randomising.
✓ Alternation handles slow drift but can align with any periodic nuisance; randomisation protects against confounders you have not thought of.
Practice
Practice, not a test. Answers are checked on our server; a wrong answer gets a hint and another try. Nothing is saved.
Apply it
List three possible confounders in your capstone (including order and simulator state). For each, say whether you will randomise, counterbalance, block or hold it fixed, and record the seed you will use.
Reflect
Which confounder in your project would you never have noticed without being asked?
Write your answer on paper or in your own notes. Lite never stores what you write.