Heyaa!! I was trying to solve the following questions and i am stuck. I do have an intuition as to how would one solve it, but i don't know how to prove that.
Let $X = \{0, 1\}^n$ be the set of binary vectors of length $n$. For $x = (x_1 , \ldots , x_n )$ and $y = (y_1 , . . . , y_n )$ in $X$, define their Hamming distance to be $d(x, y) =$ # $\{i ∈ \{1, 2, . . . , n\} : x_i \neq y_i\}$,i.e. the number of places where $x$ and $y$ differ. Show that $d$ is a metric on $X$. Is it an ultrametric?
I think the first property $d(x,y) \geq 0$ is fairly obvious since that is the scope, and property 2, $d(x, y) = d(y, x)$ for all $x, y ∈ X$ can be proven using mod and absolute values (not sure how to express it), and i am finding the triangle property hard to figure out. Also, I think it is an ultrametric because the LUB of two intervals (here) would always be greater than the third?
Sorry if it doesn't make a lot of sense i'm just starting to learnt eh topic. I'll really appreciate your help!! Thanks so much!! :)
You should also argue that $d(x,y)=0$ if and only if $x=y$.
Consider three elements $x=(x_{1},x_{2},...,x_{n}),y=(y_{1},y_{2},...,y_{n}),z=(z_{1},z_{2},...,z_{n})$ in $X$. If $i$ is such that $x_{i}\neq z_{i}$ then either $x_{i}\neq y_{i}$ or $y_{i}\neq z_{i}$. So the set $\left\{1\leq i\leq n\mid x_{i}\neq z_{i}\right\}$ is a subset of $\left\{1\leq i\leq n\mid x_{i}\neq y_{i}\right\}\cup \left\{1\leq i\leq n\mid y_{i}\neq z_{i}\right\}$. Can you take it from here?
For the ultrametric property, I am not quite sure what interval you mean. The question is whether we can find $x,y,z$ as before such that $x$ differs in more indices with $z$ than $y$ with $z$ or $z$ with $y$. My advice would be to take $n=2$ and write down all elements of $X$ and all distances between them.