Suppose an accurate scale reports weight rounded to the nearest unit. If it reports the weight of an object as "6", all I know is that it could actually weigh anywhere between 5.5 and 6.5. But I need a more precise value for the weight.
Instead I could weigh myself twice, once holding the object and once not holding it, and take the difference as the measurement. I then repeat the same procedure with nine more people. 4 of us report "5" and 6 of us report "6", for an average result of 5.6.
And with 100 people, I might get 42 "5"s and 58 "6"s, for an average of 5.58.
If 5.58 actually is the correct weight, consider these results:
#!/usr/bin/env python3
import random
actual = 5.58
for digits in range(1,10):
n = 10 ** digits
sum = 0
for i in range(n):
test = random.random()
sum += round(test + actual) - round(test)
print(n, sum/n)
./weigh.py
10 5.2
100 5.55
1000 5.58
10000 5.5871
100000 5.58281
1000000 5.580323
10000000 5.5802115
100000000 5.57997507
1000000000 5.5799838
The more people, the greater the precision of the resulting average, but what is that precision?
What is the formula that gives the statistical precision based on the number of measurements?
f(number-of-samples, %-confidence) = decimal-places
Or gives the number of samples required to produce a specified precision:
f(decimal-places, %-confidence) = number-of-samples
The variance of the uniform distribution from $a$ to $b$ is $\frac 1{12}(b-a)^2$ Variances add if the variables are uncorrelated, so the variance of the sum of $n$ variables is $\frac n{12}(b-a)^2$. The standard deviation of the sum goes as $\sqrt n$ and the standard deviation of the average as $\frac 1{\sqrt n}$