Absolute difference

From Wikipedia, the free encyclopedia

Showing the absolute difference of real numbers and as the distance between them on the real line.

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 , and is a special case of the Lp distance for all . Its applications in statistics include the absolute deviation from a central tendency.

Absolute difference has the following properties:

  • For , (zero is the identity element on non-negative numbers)[1]
  • For all , (every element is its own inverse element)[1]
  • (non-negativity)[2]
  • if and only if (nonzero for distinct arguments).[2]
  • (symmetry or commutativity).[1][2]
  • (the triangle inequality);[2][3] equality holds if and only if or .

Because it is non-negative, nonzero for distinct arguments, symmetric, and obeys the triangle inequality, the real numbers form a metric space with the absolute difference as its distance, the familiar measure of distance along a line.[4] It has been called "the most natural metric space",[5] and "the most important concrete metric space".[2] This distance generalizes in many different ways to higher dimensions, as a special case of the Lp distances for all , including the and cases (taxicab geometry and Euclidean distance, respectively). It is also the one-dimensional special case of hyperbolic distance.

Instead of , the absolute difference may also be expressed as Generalizing this to more than two values, in any subset of the real numbers which has an infimum and a supremum, the absolute difference between any two numbers in is less or equal than the absolute difference of the infimum and supremum of .

The absolute difference takes non-negative integers to non-negative integers. As a binary operation that is commutative but not associative, with an identity element on the non-negative numbers, the absolute difference gives the non-negative numbers (whether real or integer) the algebraic structure of a commutative magma with identity.[1]

Applications

References

Related Articles

Wikiwand AI