Absolute Difference

Jump to: navigation, search

An Absolute Difference between two numbers is the Absolute Value of the subtraction between the two, i.e. [math]|A-B|[/math] .

See: Absolute Value, Number, Mean Deviation.



  • |xy| ≥ 0, since absolute value is always non-negative.
  • |xy| = 0   if and only if   x = y.
  • |xy| = |yx|     (symmetry or commutativity).
  • |xz| ≤ |xy| + |yz|     (triangle inequality); in the case of the absolute ::difference, equality holds if and only if xyz.
By contrast, simple subtraction is not non-negative or commutative, but it does obey the second and fourth properties above, since xy = 0 if and only if x = y, and xz = (xy) + (yz).
The absolute difference is used to define other quantities including the relative difference, the L1 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

|xy| < |zw| if and only if (xy)2 < (zw)2.
This follows since |xy|2 = (xy)2 and squaring is monotonic on the nonnegative reals.