Lably
Skip to content

Absolute difference

Absolute value of (x - y), a metric

  • 2 min read
  • 2 chapters

Related on Lably

Through Real number, Absolute value and Subtraction

Properties

Absolute difference has the following properties:

  • For x≥0, |x−0|=x (zero is the identity element on non-negative numbers)
  • For all x, |x−x|=0 (every element is its own inverse element)
  • |x−y|≥0 (non-negativity)
  • |x−y|=0 if and only if x=y (nonzero for distinct arguments).
  • |x−y|=|y−x| (symmetry or commutativity).
  • |x−z|≤|x−y|+|y−z| (the triangle inequality); equality holds if and only if x≤y≤z or x≥y≥z.

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. It has been called "the most natural metric space", and "the most important concrete metric space". This distance generalizes in many different ways to higher dimensions, as a special case of the Lp distances for all 1≤p≤∞, including the p=1 and p=2 cases (taxicab geometry and Euclidean distance, respectively). It is also the one-dimensional special case of hyperbolic distance.

Instead of |x−y|, the absolute difference may also be expressed as max(x,y)−min(x,y). Generalizing this to more than two values, 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 than the absolute difference of the infimum and supremum of S.

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.

Sign in to keep reading

One more chapter is free with a Lably account.

More in Topics in mathematics