# Number TheoryWeight and distance of a binary code

#### Yuuki

##### Member
Is there a relationship between the distance and weight of a binary code?
I want to find the weight and distance of the code consisting of the codewords:

0000 0000
0010 1110
0101 1100
1011 1010
1110 0101
1100 1011
0111 0011
1001 0111

The weight can be checked easily by hand, but I don't want to check 21 distances.
Is there a quicker way?

One idea I had is $$d(C) \leq min(w(ci) + w(cj))$$, from the triangle inequality.

#### chisigma

##### Well-known member
Re: weight and distance of a binary code

Is there a relationship between the distance and weight of a binary code?
I want to find the weight and distance of the code consisting of the codewords:

0000 0000
0010 1110
0101 1100
1011 1010
1110 0101
1100 1011
0111 0011
1001 0111

The weight can be checked easily by hand, but I don't want to check 21 distances.
Is there a quicker way?

One idea I had is $$d(C) \leq min(w(ci) + w(cj))$$, from the triangle inequality.
The 'brute force procedure' for find the minimum distance in a code of size M=8 requires to check 7 + 6 + 5 + 4 + 3 + 2 + 1 = 28 distances...

... just a little question : in Your formula what are $C_{i}$ and $C_{j}$?...

Kind regards

$\chi$ $\sigma$

#### Yuuki

##### Member
The 'brute force procedure' for find the minimum distance in a code of size M=8 requires to check 7 + 6 + 5 + 4 + 3 + 2 + 1 = 28 distances...
I said 21 because I already know the distance from the code 0000 0000 from the calculation of the weights.

... just a little question : in Your formula what are Ci and Cj?
They are two different codewords.
I should have written this there, sorry.