Misplaced Pages

Absolute difference

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Absolute value of (x - y), a metric
This article relies largely or entirely on a single source. Relevant discussion may be found on the talk page. Please help improve this article by introducing citations to additional sources.
Find sources: "Absolute difference" – news · newspapers · books · scholar · JSTOR (May 2024)
Showing the absolute difference of real numbers x {\displaystyle x} and y {\displaystyle y} as the distance between them on the real line.

The absolute difference of two real numbers x {\displaystyle x} and y {\displaystyle y} is given by | x y | {\displaystyle |x-y|} , the absolute value of their difference. It describes the distance on the real line between the points corresponding to x {\displaystyle x} and y {\displaystyle y} . It is a special case of the L distance for all 1 p {\displaystyle 1\leq p\leq \infty } and is the standard metric used for both the set of rational numbers Q {\displaystyle \mathbb {Q} } and their completion, the set of real numbers R {\displaystyle \mathbb {R} } .

As with any metric, the metric properties hold:

  • | x y | 0 {\displaystyle |x-y|\geq 0} , since absolute value is always non-negative.
  • | x y | = 0 {\displaystyle |x-y|=0}   if and only if   x = y {\displaystyle x=y} .
  • | x y | = | y x | {\displaystyle |x-y|=|y-x|}     (symmetry or commutativity).
  • | x z | | x y | + | y z | {\displaystyle |x-z|\leq |x-y|+|y-z|}     (triangle inequality); in the case of the absolute difference, equality holds if and only if x y z {\displaystyle x\leq y\leq z} or x y z {\displaystyle x\geq y\geq z} .

By contrast, simple subtraction is not non-negative or commutative, but it does obey the second and fourth properties above, since x y = 0 {\displaystyle x-y=0} if and only if x = y {\displaystyle x=y} , and x z = ( x y ) + ( y z ) {\displaystyle x-z=(x-y)+(y-z)} .

The absolute difference is used to define other quantities including the relative difference, the L 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

| x y | < | z w | {\displaystyle |x-y|<|z-w|} if and only if ( x y ) 2 < ( z w ) 2 {\displaystyle (x-y)^{2}<(z-w)^{2}} .

This follows since | x y | 2 = ( x y ) 2 {\displaystyle |x-y|^{2}=(x-y)^{2}} and squaring is monotonic on the nonnegative reals.

Additional Properties

  • 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.

See also

References

Real numbers


Stub icon

This algebra-related article is a stub. You can help Misplaced Pages by expanding it.

Categories: