To answer this question you need to understand the hamming distance.
The hamming is the number of difference bits in two vectors.
For example, suppose you have a single parity bit for each codeword. What's the hamming distance?
Suppose you have one data bit to send and a single parity bit. Let the parity bit be even...that is, make an even number of ones in the code word. The codeword is the data + the parity....
Possible data words:
1 or 0
Possible codewords:
11 or 00
Note, the hamming distance is two.
Try another...suppose you have 2 data bits....
possible data bits:
A |
B |
0 |
0 |
0 |
1 |
1 |
0 |
1 |
1 |
Codewords, with parity will be:
A |
B |
P= A xor B |
0 |
0 |
0 |
0 |
1 |
1 |
1 |
0 |
1 |
1 |
1 |
0 |
Suppose I have number of bits in the code word equal to n and the number of bits in the message equal to m so that the number check bits is equal to
k = n - m
Suppose n = 3 and m = 1, now the number of check bits is 2. What is the maximum hamming distance between any two code words?
000 or 111
Suppose m=2 and k = 2 so that n = 4. Now I can transmit
ABp1p2
0000
0101
1010
1111
Hamming distance now is 2. How about a 3 bit code?