1

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 ?

excalibirr
  • 2,795
  • 4
    Careful, $d(y,z)=2$ – user281392 Jun 04 '18 at 19:55
  • @user281392 ah silly of me of course it does , how could one formally prove the triangle inequality holds for all x,y,z then ? I'm thinking something like $0 \geq d(x,y)+d(z,y) \leq 6$ and that $d(x,z) \leq 3$ but i'm worried there may be a case where say d(x,y)=0, d(y,z)=3 and d(x,z)=2 ( or rather given that they told me this is a metric , i'm worried about how to show that no such cases exist) ? – excalibirr Jun 04 '18 at 20:16

1 Answers1

0

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) $.

Berci
  • 90,745