The Central Idea

A metric is a rule that assigns a distance between pairs of points.

If \(x\) and \(y\) are points in a set \(X\), a metric is written

\[ d(x,y). \]

Different metrics may assign different numerical distances to the same pair of points while still behaving consistently as legitimate notions of distance.

Distance Is a Rule, Not Just a Formula

The familiar coordinate formula

\[ \sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \]

is one specific distance rule: the Euclidean metric.

Other settings may use different rules because movement, cost, accessibility, or structure differs from ordinary straight-line geometry.

The Four Metric Requirements

A function \(d(x,y)\) is a metric when it satisfies four conditions for all points \(x\), \(y\), and \(z\).

  1. Nonnegativity: \(d(x,y)\ge0\).
  2. Identity of indiscernibles: \(d(x,y)=0\) exactly when \(x=y\).
  3. Symmetry: \(d(x,y)=d(y,x)\).
  4. Triangle inequality: \(d(x,z)\le d(x,y)+d(y,z)\).

Nonnegativity

Distance cannot be negative:

\[ \boxed{d(x,y)\ge0}. \]

A rule that assigns a negative distance to some pair of points is not a metric.

Zero Distance

A metric must satisfy

\[ \boxed{d(x,y)=0\iff x=y}. \]

A point has zero distance from itself, and distinct points must have positive distance.

Symmetry

A metric measures separation without directional preference:

\[ \boxed{d(x,y)=d(y,x)}. \]

The distance from \(x\) to \(y\) equals the distance from \(y\) to \(x\).

The Triangle Inequality

A direct distance cannot exceed the length of a route forced through an intermediate point:

\[ \boxed{d(x,z)\le d(x,y)+d(y,z)}. \]

This condition formalizes the idea that taking a detour should not produce a shorter route than the metric's direct separation.

Euclidean Distance on a Number Line

On the real number line, ordinary Euclidean distance is

\[ \boxed{d(x,y)=|x-y|}. \]

Absolute value ensures the result is nonnegative and independent of the order of the two points.

Example: Number-Line Distance

Find the distance between

\[ -7 \]

and

\[ 5. \] \[ d(-7,5)=|-7-5|=|-12|=12. \] \[ \boxed{d=12}. \]

Euclidean Distance in the Plane

For

\[ P=(x_1,y_1) \]

and

\[ Q=(x_2,y_2), \]

Euclidean distance is

\[ \boxed{ d_2(P,Q) = \sqrt{(x_2-x_1)^2+(y_2-y_1)^2} }. \]

Why the Subscript \(2\) Appears

The notation \(d_2\) emphasizes that Euclidean distance is based on squares:

\[ (\Delta x)^2+(\Delta y)^2. \]

This is closely related to the \(2\)-norm used in vector analysis.

Example: Euclidean Distance

Let

\[ P=(1,2),\qquad Q=(7,10). \]

Then

\[ d_2(P,Q) = \sqrt{6^2+8^2} = \sqrt{100} = 10. \] \[ \boxed{d_2=10}. \]

Euclidean Distance in Three Dimensions

For points

\[ P=(x_1,y_1,z_1) \]

and

\[ Q=(x_2,y_2,z_2), \]

the distance is

\[ \boxed{ d_2(P,Q) = \sqrt{ (x_2-x_1)^2+ (y_2-y_1)^2+ (z_2-z_1)^2 } }. \]

Euclidean Distance in \(n\) Dimensions

For

\[ x=(x_1,\ldots,x_n) \]

and

\[ y=(y_1,\ldots,y_n), \]

Euclidean distance is

\[ \boxed{ d_2(x,y) = \sqrt{ \sum_{i=1}^{n}(x_i-y_i)^2 } }. \]

Euclidean Distance Means Straight-Line Distance

In ordinary Euclidean geometry, \(d_2\) measures the length of the straight segment connecting two points.

This makes it appropriate when movement is unrestricted and all directions are geometrically available.

Manhattan Distance

Manhattan distance measures total coordinate-by-coordinate travel.

In the plane,

\[ \boxed{ d_1(P,Q) = |x_2-x_1|+|y_2-y_1| }. \]

It is also called taxicab distance or the \(L^1\) metric.

Why It Is Called Manhattan Distance

The name comes from travel on a rectangular street grid.

If diagonal travel through buildings is impossible, movement occurs through horizontal and vertical segments rather than along the straight geometric shortcut.

Example: Manhattan Distance

Let

\[ P=(1,2),\qquad Q=(7,10). \]

Then

\[ d_1(P,Q) = |7-1|+|10-2|. \] \[ d_1=6+8=14. \] \[ \boxed{d_1=14}. \]

Same Points, Different Metrics

For

\[ P=(1,2),\qquad Q=(7,10), \]

Euclidean distance is

\[ 10, \]

while Manhattan distance is

\[ 14. \]

Neither calculation is inherently wrong. They answer different geometric or modeling questions.

Manhattan Distance in \(n\) Dimensions

For points \(x,y\in\mathbb{R}^n\),

\[ \boxed{ d_1(x,y) = \sum_{i=1}^{n}|x_i-y_i| }. \]

The total distance is the sum of the absolute coordinate differences.

Chebyshev Distance

Chebyshev distance uses the largest coordinate difference.

In two dimensions,

\[ \boxed{ d_\infty(P,Q) = \max\left( |x_2-x_1|, |y_2-y_1| \right) }. \]

It is also called the \(L^\infty\) metric.

Example: Chebyshev Distance

For

\[ P=(1,2),\qquad Q=(7,10), \]

the coordinate differences are

\[ 6 \]

and

\[ 8. \]

Therefore,

\[ \boxed{d_\infty(P,Q)=8}. \]

A Chessboard Interpretation

Chebyshev distance models movement when one move may change several coordinates simultaneously by the same maximum step size.

On a chessboard, a king can move horizontally, vertically, or diagonally one square at a time.

The minimum number of king moves between two squares follows the Chebyshev metric.

Chebyshev Distance in \(n\) Dimensions

For \(x,y\in\mathbb{R}^n\),

\[ \boxed{ d_\infty(x,y) = \max_{1\le i\le n}|x_i-y_i| }. \]

Comparing Three Common Metrics

For coordinate differences

\[ (\Delta x,\Delta y)=(6,8), \]

the three distances are

\[ d_1=14, \] \[ d_2=10, \] \[ d_\infty=8. \]

The metric determines how coordinate differences are combined.

A Useful Inequality

In finite-dimensional coordinate spaces, these common metrics satisfy

\[ \boxed{ d_\infty(x,y)\le d_2(x,y)\le d_1(x,y) }. \]

The exact numerical distance changes, but the three metrics remain closely related.

The \(p\)-Metric Family

Manhattan and Euclidean distance belong to a broader family.

For \(p\ge1\),

\[ \boxed{ d_p(x,y) = \left( \sum_{i=1}^{n}|x_i-y_i|^p \right)^{1/p} }. \]

This is the distance induced by the \(p\)-norm.

Special Cases of the \(p\)-Metric

When

\[ p=1, \]

we obtain Manhattan distance.

When

\[ p=2, \]

we obtain Euclidean distance.

Chebyshev distance appears as the limiting \(p\to\infty\) case.

The Discrete Metric

A very simple metric can be defined on any set:

\[ d(x,y) = \begin{cases} 0,&x=y,\\ 1,&x\ne y. \end{cases} \]

This is called the discrete metric.

What the Discrete Metric Means

Under the discrete metric, every pair of distinct points is equally far apart.

The metric ignores geometric magnitude and records only whether two points are identical or different.

This shows that a metric need not resemble ordinary physical distance.

Weighted Distance

Sometimes coordinate directions should not contribute equally.

A weighted Manhattan metric may take the form

\[ \boxed{ d(x,y) = w_1|x_1-y_1| +\cdots+ w_n|x_n-y_n| } \]

where each weight \(w_i>0\).

Why Use Weights?

Weights can represent differences in cost, importance, difficulty, scale, or accessibility.

A change of one unit in one coordinate may matter more than a change of one unit in another.

Weighted metrics let the model encode that distinction.

Example: Weighted Manhattan Distance

Suppose

\[ d(P,Q) = 2|x_2-x_1|+5|y_2-y_1|. \]

If the coordinate differences are \(3\) and \(4\), then

\[ d=2(3)+5(4)=6+20=26. \] \[ \boxed{d=26}. \]

Units Matter in Weighted Metrics

If coordinates use different units, directly combining raw coordinate differences may be misleading.

For example, a model mixing meters and seconds may require normalization, conversion, or physically meaningful weights before a single distance is interpreted.

Coordinate Scaling Can Change Distance

Suppose one variable is measured in meters and another in millimeters.

The numerical sizes of coordinate differences may differ drastically simply because of unit choice.

In data analysis, standardization or normalization may therefore be necessary before a metric is applied.

Distance on a Curved Surface

On a curved surface, the shortest path constrained to remain on the surface may differ from the straight-line chord through the surrounding space.

Such shortest paths are called geodesics.

Geodesic Distance on a Sphere

On the surface of a sphere, the shortest surface route between two points generally follows a great-circle arc.

This is why long-distance routes on Earth are naturally modeled by great-circle geometry rather than by flat-plane distance.

Arc Distance on a Circle

If two points lie on a circle of radius \(r\) and differ by central angle \(\theta\) radians along the shorter arc, their arc distance is

\[ \boxed{s=r\theta}. \]

This differs from the straight chord distance through the circle's interior.

Chord Distance versus Arc Distance

For two points on a circle, the chord gives the direct Euclidean distance through the ambient plane.

The arc gives distance constrained to the circle.

Different geometric constraints therefore produce different useful notions of distance.

Network Distance

In a graph or network, distance is often defined as the length of a shortest path connecting two vertices.

If every edge has equal cost, distance may count the minimum number of edges.

If edges carry weights, distance may be the minimum total edge weight.

Example: Unweighted Network Distance

Suppose the shortest route from vertex \(A\) to vertex \(D\) uses three edges.

Then the graph distance is

\[ \boxed{d(A,D)=3}. \]

No coordinate system is required.

Distance Depends on the Allowed Structure

Two points may be geometrically close but far apart in a transportation network if there is no direct connection.

Conversely, a fast direct route may make two locations operationally close even when their raw geographic separation is larger.

A useful metric must match the structure of the problem.

Open Balls

Once a metric is chosen, we can define a neighborhood around a point.

The open ball of radius \(r>0\) centered at \(x\) is

\[ \boxed{ B_r(x)=\{y:d(x,y)

Closed Balls

A closed ball includes points at distance exactly \(r\):

\[ \boxed{ \overline{B}_r(x) = \{y:d(x,y)\le r\} }. \]

Metric Balls Can Have Different Shapes

In the plane, the set of points at a fixed distance from the origin depends on the metric.

Under Euclidean distance,

\[ x^2+y^2=r^2 \]

gives a circle.

Under other metrics, the corresponding boundary has a different shape.

The \(L^1\) Ball

Under Manhattan distance, points at distance \(r\) from the origin satisfy

\[ |x|+|y|=r. \]

In the plane, this boundary forms a diamond-shaped square.

The \(L^\infty\) Ball

Under Chebyshev distance, points at distance \(r\) from the origin satisfy

\[ \max(|x|,|y|)=r. \]

In the plane, this boundary forms an axis-aligned square.

Same Center, Same Radius, Different Neighborhoods

A radius of \(1\) does not always produce the same geometric region.

The metric determines which points count as being within distance \(1\).

Thus a metric helps define the geometry of nearness itself.

Metrics and Topology

Metrics generate neighborhoods, and neighborhoods determine notions such as openness, convergence, and continuity.

This provides a bridge from elementary distance measurement to topology and analysis.

Different Metrics Can Produce the Same Topology

In finite-dimensional Euclidean spaces, the common \(L^1\), \(L^2\), and \(L^\infty\) metrics assign different numerical distances but generate the same standard notion of which sequences converge and which sets are open.

Numerical distance and topological structure are related but not identical concepts.

Distance and Norms

In a vector space, many metrics arise from norms.

If \(\|\cdot\|\) is a norm, then

\[ \boxed{ d(x,y)=\|x-y\| }. \]

Euclidean, Manhattan, and Chebyshev distances are standard examples.

Translation Invariance

Norm-based metrics satisfy

\[ d(x+a,y+a)=d(x,y). \]

Translating both points by the same vector does not change their separation.

This matches the geometric intuition that distance depends on relative position rather than absolute location.

Scaling Euclidean Distance

If every coordinate is uniformly scaled by a positive factor \(k\), then Euclidean distances scale by \(k\):

\[ \boxed{ d_2(kx,ky)=k\,d_2(x,y) }. \]

This agrees with the one-dimensional scaling law for length.

Scaling Other Norm-Based Metrics

Manhattan and Chebyshev distance also satisfy

\[ d(kx,ky)=|k|\,d(x,y). \]

Under positive geometric scaling, distances therefore grow by the same linear factor.

Nearest Point Depends on the Metric

A point that is nearest under Euclidean distance need not be nearest under a weighted or network metric.

Optimization problems involving proximity must therefore specify the metric being minimized.

Example: Choosing a Metric for City Blocks

Suppose two locations differ by \(4\) blocks east-west and \(7\) blocks north-south.

If movement is restricted to the street grid, Manhattan distance gives

\[ 4+7=11. \] \[ \boxed{11\text{ blocks}}. \]

Euclidean distance would describe a straight shortcut that the street layout may not permit.

Example: Choosing a Metric for Simultaneous Movement

Suppose a system can change two coordinates simultaneously at a rate of one unit per step.

If the coordinate differences are \(4\) and \(7\), then Chebyshev distance is

\[ \max(4,7)=7. \] \[ \boxed{7\text{ steps}}. \]

Metric Choice Is a Modeling Decision

There is no universally best metric for every problem.

A useful choice depends on:

  • allowed movement;
  • geometry of the space;
  • cost structure;
  • units and variable scales;
  • the meaning of similarity or proximity in context.

Common Error: Assuming Every Distance Is Euclidean

Straight-line distance is natural in ordinary geometry, but constrained travel, networks, weighted systems, and abstract spaces may require different metrics.

Always identify the distance rule before calculating.

Common Error: Forgetting Absolute Values in Manhattan Distance

Manhattan distance uses

\[ |x_2-x_1|+|y_2-y_1|. \]

Without absolute values, positive and negative coordinate changes could cancel, producing an incorrect distance.

Common Error: Adding Coordinate Differences for Euclidean Distance

Euclidean distance does not use

\[ |\Delta x|+|\Delta y|. \]

It uses

\[ \sqrt{(\Delta x)^2+(\Delta y)^2}. \]

These formulas correspond to different metrics.

Common Error: Treating Any Nonnegative Function as a Metric

Nonnegativity alone is not enough.

A metric must also satisfy zero-distance identity, symmetry, and the triangle inequality.

Common Error: Ignoring Units and Variable Scales

In applied data spaces, one coordinate may numerically dominate another simply because of its unit or range.

A metric should be interpreted only after coordinate scales and units have been considered.

Common Error: Confusing Path Length with Metric Distance

A particular route between two points may be longer than the distance between them.

Metric distance generally represents the shortest separation according to the chosen rule, not the length of an arbitrary path.

A Reliable Procedure for Coordinate Distance

  1. Identify the two points.
  2. Identify the metric being used.
  3. Compute the coordinate differences.
  4. Apply the metric's rule for combining those differences.
  5. Simplify exactly when possible.
  6. Attach units when the coordinates carry physical units.
  7. Check that the result is nonnegative and symmetric.

A Reliable Procedure for Choosing a Metric

  1. Identify what “distance” is supposed to represent.
  2. Determine whether movement is free, grid-based, constrained, or network-based.
  3. Check whether coordinate directions should contribute equally.
  4. Account for units and coordinate scales.
  5. Choose a metric that matches the intended geometry or cost structure.
  6. Verify that the rule satisfies the metric requirements if it is being proposed as a true metric.

Example: Full Metric Comparison

Compare the points

\[ P=(-1,2),\qquad Q=(5,7). \]

The coordinate differences have absolute values

\[ 6,\qquad5. \]

Manhattan distance:

\[ d_1=6+5=11. \]

Euclidean distance:

\[ d_2=\sqrt{6^2+5^2}=\sqrt{61}. \]

Chebyshev distance:

\[ d_\infty=\max(6,5)=6. \]

Therefore,

\[ \boxed{ d_1=11,\qquad d_2=\sqrt{61},\qquad d_\infty=6 }. \]

Practice 1: Number-Line Distance

Find the ordinary distance between

\[ -9 \]

and

\[ 4. \]

Practice 2: Euclidean Distance

Find the Euclidean distance between

\[ (0,0) \]

and

\[ (6,8). \]

Practice 3: Manhattan Distance

Find the Manhattan distance between

\[ (2,-1) \]

and

\[ (8,4). \]

Practice 4: Chebyshev Distance

Find the Chebyshev distance between

\[ (2,-1) \]

and

\[ (8,4). \]

Practice 5: Compare Metrics

For points whose coordinate differences are \(3\) and \(4\), find \(d_1\), \(d_2\), and \(d_\infty\).

Practice 6: Three-Dimensional Euclidean Distance

Find the Euclidean distance from

\[ (0,0,0) \]

to

\[ (2,3,6). \]

Practice 7: Weighted Distance

Suppose

\[ d(P,Q)=3|\Delta x|+2|\Delta y|. \]

Find the distance when

\[ |\Delta x|=4,\qquad|\Delta y|=5. \]

Practice 8: Discrete Metric

Under the discrete metric, what is the distance between two distinct points?

Practice 9: Metric Ball

Under Manhattan distance in the plane, write the inequality describing the open ball of radius \(3\) centered at the origin.

Practice 10: Choose the Metric

A delivery vehicle must travel only along perpendicular city streets. Which of the common coordinate metrics in this lesson is usually the most natural first model?

Practice Answers

Practice 1

\[ |-9-4|=13. \] \[ \boxed{13}. \]

Practice 2

\[ d_2=\sqrt{6^2+8^2}=10. \] \[ \boxed{10}. \]

Practice 3

The coordinate differences have absolute values \(6\) and \(5\):

\[ d_1=6+5=11. \] \[ \boxed{11}. \]

Practice 4

\[ d_\infty=\max(6,5)=6. \] \[ \boxed{6}. \]

Practice 5

\[ d_1=3+4=7, \] \[ d_2=\sqrt{3^2+4^2}=5, \] \[ d_\infty=\max(3,4)=4. \] \[ \boxed{d_1=7,\quad d_2=5,\quad d_\infty=4}. \]

Practice 6

\[ d_2=\sqrt{2^2+3^2+6^2} = \sqrt{49} = 7. \] \[ \boxed{7}. \]

Practice 7

\[ d=3(4)+2(5)=12+10=22. \] \[ \boxed{22}. \]

Practice 8

\[ \boxed{1}. \]

Under the discrete metric, every pair of distinct points has distance \(1\).

Practice 9

\[ \boxed{|x|+|y|<3}. \]

Practice 10

The natural first model is Manhattan distance:

\[ \boxed{d_1}. \]

What to Remember

  • A metric is a rule for measuring distance between points.
  • A metric must satisfy nonnegativity, zero-distance identity, symmetry, and the triangle inequality.
  • Euclidean distance measures ordinary straight-line separation.
  • Manhattan distance adds absolute coordinate differences.
  • Chebyshev distance uses the largest coordinate difference.
  • The discrete metric assigns distance \(1\) to every pair of distinct points.
  • Weighted metrics can model unequal costs or coordinate importance.
  • Geodesic distance measures shortest paths constrained to a curved space.
  • Network distance measures shortest paths through allowed connections.
  • The choice of metric determines the geometry of nearness.

The central principle is: distance depends not only on the points being compared, but also on the rule chosen to measure their separation.

Where We Go Next

Distance metrics define how separation and nearness are measured. The next lesson, Bounds, Precision, and Measurement Error, turns from the choice of measurement rule to the reliability of measured values.

It will distinguish exact and approximate quantities, develop absolute and relative error, and show how bounds communicate the limits of measurement.