Maximum number of codewords

1k Views Asked by At

So , i'm trying to figure out the following ,

What's the maximum number of codewords of length n in a code in which any single error can be detected ?

For a code C to detect any single error , then weight(u+v) != 1 for all u,v in C .

So C has minimum distance at least 2 .

Here I couldn't go on , I know the answer is 2^(n-1) , but how ?`any help ?

1

There are 1 best solutions below

0
On

For codewords with length n, there are n error patterns with weight=1.
That is (00...01), (00...10), ..., (10...00).
If you have to correct each of them, then you'll need n distinct sydromes.
But if you only need to detect them, then what you need is only a nonzero syndrome which can be realized by only 1 parity check bit.

Thus, the length of your message is (n-1), which means you have $2^{(n-1)}$ codewords at most.