Read a distance sensor ten times while nothing moves, and you get ten slightly different numbers. That scatter is noise.
Key idea
Noise is measured by its standard deviation $\sigma$. Averaging $N$ independent readings gives an average whose standard deviation is $\sigma/\sqrt{N}$.
Why it works
Random errors partly cancel when you add them, but not completely. The spread of a sum grows like $\sqrt{N}$, so the spread of the average, the sum divided by $N$, shrinks like $1/\sqrt{N}$. The Math Ladder's statistics topics show why.
Worked example: Shrink the noise
One reading has $\sigma = 2\ \text{cm}$. Average 16.
- $2/\sqrt{16} = 0.5\ \text{cm}$.
Answer: 0.5 cm.
Worked example: How many?
To cut the noise to a third?
- $\sqrt{N} = 3$, so $N = 9$.
Answer: 9 readings.
Common mistake
Expecting averaging 4 readings to cut the noise to a quarter. It halves it. And averaging slows the robot's reaction, because old readings stay in the average.