Coding theory - Linear application

109 Views Asked by At

Show that in a binary code either all vectors have even weight or half of them have even weight and half of them have odd weight.

Let $C$ be a binary code and $C \subseteq \mathbb{F}_2^n $. I want to show that all elements of $C$ have weight even or half of the elements of $C$ have weight even.

So I think it's enough to show that the following is a linear application :

$$C \rightarrow \mathbb{F}_2$$

$$C \rightarrow wt(C) (mod 2)$$

My question on how to prove that this is a linear application?

1

There are 1 best solutions below

0
On BEST ANSWER

Multiplication by scalars is easy, either you multiply by $0$ and the result is $0$ or you multiply by $1$ and nothing changes, so let's focus on additivity.

Given two words $v,w$ consider $v+w$. the weight is just the number of $1$s in the word.

The $i$-th coordinate of $v+w$ is $1$ if either the $i$-th coordinate of $v$ is $1$ or the $i$-th coordinate of $w$ is $1$ (yet not both).

Thus the number of $1$s in $v+w$ is is the number of $1$s in $v$ plus the number of $1$s of $w$ minus two times the number of coordinates where both $v$ and $w$ have a $1$.