Prove that the Hamming distances between three n-tuples cannot be 6,2,7 Let $x,y,z \in \{0,1\}^n$, and let $d_H(x,y)$ be the Hamming distance between codes x and y.

Prove 
$d_H(x,y) = 6$,
$d_H(y,z) = 2$,
$d_H(x,z) = 7$
cannot happen.
Notice that $d(x,y)=w(x+y)$   where the sum is modulo $2$, and $w$ is the weight function (it counts the number of ones).

Then $d(x,z) = w(x+z) =  w(x+ y + y+ z) = w(a +b)$  where $a=x+y$ and $b=y+z$

Now $w(a+b) = w(a)+ w(b) - 2 w(c)$ where $c=a.b$ is the pointwise product (or bitwise AND function - or the number of ones in common). Then, in general

$$d(x,z)=d(x,y)+d(y,z)-2 k$$

for some integer $k$. 

Or, equivalently, $d(x,z)+d(x,y)+d(y,z)$ is even.

Hence, it can never happen that, of the three mutual distance, two distances are even and one is odd. Either we have three even distances, or two odd and one even.



BTW 1: This problem has nothing to do with Hamming (or linear) codes, the statement refers to arbitrary binary tuples.

BTW 2: Next time you ask a question, please try to add some of your thoughts or what have you tried, to show us that you are not simply looking for someone else to do your homework. That's not what this website is for. And if the people here suspect you are doing that, they might downvote, close or refuse to answer your questions.

BTW 3: Welcome to MSE
Welcome to MSE! I've looked into the triangular inequality: $d(x,z)\leq d(x,y)+d(y,z)$. But it doesn't help here: $2+6\geq 7$, $2+7\geq 6$, $6+7\geq 2$.