Loading AI tools

Absolute value of (x - y), a metric From Wikipedia, the free encyclopedia

The **absolute difference** of two real numbers and is given by , the absolute value of their difference. It describes the distance on the real line between the points corresponding to and . It is a special case of the L^{p} distance for all and is the standard metric used for both the set of rational numbers and their completion, the set of real numbers .

This article relies largely or entirely on a single source. (May 2024) |

As with any metric, the metric properties hold:

- , since absolute value is always non-negative.
- if and only if .
- (
*symmetry*or*commutativity*). - (
*triangle inequality*); in the case of the absolute difference, equality holds if and only if or .

By contrast, simple subtraction is not non-negative or commutative, but it does obey the second and fourth properties above, since if and only if , and .

The absolute difference is used to define other quantities including the relative difference, the L^{1} norm used in taxicab geometry, and graceful labelings in graph theory.

When it is desirable to avoid the absolute value function – for example because it is expensive to compute, or because its derivative is not continuous – it can sometimes be eliminated by the identity

if and only if .

This follows since and squaring is monotonic on the nonnegative reals.

- In any subset S of the real numbers which has an Infimum and a Supremum, the absolute difference between any two numbers in S is less or equal then the absolute difference of the Infimum and Supremum of S.

Seamless Wikipedia browsing. On steroids.

Every time you click a link to Wikipedia, Wiktionary or Wikiquote in your browser's search results, it will show the modern Wikiwand interface.

Wikiwand extension is a five stars, simple, with minimum permission required to keep your browsing private, safe and transparent.