Back to the on-screen lesson ·
The two ways of saying how wrong an answer is, why only one of them compares across scales, and how a relative error becomes a count of correct digits.
Paper packet. Every task here also exists on screen, where it is checked automatically; answers written on paper are not assessed by Nydus. When you are back at a device, enter your answers there.
By the end of this lesson you will be able to compute the absolute and relative error of a result, convert a relative error into a count of correct significant digits, and say which of the two to quote and why.
You know that a floating-point format stores a value to a fixed number of significant bits, so the error it makes is proportional to the size of the number rather than a fixed amount. This lesson gives that idea its two names and settles which one to quote.
The absolute error is $|x - \hat{x}|$, in the units of the quantity. The relative error is $\dfrac{|x - \hat{x}|}{|x|}$, a pure number. A value is correct to $k$ significant digits when its relative error is about $10^{-k}$. A bound on an error is a statement that it is no larger than something; it is not a claim about how large it actually is.
There are two honest ways to say how wrong an answer is, and they answer different questions. The absolute error $|x - \hat{x}|$ answers by how much, in the units of the thing; it is what you want when the units matter — a bridge out by three centimetres. The relative error $\dfrac{|x - \hat{x}|}{|x|}$ answers by what proportion; it is what you want when you are comparing accuracies, because it means the same thing at every scale. Floating point controls the second and says nothing about the first: storing a number costs a relative error of at most $\varepsilon/2$, whether the number is a millionth or a million. The bridge between the relative error and ordinary speech is the significant digit: a relative error near $10^{-k}$ and about $k$ correct significant digits are the same statement. Errors of a product or quotient add relatively; errors of a sum or difference add absolutely, which is the crack the next lesson prises open.
Another way: steps
Another way: example
Storing $\pi$ as $3.1416$ leaves an absolute error of about $7.3 \times 10^{-6}$ and a relative error of about $2.3 \times 10^{-6}$ — so about five and a half correct significant digits, which is what the five printed digits promised.
Two answers that are out by the same amount are not equally accurate. This sounds obvious written down and is hard to hold on to in practice, because an error message reports one number and does not say which kind it is. When a tolerance is quoted with no units, it is relative; when it has units, it is absolute; and a routine that takes both is asking you to decide which matters here — near zero, where the relative error of everything is enormous, the absolute one is usually the only sane test.
A true value of $1000$ is computed as $1003$, so the absolute error is $3$.
Subtract first.
The relative error is $\dfrac{3}{1000} = 0.003$, which is $0.3$ per cent.
Divide, then scale.
A relative error near $10^{-3}$ is about three correct significant digits, and indeed $1003$ agrees with $1000$ in its first three.
The digit count is the same fact.
A radius is known to eight digits and a density to two; the mass needs both.
Relative errors of a product add.
The relative error of the mass is about $10^{-2}$, because the density's error swamps the radius's.
The larger term wins.
Measuring the radius to sixteen digits instead would not change the answer's accuracy at all.
Spend the effort on the weak input.
The absolute error is $1$, in whatever units the length is in.
The relative error is $\dfrac{1}{200} = 0.005$, or half a per cent.
That is a relative error a little above $10^{-3}$, so between two and three correct significant digits.
A quantity whose true value is $100$ is computed as $102$. Report the error three ways.
| Absolute error | Relative error | Per cent | |
|---|---|---|---|
| This computation |
A journey of $24$ kilometres is measured $1$ metre out, and a rod of $8$ metres is measured $1$ metre out. Which statement is right?
A computation has returned a value and you know the true one. Put the five steps of reporting the error to $5$ digits into the order you carry them out.
Number the steps in order (write the number in the box):
Match each way of reporting an error to what it is.
| An absolute error, in the units of the thing measured | A relative error, written as a count of digits | A relative error, written as a proportion | A relative error of at most half a machine epsilon | |
|---|---|---|---|---|
| Out by $3$ millimetres | ||||
| Correct to $7$ significant figures | ||||
| Out by $3$ parts in a thousand | ||||
| Rounded to the nearer stored number |
Two lengths are each known to within $1$: one is $31$ and the other is $27$. What is the largest the relative error of their difference can be? Give a fraction.
Answer:
Lesson test: one question per skill, one attempt each, no hints. Your answers are checked when you submit.
A value is computed with a relative error of about $10^{-10}$, and is then multiplied by a quantity known only to a relative error of $10^{-5}$. About how many correct significant decimal digits does the product have?
Answer:
You can report an error in units, in proportion and in digits, and you know which input limits the accuracy of a product. Say in your own words why two answers out by the same amount need not be equally accurate.
8. Your turn: a length of $200$ measured as $199$, step 3