Intuition
One set carries many metrics. On the plane the straight-line distance is only the most familiar: a taxi driver measures along the streets, and a walker who only minds the worst leg of the journey counts something else again. Each rule satisfies the three conditions, so each is a metric, and each decides what near is going to mean.
Ask three people in one city how far apart two addresses are and you get three honest answers: the crow flies straight, the taxi turns corners, and the cyclist remembers only the longest hill.
The same pair of points, measured three ways. Straight across, . Along the streets, . Counting only the longer leg, . Three numbers, three metrics, one pair of points.
Four metrics worth knowing
On the three rules below are all metrics, and the first is the one school geometry uses. On any set at all there is a fourth: the discrete metric, which gives to a point and itself and to every other pair. It satisfies the three conditions and measures nothing but whether two points are the same.
What they do to each other
- is the Euclidean metric, the taxicab metric and the maximum metric. On all three are : the differences begin in two dimensions.
The discrete metric obeys the triangle inequality
Every value of the discrete metric is 0 or 1, so the left-hand side is one of two numbers. If it is 0 there is nothing to prove, because the right-hand side is a sum of numbers that are never negative. If it is 1 then x and z are different points, so y cannot be equal to both of them, and whichever it differs from contributes a 1 to the right-hand side. So the right-hand side is at least 1 as well.
Proof steps
The discrete metric takes only these two values, so the left-hand side is one of them.
In the first case the inequality holds for any y at all, because no value is negative.
In the second case the two outer points are different.
A single point cannot equal two different points, so y differs from at least one of them.
Whichever it differs from contributes a 1 to the sum, so the inequality holds in this case too.
Applications
Practice
One Set, Many Metrics
The three conditions are all a rule has to satisfy. Nothing says it must come from geometry, and a rule that looks reasonable can still fail one of them.
Try it
Three of these rules on fail a condition. Which one is a metric?
Taxicab and Maximum
The taxicab metric adds the coordinate differences; the maximum metric keeps the largest of them.
Try it
In , what is between and ?
Try it
For the same two points and , what is ?
Try it
A set carries the discrete metric. What is for two different points?
Try it
For every pair of points of , .
Try it
is a metric on .
Counting the Differences
Between two strings of equal length, the number of positions where they disagree satisfies the three conditions. It is called the Hamming distance.
Try it
What is the Hamming distance between the strings and ?
Try it
Under , when are two functions at distance less than ?
Try it
On , take and . What is ?
What You Learned
- adds the coordinate differences, combines them under a root, keeps the largest.
Final checkpoint
Try it
In , which points are at distance exactly from the origin?
Try it
Every set, however few or many points it has, carries at least one metric.
Completion
Lesson complete
Great work! You now know how to:
- name the taxicab, Euclidean, maximum and discrete metrics;
- compute distances in each of them;
- check a proposed rule against the three conditions;
- see that one set can carry many metrics.