In order to detect or correct transmission or storage errors,
some additional, redundant bits, called "check bits", can be
added to a number of data bits to construct a codeword. The
number of corresponding bits that differ between two codewords
is the Hamming distance of those two codewords. (See R.W.
Hamming, "Error Detecting and Error Correcting Codes," Bell
System Technical Journal, vol. 29, pp. 147-160, April 1950.) For
example, the Hamming distance between the codewords 1001 and
0101 is 2. The Hamming distance of two codewords can be
calculated as the number of 1 bits in the bitwise exclusive-or
of the two codewords: 1001 xor 0101 = 1100. A code is the set of
all codewords of a given length that are constructed by adding a
specified number of check digits in a specified way to a
specified number of data bits. The minimum Hamming distance of a
code is the minimum of the Hamming distance between all possible
pairs of codewords of that code. The following table indicates
the Hamming distance between all pa