Types of difference
Many quantities compare two things by “how far apart” they are. A difference is the result of subtraction and can be negative. No distance is negative. An error compares an approximation with the truth, a change compares the end with the start, and a set difference removes elements.
Definitions
Think of two numbers, one subtracted from the other. The difference of the two numbers is the result of the subtraction: $7 - 3 = 4$, so the difference of $7$ and $3$ is $4$.
Consider two numbers $a$ and $b$. The difference of $a$ and $b$ is the result $a - b$ of subtraction. It depends on the order and can be negative: $3 - 7 = -4$.
Examples
-
$3 - 7 = -4$
$3 - 7 = -4$ is a difference because it is the result of a subtraction.
-
$9.8 - 9.81 = -0.01$, for a measured value $9.8$ and true value $9.81$
$9.8 - 9.81 = -0.01$ is a difference, because it is the result of a subtraction.
Non-examples
-
$\setdef{1, 2, 3} \setminus \setdef{2} = \setdef{1, 3}$
$\setdef{1, 2, 3} \setminus \setdef{2}$ is not a difference of numbers, because removing elements is not subtraction.
Think of two objects, like two houses on a street. The distance between the two houses is how far apart the houses are. No distance is negative.
Consider two points, either on the number line or in the plane. On the number line, the distance between $a$ and $b$ is $\abs{a - b}$. In the plane, the distance between $(x_1, y_1)$ and $(x_2, y_2)$ is $\sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}$.
Consider a metric space with metric $d$, and points $x$ and $y$ in it. The distance between $x$ and $y$ is the value $d(x, y)$.
Examples
-
$\abs{3 - 7} = 4$
$4$ is the distance from $7$ to $3$ (and from $3$ to $7$) along the real number line.
Non-examples
-
$3 - 7 = -4$
$3 - 7 = -4$ is not a distance, because a distance cannot be negative.
-
Walking $3$ m east and then $3$ m west
The distance traveled is $6$ m, not $0$ (the distance between the start and end points is $0$).
Think of an estimate or a measurement of some quantity, like the length of a table. The error of the estimate is how far it is from the true value.
Consider an approximate or measured value $\hat{x}$ of a true value $x$. The error of $\hat{x}$ is how far it is from $x$. The absolute error is $\abs{\hat{x} - x}$, and the relative error is $\abs{\hat{x} - x} / \abs{x}$.
Examples
-
$9.8 - 9.81 = -0.01$, for a measured value $9.8$ and true value $9.81$
$9.8 - 9.81 = -0.01$ is the (signed) error of the measurement, because it compares the measured value $9.8$ with the true value $9.81$.
-
In floating point arithmetic, $0.1 + 0.2$ evaluates to $0.30000000000000004$ due to rounding errors.
The extra $0.00000000000000004$ is an error: the rounding error of floating-point arithmetic.
Think of a quantity that goes up or down, like the temperature during a day. The change in the quantity is how much it went up or down: its final value minus its starting value.
Consider a quantity $x$ with an initial value and a final value. The change in $x$ is the final value minus the initial value:
\(\Delta x = x_{\text{final}} - x_{\text{initial}}.\) It is negative when the quantity decreases.
Examples
-
A temperature that goes from $20$ to $15$ degrees
The change in temperature is $\Delta T = 15 - 20 = -5$ degrees, the end value minus the start value.
Think of a moving object, like a ball rolling across a floor. The displacement of the object is how far, and in which direction, it ended up from where it started.
Consider an object that moved from a starting point $P$ to an ending point $Q$. The displacement of the object is its change in position, as a vector from $P$ to $Q$.
Examples
-
Walking $3$ m east and then $3$ m west
The displacement of the walk is $0$, because the walk ends where it started.
Properties
- The length of the displacement is the straight-line distance between the start and the end, which is at most the distance traveled along the path.
Consider1 two sets $A$ and $B$. The set difference $A \setminus B$ is the set of elements of $A$ that are not in $B$.
Examples
- $A = \setdef{1, 2}$ and $B = \setdef{3, 4}$ : $A \setminus B = \setdef{1, 2}$
-
$\setdef{1, 2, 3} \setminus \setdef{2} = \setdef{1, 3}$
$\setdef{1, 2, 3} \setminus \setdef{2}$ is a set difference because it removes the elements of $\setdef{2}$ from $\setdef{1, 2, 3}$.
Examples
| Example | difference | distance | error | change | displacement | set difference | Why |
|---|---|---|---|---|---|---|---|
| $3 - 7 = -4$ | ✓ | ✗ | – | – | – | – | |
| $\abs{3 - 7} = 4$ | – | ✓ | – | – | – | – | |
| $9.8 - 9.81 = -0.01$, for a measured value $9.8$ and true value $9.81$ | ✓ | – | ✓ | – | – | – | |
| A temperature that goes from $20$ to $15$ degrees | – | – | – | ✓ | – | – | |
| Walking $3$ m east and then $3$ m west | – | ✗ | – | – | ✓ | – | |
| $\setdef{1, 2, 3} \setminus \setdef{2} = \setdef{1, 3}$ | ✗ | – | – | – | – | ✓ |
Notes
- An offset is a fixed amount added to shift a value or position, such as $b$ in $y = m x + b$. A translation (or shift) moves every point by the same offset.
- “Difference” is used loosely for many of these, so check whether a technical meaning is defined.