# Correct expression for experimental data

I am doing practices at the laboratory. I have some doubts about how to express correctly the errors; I read some pdfs in Google but I can't solve these questions:

• Sometimes, it's correct to write two digits in the error. For example, I'm sure that $1.23\pm0.12$ is correct; also $3.82\pm0.24$ is correct; $4.25\pm0.26$ is not correct and should be written as $4.3\pm0.3$. My question is: is $3.82\pm0.19$ correct? My book don't say it clearly. I think that it is correct, but not sure.

• In my data I've found things like this: 1.79568, with error 0.9605. How should I express that? I think is $1.80\pm0.96$, but I'm not sure because it doesn't follow the previous rule. I've been looking for a solution in Google and here in the Physics Stack, but I am not able to find a great answer.

I know it's a basic question, but it's important to know it. Thank you very much!

• Actually, this is a really important question (how many digits to write in the uncertainty) and if it's not already covered on the site, I'm glad you asked it. Also I'm not sure it qualifies for the homework tag. Not saying you were wrong to put it there, but you've made the question general enough that it would be fine without the tag, I think. – David Z Dec 1 '13 at 5:05
• I also was surprised to discover nobody covered this on the site. Well, I used homework tag because these are my homeworks :D But I agree that this is a very interesting topic. Sometimes is difficult to write correctly experimental errors. – VictorSeven Dec 1 '13 at 12:51

## 3 Answers

When quoting results, there are a few good rules to follow:

1. Avoid rounding errors in intermediate calculations.
2. Write your error to 1 significant figure if your data set is smaller than $10^2$, 2 if it's smaller than $10^4$ etc.
3. Write your estimate and its error with the same number of decimal places.

Rules 1. and 3. are simple to understand. Rule 2. originates from the fact that the sample variance of a Gaussian distribution has a fractional standard error $\propto 1/\sqrt n$. To justify two significant figures in the sample variance, that standard error ought to be less than 10%, hence $n>100$.

• +1 Point 1 is almost "obsolete": I haven't used (and have barely seen) a calculator since the mid eighties - I think the last time was in an undergrad exam: any calculation nowadays is going to be put into something like Mathematica, Maple or Excel so that the steps can be tested and debugged without having to go through typing in numbers on a calculator keypad if you bomb it. Although in extreme cases you may need to account for the 1 part in $10^{16}$ roundoff in a 64 bit number (which if you're really keen can be gotten around with arbitrary precision arithmetic in Mathematica). – WetSavannaAnimal Dec 1 '13 at 0:31
• @WetSavannaAnimalakaRodVance I can tell you there's plenty of undergraduates still using calculators to crunch (at least some) lab data; I was one of those until quite recently. It all depends on where you are ;). – Emilio Pisanty Dec 1 '13 at 1:06
• @EmilioPisanty Don't keep reminding me that you're young and I am old :) ... what I wouldn't give to be an undergrad now with the whole magnificent library of the internet ever present from the beginning of my career! – WetSavannaAnimal Dec 1 '13 at 1:14
• ... people got through university degrees without the internet? damn. – Emilio Pisanty Dec 1 '13 at 1:16
• I think rule 1 is still important. Rod Vance has reason: nowadays, everybody uses the computer for experimental data. However, it's very important to keep that rule always on mind. So, following 2, I should use one digit always. However, I read in many texts that if the first digit is 1 or 2, and the second one is lower than 5, I can use 2 digits instead of one. That's why I'm not sure if the error 0.19 is correct. And, with only one digit, write 1.79568 with error 0.96... would be 1.8 +- 1.0 ? Because I can't write 1 +- 1, that has no sense. Thanks for the answer! – VictorSeven Dec 1 '13 at 12:47

I'd simply like to add to Innisfree's very sound answer.

Three points:

# Don't Round Off in In-Between Steos

Innisfree's point 1 is almost "obsolete": I haven't used (and have barely seen) a calculator since the mid eighties - I think the last time was in an undergrad exam: any calculation nowadays is going to be put into something like Mathematica, Maple or Excel so that the steps can be tested and debugged without having to go through typing in numbers on a calculator keypad if you bomb it. Although in extreme cases you may need to account for the 1 part in $10^{16}$ roundoff in a 64 bit number (which if you're really keen can be gotten around with arbitrary precision arithmetic in Mathematica)

# General Theory

The general rule behind Innisfree's point 2 and explanation is as follows. Suppose your data processing algorithm amounts to reckonning some function $f(\{a_j\})$ of the data $a_j \in \mathbb{R}$. There are uncertainties in your data, and statistical fluctuations in your data will beget a corresponding "cloud" of possible values in $f$. So we think of the $a_j\in A_j$ wandering about in little open balls $A_j \subset\mathbb{R}$ around their "supposed" values (we imagine an ensemble of identical experiments), and these balls represent the uncertainty in your observations - the precision of your instruments as calculated from signal to noise floors or manufacturer's data, for example. The "cloud" of values that the processed result you will plausibly see if your theory is true is the image set $f(A_1,\,A_2,\,A_3\,\cdots)$. If the uncertainties in $a_j$ are "small" (i.e. such that a first order, linear Taylor series is accurate for every value in each little ball $A_j$), then we can calculate the "cloud" of plausible values as follows. The total variation in $f$ given variations $\delta a_j$ in your data are approximately:

$$\delta f \approx \sum_j \frac{\partial f}{\partial a_j} \, \delta_{a_j}$$

so, if the data $a_j$ have means $\mu_j$ and variances $\sigma_j^2$, then often a good statistical model for the variation in $f$ is that $f$ is a normally distributed random variable with mean and variance given by:

$$\mu = f(a_1, a_2, \, \cdots)$$ $$\sigma^2 = \sum_j \left(\frac{\partial f}{\partial a_j}\right)^2 \, \sigma_j^2$$

The addition of variances means that the standard deviations sum by a Pythagorean sum, hence Innisfree's rule number two.

# Practical Procedure

Mostly the above is way more technical than you're going to need. Moreover, in practice (particularly with a many-step data processing algorithm) if you do need to bring it to bear on your data, the way to calculate uncertainties is with a sensitivity analysis using the spreadsheet or Mathmatica notebook or whatever you use for processing. Have a random number generator peturb the inputs to your calculation with uniformly distributed pseudo-random variables of variance in line with the data's signal to noise ratio or manufacturer's uncertainty expression. Note the processed results and repeat again and again with new random inputs. After, say, 100 tries, you should see your results following normal distributions and you can use, say $\pm 3 \sigma$ as your uncertainty.

The good thing about this method is that it will definitively find things like pathological (numerically unstable) recurrences in a many step data processing algorithm out. This is fairly seldom, and more often seen in things like numerical working out of things like Bessel functions by a recurrence relation. However, it is utterly disastrous when it happens and you need to know that you cannot rely on foretold values of $f$ from experimental data when it does; furthermore I have indeed seen it happen once or twice in the processing of measured data before. In such a case, you need to work backwards by adjusting the uncertainties (shrinking them) of your input perturbations until those seen in the variation of your processed results are reasonable for your purposes. By doing this you know how precise your measurements must be to make a meaningful conclusion to your experiment. It might well be that the conclusion is that such precision is unreachable with the instruments and procedures you are using: the experiment is therefore and cannot be other than inconclusive in its present form. You can then use these specifications to design better experiments, or to tell you what can and can't be found out experimentally.

I think there are no strict guidelines. Two significant digits for the uncertainty is a good rule of thumb, and I am not sure why $4.25 \pm 0.26$ would be incorrect: if you need to use this uncertainty in further calculations, keeping the second digit can avoid rounding errors.

See here (section 7.2.6) for an authoritative reference.