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