Metric

https://arbital.com/p/metric

by Bryce Woodworth Jul 29 2016 updated Mar 23 2017

A metric is a function that defines a distance between elements in a set and follows some basic rules.


[summary: Let be a set. A metric on is a function such that for all ,

Such a function defines a notion of distance between pairs of elements of . ]

A metric, sometimes referred to as a distance function, is a Function that defines a real nonnegative distance between every two elements of a set. It is commonly denoted by the variable . In Colon-to notation, a metric that defines distances between elements of the set is written:

In this case we say is a metric on .

That is, a metric on a set takes as input any two elements and from and outputs a number that is taken to define their distance in under . Apart from being nonnegative real numbers, the distances a metric outputs must follow three other rules in order for the function to meet the definition of a metric. A function that matches the above colon-to notation is called a metric if and only if it satisfies these requirements. The following must hold for any choice of , , and in :

(1) effectively states both that the distance from an element to itself is 0, and that the distance between non-identical elements must be greater than 0. (2) asserts that a metric must be commutative; informally the distance from to must be the same as the distance from to . Finally, (3) is known as the [-triangle_inequality] and asserts that the distance from to is at most as large as the sum of the distances from to and from to . It is named as such because in [euclidean_space], the points , , and form a triangle, and the inequality requires that the length of one side of the triangle is not longer than the sum of the lengths of the other two sides; violating this would mean that the shortest path between two points is no longer the straight line between them.

It is possible (and relatively common!) to deal with multiple different metrics on the same set. This means we are using the same set elements as labels, but treating the distances between elements differently; in this case the different [metric_space metric spaces] we are defining may have very different properties. If multiple metrics are being considered, we must be careful when speaking of distances between elements of the set to specify which metric we are using. For example, if and are both metrics on , we cannot just say "the distance between and in " because it is ambiguous whether we are referring to or to . We could instead say something like "the distance between and under " to remove the ambiguity.

The most commonly-used metric on Cartesian space is the Euclidean metric, defined in two dimensions as , and more generally in dimensions as .

A less-common metric on Cartesian space is the Manhattan metric, defined generally as ; the distance is analogous to the distance taken between two points on a rectangular grid when motion is constrained to be purely vertical or horizontal, but not diagonal.

[todo: A metric induces a topology] [todo: add intuitive/nonalgebraic explanation lens] [todo: proof that Euclidean and Manhattan distances are metrics]


Comments

Eric Rogstad

The first requirement effectively states both that the distance from an element to itself is 0, and that the distance between non\-identical elements must be greater than 0\. The second requirement asserts that a metric must be commutative; informally the distance from to must be the same as the distance from to \. Finally, the third requirement is known as the triangle inequality and asserts that the distance from to is at most as large as the sum of the distances from to and from to \. It is named as such because in Euclidean space, the points , , and form a triangle, and the inequality requires that the length of one side of the triangle is not longer than the sum of the lengths of the other two sides; violating this would mean that the shortest path between two points is no longer the straight line between them\.

This is a clear explanation, but I think some formatting changes could enable readers to grok it even more quickly.

Suppose a reader understands two of the three requirements and just needs an explanation of the third. It would be cool if they could find the sentences they're looking for w/o having to scan a whole paragraph looking for the words, "first", "second", or "third".

I think we can achieve this by A) moving each explanation right under the equation / inequality it's talking about, or B) putting the three explanations in a second numbered list, or C) leaving the three explanations in a paragraph, but use the numerals 1, 2, and 3 within the paragraph. Might require some experimentation to see what looks best.

Alexei Andreev

A metric, sometimes referred to as a distance function, is a function that defines a real nonnegative distance between every two elements of a set\. It is commonly denoted by the variable \. In colon\-to notation, a metric that defines distances between elements of the set is written:

Is [0, inf) same as R+?