Skip to content

Discrete Metric

Definition

Consider the space Rn\mathbb{R}^n with its elements x\boldsymbol{x} and y\boldsymbol{y}. We define a discrete metric ddiscd_{\mathrm{disc}} as:

ddisc(x,y)={  1,if x≠y,  0,if x=y.d_{\mathrm{disc}}(\boldsymbol{x},\boldsymbol{y}) = \begin{cases} \displaystyle \;1, & \text{if } \boldsymbol{x} \neq \boldsymbol{y}, \\[2pt] \displaystyle \;0, & \text{if } \boldsymbol{x} = \boldsymbol{y}. \end{cases}

Although the example uses the Real Coordinate Space Rn\mathbb{R}^n, the same formula works on any set. It satisfies the Metric and Metric Space axioms: in particular, if x≠zx\ne z, at least one of x≠yx\ne y and y≠zy\ne z holds, giving the triangle inequality.


Interpretation

The discrete metric is the simplest possible distance: distinct points are always exactly 11 apart, and a point is 00 from itself. It treats every pair of different points as equally far, so it only records whether two points are equal.

Four points x, y, z and w joined by lines all labelled 1, the discrete distance between distinct points, and a ball of radius 1/2 around x that contains only x itself.

Every line between two of the four points has length 11, however the points are drawn. The red circle of radius 12\tfrac{1}{2} around x\boldsymbol{x} contains no other point: under this metric no point has neighbours closer than 11.

The discrete metric is mainly a test case: it satisfies every metric axiom, yet little of the behaviour of the Euclidean distance carries over. Since ddisc(xi,x)<1d_{\mathrm{disc}}(\boldsymbol{x}_i,\boldsymbol{x})<1 forces xi=x\boldsymbol{x}_i=\boldsymbol{x}, a sequence converges only if it is eventually constant. In the same way, ddisc(xj,xk)<12d_{\mathrm{disc}}(\boldsymbol{x}_j,\boldsymbol{x}_k)<\tfrac{1}{2} forces xj=xk\boldsymbol{x}_j=\boldsymbol{x}_k, so every Cauchy sequence is eventually constant and the space is complete.

The metric also shows that a metric need not come from a norm: a norm would give ∥2x∥=2∥x∥\|2\boldsymbol{x}\|=2\|\boldsymbol{x}\|, while ddisc(2x,0)=ddisc(x,0)=1d_{\mathrm{disc}}(2\boldsymbol{x},\boldsymbol{0})=d_{\mathrm{disc}}(\boldsymbol{x},\boldsymbol{0})=1 for x≠0\boldsymbol{x}\ne\boldsymbol{0}. Points that are very close in the Euclidean distance are at discrete distance 11, so no bound ddisc≤b d2d_{\mathrm{disc}}\le b\,d_2 holds, which is why the discrete metric is not strongly equivalent to the pp-metrics.

The discrete metric returns later in the course as a standard counterexample for open and closed sets.


Key Results


Examples

  • ddisc(2,5)=1d_{\mathrm{disc}}(2,5)=1 since 2≠52\neq 5.

Prerequisites

Sources

Symbols: real numbers

Last updated: 20 October 2026 03:02