---
tag: 0KXJTZSW9B
kind: example
name: Usual metric on the real line
aliases: [absolute-difference]
msc: ["54E35"]
instance_of: [0VKD1TP7F3]
sources:
  - url: https://en.wikipedia.org/wiki/Absolute_difference
    locator: lead section
same_as:
  wikidata: Q1773230
  wikipedia: Absolute difference
---

## Example

On the set $\mathbb{R}$ of [[real numbers|08J2M1JYAG]], let
$$d(x, y) = |x - y|,$$
where $|\cdot|$ is the [[absolute value|00S7C68D51]].
Then $d$ is a [[metric|063W5JMY85]] on $\mathbb{R}$.
The [[triangle inequality|03HF5PMY5T]] for real numbers gives the triangle inequality for $d$.

## Remarks

The number $|x - y|$ is the absolute difference of $x$ and $y$.
This metric is the case $n = 1$ of the [[Euclidean metric|0E1MMCAY5B]].
The same formula with the [[modulus|0KW2X0TFBX]] gives a metric on the complex numbers.

## Explanations

### L1 human

The distance between two numbers is the length of the segment between them on the number line.
For example, the distance between $-2$ and $3$ is $|-2 - 3| = 5$.
