A448 of 56
0 XP
  1. Hook
  2. Predict
  3. Name it
  4. Check
  5. Explain

A4 · Lesson 48 · Statistics of measurements

How sure are you of that average?

You measure a reference voltage 25 times: the readings scatter by a few millivolts around 2.500 V. The average is your best estimate, but how good is it? Ten times as many readings won't make each one less noisy, but it will pin down the average about three times better. Reporting a measurement properly means giving a value with an uncertainty, and that uncertainty comes from a few short formulas that this lesson puts into code.

Predict

The readings scatter with a standard deviation of 4 mV. You average 100 of them. Roughly how uncertain is the average?

Name it

Spread and the uncertainty of a mean

For readings x1,…,xn:

QuantityFormulaIn NumPy
meanx¯=1n∑xkx.mean()
sample standard deviations=1n−1∑(xk−x¯)2x.std(ddof=1)
standard error of the means/nx.std(ddof=1) / np.sqrt(len(x))

ddof=1 gives the n−1 version; NumPy's default divides by n.

For readings whose noise is roughly normal (bell-shaped), the true mean lies within about ±1.96 standard errors of x¯ in 95% of experiments: that's an approximate 95% confidence interval. With fewer than about 20 readings, a slightly larger multiplier from the t distribution is more accurate (A11 covers it).

Histograms

counts, edges = np.histogram(x, bins=20) counts readings in equal bins. Looking at the histogram before trusting a mean and standard deviation catches two common problems: two groups mixed together (two humps) and outliers far from the rest.

Combining uncertainties

When a result is calculated from measured inputs, its uncertainty follows from theirs. For independent inputs, relative uncertainties of a product or quotient add in quadrature, each weighted by its power:

y=V2R⇒σyy=(2σVV)2+(σRR)2

For a sum or difference, the absolute uncertainties add in quadrature: σa+b=σa2+σb2. Adding in quadrature is smaller than adding straight, because independent errors partly cancel; A1's worst-case sum is the pessimistic bound.

Combining measurements

Two measurements of the same thing with different uncertainties combine best as a weighted mean, each weighted by 1/σ2:

x¯=x1/σ12+x2/σ221/σ12+1/σ22σ=11/σ12+1/σ22

The better measurement counts for more, and the combination is better than either.

Worked example

25 readings of a reference have a mean of 2.5012 V and a sample standard deviation of 3.0 mV. Report the voltage with a 95% interval.

Show the solution
  1. The standard error. sn=3.0mV25=0.60mV
  2. The 95% interval. ±1.96×0.60mV≈±1.2mV
  3. Report it. 2.5012±0.0012 V (95%).
  4. The small-sample correction. With 25 readings the t-distribution multiplier would be 2.06 instead of 1.96, giving ±1.24 mV, a small correction.

Answer 2.5012±0.0012 V, at 95% confidence.

Worked example

You measure 12.00 V ± 0.5% and 47.0 Ω ± 1% and compute P=V2/R. What is the uncertainty in P?

Show the solution
  1. The power. P=14447W=3.064W
  2. The relative uncertainty. V is squared, so its 0.5% counts twice; combine in quadrature: u=(2×0.5%)2+(1%)2=1+1%=1.41%
  3. The absolute uncertainty. 1.41% of 3.064 W: P=3.064±0.043W
  4. Compare with the worst case. The worst-case bound would be 2×0.5%+1%=2%; the quadrature value is what independent errors typically give.

Answer P=3.064±0.043 W, an uncertainty of 1.41%.

Check

The starter simulates n = 16 noisy readings. Set m, s (sample standard deviation), sem (standard error of the mean) and ci to the half-width of an approximate 95% interval, 1.96× sem.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

The starter's readings are a mix of two groups. Set counts, edges with np.histogram(x, bins=30) and mode_center to the center of the bin with the most counts.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

You compute P=V2/R from V = 5 V (±0.5%) and R = 100 Ω (±5%), both independent. Set P and uP to its relative uncertainty in percent, combined in quadrature.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Two instruments measure the same voltage: x1 = 3.301 V ± 0.002 V and x2 = 3.305 V ± 0.001 V. Set xw to the weighted mean and sw to its uncertainty.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

The starter's 200 readings include a few glitches. Set m and s to their mean and sample standard deviation, then clean to an array of the readings within 3 s of m, n_removed to how many were dropped, and m_clean to the mean of clean.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Readings scatter with a standard deviation of 4 mV. How many must you average to bring the standard error of the mean down to 0.5 mV or less?

Explain why

Why does averaging 100 readings only make the result 10 times more precise, not 100 times?

Practice

Keep practicing

8 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.