Tutorials › Real Analysis › Absolute Value as Distance

Number Systems · Tutorial 98 of 1000

Absolute Value as Distance

Interpret absolute value as distance on the real line, and translate distance bounds and equations into intervals and points.

Beginner 9 min read

What You'll Learn

  • Define the distance between two real numbers using the absolute value of their difference
  • Verify the basic distance properties from earlier absolute-value results
  • Translate a bound on distance from a fixed point into an interval
  • Describe the points at a specified distance from a center
  • Distinguish the distance from zero from the distance between two numbers

Distance Between Real Numbers

The definition of absolute value tells us that \(|x|\) is nonnegative, but it also gives a way to interpret what that number measures: the distance from \(x\) to zero. To measure the distance between two arbitrary real numbers, we use their difference. The order of subtraction may change the sign of the difference, but absolute value removes that sign without changing the distance.

Definition (Distance on the real line). For real numbers \(x\) and \(y\), the distance between \(x\) and \(y\) is
$$ d(x,y)=|x-y|. $$

The notation \(d(x,y)\) names a function of two real numbers. The difference \(x-y\) records how far apart the numbers are with a sign: it is positive when \(x\) is to the right of \(y\), and negative when \(x\) is to the left of \(y\). Taking absolute value gives the nonnegative distance regardless of which number comes first.

For example, the distance from \(8\) to \(3\) is \(|8-3|=5\). Reversing the order gives \(|3-8|=|-5|=5\), the same distance. This interpretation matches the familiar number line: the distance is the length of the interval between the two numbers, not the signed difference between them.

Worked Example: Finding the Distance Between Two Numbers

Find the distance between \(-\frac{7}{4}\) and \(\frac{5}{2}\). Use the definition, taking the first number minus the second:

$$ d\left(-\frac{7}{4},\frac{5}{2}\right) =\left|-\frac{7}{4}-\frac{5}{2}\right| =\left|-\frac{7}{4}-\frac{10}{4}\right| =\left|-\frac{17}{4}\right| =\frac{17}{4}. $$

Reversing the order gives the same result:

$$ d\left(\frac{5}{2},-\frac{7}{4}\right) =\left|\frac{5}{2}-\left(-\frac{7}{4}\right)\right| =\left|\frac{10}{4}+\frac{7}{4}\right| =\frac{17}{4}. $$

The positive answer is the length of the interval between the two numbers. In particular, subtracting in the opposite order does not produce a negative distance; it produces the same distance after taking absolute value.

Basic Properties of Distance

Distance inherits several important properties from absolute value. The Basic Properties of Absolute Value theorem and the Triangle Inequality established earlier in “Absolute Value” supply the facts we need. In the statements below, these facts are expressed in terms of the distance function \(d\).

Theorem (Basic properties of distance). For all \(x,y,z\in\mathbb{R}\):
  • \(d(x,y)\geq0\), and \(d(x,y)=0\) if and only if \(x=y\).
  • \(d(x,y)=d(y,x)\).
  • \(d(x,z)\leq d(x,y)+d(y,z)\).

Proof. By definition, \(d(x,y)=|x-y|\). The Basic Properties of Absolute Value theorem gives \(|x-y|\geq0\), and says that this absolute value is zero if and only if \(x-y=0\). By the definition of subtraction, \(x-y=0\) if and only if \(x=y\). This proves the first property.

For symmetry, the Basic Properties of Absolute Value theorem gives \(|-u|=|u|\) for every real \(u\). Since \(y-x=-(x-y)\), it follows that

$$ d(y,x)=|y-x|=|-(x-y)|=|x-y|=d(x,y). $$

For the final property, write \(x-z=(x-y)+(y-z)\). The Triangle Inequality, applied to the two terms \(x-y\) and \(y-z\), gives

$$ d(x,z)=|x-z| =|(x-y)+(y-z)| \leq|x-y|+|y-z| =d(x,y)+d(y,z). $$

All three properties follow. \(\square\)

The last property is the triangle inequality for distances: going from \(x\) to \(z\) directly can be no longer than going from \(x\) to \(y\) and then from \(y\) to \(z\). It includes cases where \(y\) lies outside the interval with endpoints \(x\) and \(z\); the inequality still holds. These distance properties also explain why the absolute value of a difference, rather than the difference alone, is the appropriate quantity for measuring separation.

Worked Example: Comparing Direct and Indirect Distance

Take \(x=-3\), \(y=2\), and \(z=6\). The direct distance from \(x\) to \(z\) is

$$ d(-3,6)=|-3-6|=|-9|=9. $$

The distance from \(-3\) to \(2\) is \(5\), and the distance from \(2\) to \(6\) is \(4\):

$$ d(-3,2)=|-3-2|=5, \qquad d(2,6)=|2-6|=4. $$

Thus the triangle inequality holds with equality in this example:

$$ d(-3,6)=9=d(-3,2)+d(2,6)=5+4. $$

Now put \(y=8\) instead, keeping \(x=-3\) and \(z=6\). The two-step distance is \(d(-3,8)+d(8,6)=11+2=13\), while the direct distance remains \(9\). The inequality is strict because the route through \(8\) passes beyond \(6\).

Distance from a Fixed Point Describes an Interval

When one number is fixed, a distance bound describes all points within a specified amount of that number. If \(a\) is the fixed point and \(r\geq0\) is the allowed distance, then the points at distance at most \(r\) from \(a\) form the closed interval from \(a-r\) to \(a+r\). This is the absolute-value bound criterion from “Absolute Value,” applied to the difference \(x-a\).

Theorem (A distance bound describes a closed interval). Let \(a,x\in\mathbb{R}\) and \(r\geq0\). Then
$$ d(x,a)\leq r \quad\Longleftrightarrow\quad a-r\leq x\leq a+r. $$

Proof. By definition, \(d(x,a)=|x-a|\). Apply the Absolute-Value Bound Criterion with \(x-a\) in place of \(x\). Since \(r\geq0\), it gives

$$ |x-a|\leq r \quad\Longleftrightarrow\quad -r\leq x-a\leq r. $$

Adding \(a\) to all parts of the double inequality preserves order, by translation of order. Therefore

$$ -r\leq x-a\leq r \quad\Longleftrightarrow\quad a-r\leq x\leq a+r. $$

Combining the equivalences proves the result. \(\square\)

The condition \(r\geq0\) matters. A distance is nonnegative, so no point can be within a negative distance of \(a\). The interval description also includes its endpoints: \(a-r\) and \(a+r\) are exactly distance \(r\) from \(a\).

Worked Example: Numbers Within a Given Distance

Find all real numbers \(x\) whose distance from \(-2\) is at most \(\frac{3}{2}\). Here the fixed point is \(a=-2\), and the distance bound is \(r=\frac{3}{2}\). The theorem gives

$$ -\!2-\frac{3}{2}\leq x\leq-\!2+\frac{3}{2}, $$

so, after writing \(-2=-\frac{4}{2}\),

$$ -\frac{7}{2}\leq x\leq-\frac{1}{2}. $$

Every number in this interval satisfies the distance condition. For instance, \(x=-1\) is included because \(d(-1,-2)=|-1-(-2)|=1\leq\frac{3}{2}\). Each endpoint is exactly \(\frac{3}{2}\) from \(-2\):

$$ d\left(-\frac{7}{2},-2\right) =\left|-\frac{7}{2}+2\right| =\left|-\frac{3}{2}\right| =\frac{3}{2}, \qquad d\left(-\frac{1}{2},-2\right) =\left|-\frac{1}{2}+2\right| =\frac{3}{2}. $$

Because the original bound is non-strict, these endpoints belong to the solution interval.

There is a parallel description for a strict distance bound. If \(r>0\), then \(d(x,a)<r\) means that \(x\) lies strictly between \(a-r\) and \(a+r\). To see this, put \(u=x-a\). When \(u\geq0\), the definition gives \(|u|=u\), so \(|u|<r\) means \(u<r\); the other endpoint inequality \(-r<u\) follows from \(u\geq0\) and \(r>0\). When \(u<0\), the definition gives \(|u|=-u\), so \(|u|<r\) means \(-u<r\), or \(u>-r\); also \(u<r\), since \(u<0<r\). In both cases, \(-r<u<r\), which is equivalent to \(a-r<x<a+r\) after adding \(a\). Conversely, if \(-r<u<r\), then either \(u\geq0\), giving \(|u|=u<r\), or \(u<0\), giving \(|u|=-u<r\). Thus the strict bound has precisely the stated interpretation.

Points at Exactly a Given Distance

An equation specifying an exact distance gives at most two points: one on either side of the center. For radius zero, the two descriptions coincide at the center. The nonnegative condition on the radius again follows from the fact that distance cannot be negative.

Theorem (Points at a specified distance). Let \(a,x\in\mathbb{R}\) and \(r\geq0\). Then
$$ d(x,a)=r \quad\Longleftrightarrow\quad x=a-r\ \text{or}\ x=a+r. $$

Proof. By definition, the equation is \(|x-a|=r\). If \(x-a\geq0\), then \(|x-a|=x-a\), so the equation implies \(x-a=r\), hence \(x=a+r\). If \(x-a<0\), then \(|x-a|=-(x-a)\), so the equation implies \(x-a=-r\), hence \(x=a-r\). This proves that at least one of the two stated values must hold.

For the converse, if \(x=a+r\), then \(x-a=r\), and \(|x-a|=|r|=r\) because \(r\geq0\). If \(x=a-r\), then \(x-a=-r\), and \(|x-a|=|-r|=r\), using the definition of absolute value and \(r\geq0\). Thus either listed value gives distance \(r\), completing the proof. \(\square\)

Worked Example: Solving an Exact-Distance Equation

Find all \(x\) whose distance from \(\frac{1}{2}\) is \(\frac{5}{2}\). The specified center is \(a=\frac{1}{2}\), and the radius is \(r=\frac{5}{2}\). The theorem gives the two possibilities

$$ x=\frac{1}{2}-\frac{5}{2}=-2 \qquad\text{or}\qquad x=\frac{1}{2}+\frac{5}{2}=3. $$

Check both values using the distance definition:

$$ d\left(-2,\frac{1}{2}\right) =\left|-2-\frac{1}{2}\right| =\left|-\frac{5}{2}\right| =\frac{5}{2}, \qquad d\left(3,\frac{1}{2}\right) =\left|3-\frac{1}{2}\right| =\left|\frac{5}{2}\right| =\frac{5}{2}. $$

The two solutions lie on opposite sides of the center and have equal distance from it. If the specified distance had been zero, the two expressions \(a-r\) and \(a+r\) would instead both give \(a\).

Using the Distance Viewpoint Carefully

Writing an absolute value as a distance is useful whenever the expression inside it is a difference. The expression \(|x-a|\) measures how far \(x\) is from the fixed point \(a\); it is not generally the distance of \(x\) from zero. For example, \(|x-4|\) is the distance from \(4\), while \(|x|\) is the distance from \(0\).

A common mistake is to treat \(x-a\) as the distance itself. The difference can be negative: if \(x<a\), then \(x-a<0\). The distance is \(|x-a|\), which is always nonnegative. Another mistake is to report only one solution to an exact-distance equation with positive radius. There are two points, \(a-r\) and \(a+r\), and both should be checked. For an inequality with “at most,” include the endpoints; for a strict inequality, exclude them.

These translations turn absolute-value statements into geometric descriptions on the real line: an upper bound on distance gives an interval, while an exact positive distance gives two points. They preserve the original meaning while making the location of the solutions explicit.

Key takeaway. The distance between \(x\) and \(a\) is \(d(x,a)=|x-a|\). For \(r\geq0\), a distance at most \(r\) means \(a-r\leq x\leq a+r\), and a distance exactly \(r\) means \(x=a-r\) or \(x=a+r\).

Check Your Understanding

Use the distance definition and the results proved in this tutorial to answer the following questions.

  1. Find the distance between \(-\frac{3}{2}\) and \(\frac{7}{3}\).
  2. Write the set of all \(x\) whose distance from \(5\) is at most \(2\) as an interval.
  3. Find all \(x\) whose distance from \(-1\) is exactly \(4\).
  4. Explain why \(d(x,y)=d(y,x)\) for real \(x\) and \(y\).
  5. What set of real numbers satisfies \(d(x,3)<2\)? Are its endpoints included?
  6. Why does an equation \(d(x,a)=r\) have no solutions when \(r<0\)?