Using the triangle inequality on a metric which measures dissimilarities in co-ordinates

32 Views Asked by At

In an exam paper I was looking at I cam across the question which asked to prove that the folowing function is a metric on $\Bbb R $.

$$d:\Bbb R^3 \times \Bbb R^3 \rightarrow \{0,1,2,3\}$$

where d(v,w) is defined to be the number of places where the co-ordinates differ.

but im not quite sure i understand how this can be when considering the triangle inequality.

what if we had x=(0,1,0), z=(1,0,1) and y=(1,1,0)

then

d(x,z)=3

d(x,y)=1

d(y,z)=1

which violates the triangle inequality , no ?

1

There are 1 best solutions below

0
On

We have $d(x, y) =0\iff x$ and $y$ differ in $0$ coordinates, i.e. iff $x=y$.

Now, for $x, y$ denote $D(x, y)$ the set of coordinates $\subseteq\{1,2,3\} $ where they differ.
Then we have $d(x, y) =|D(x, y) |$ and $$D(x, z) \subseteq D(x, y) \cup D(y, z)$$

If $x_i=y_i$ and $y_i=z_i$ then $x_i=z_i$. So if $i\in D(x, z) $ it can't be the case that $i\notin D(x, y) $ and $i\notin D(y, z) $.