Finding exact number of codewords having 0 at i th position

169 Views Asked by At

I am struck on this question in assignment of coding theory ( 1st course).

Question is ->Let C be a binary linear code . Show that number of codewords that have 0 at position i are either $2^k$ or $2^{k-1} $ .

My attempt-> If I fix ith position by 0 then I have 2 choices for each (k-1) position.So , the answer is $2^{k-1} $ .

Then how can answer be $2^k$ or $2^{k-1} $.

Can someone please tell.

2

There are 2 best solutions below

3
On BEST ANSWER

Let $C \subseteq \mathbb F_2^n$ be a binary $[n, k]$-code and $1 \le i \le n$. Define a linear map $\pi \colon C \to \mathbb F_2$ by $\pi(x_1 \dotsm x_n) = x_i$. The set of codewords that have $0$ at position $i$ equals $\ker \pi$. Because $\dim(\operatorname{im}\pi) \in \{0, 1\}$, we get $\dim(\ker\pi) = \dim C - \dim(\operatorname{im}\pi) \in \{ k, k - 1 \}$ by the rank-nullity theorem. So the number of such codewords is either $2^k$ or $2^{k-1}$.

0
On

I suppose the code $C$ has dimension $k$ as a subset of $\Bbb F_2^n$. If all codewords have a $0$ at position $i$ then the number is $2^k = |C|$. If not, let $c_0$ be a code word with $c_i=1$ then $x \to x+c$ is bijective (self-inverse) map that sends $C$ to itself and maps a $0$-word to a $1$-word (at this position) and vice versa so half of $C$ then has a $1$ and half has a $0$ at this position. So then the number is $\frac{1}{2}|C|=2^{k-1}$.

Orat's argument is a more elegant and abstract way of putting this argument.