Originally Posted by

**for those who don't know about hamming codes**
A parity bit functions by forcing the sum of a some predetermined set of bits to be an even number (called even parity) or an odd number (called odd parity). In this project, we are interested in even parity. To get the desired effect, the parity bit is set to one or zero according to the sum of the specified original bits. If the selected set of original bits sums to an even number, the extra parity bit is set to zero; if it sums to an odd number, it is set to one. Hence, in either case, the sum -- including the parity bit -- will always be an even number.

For an original message that is 8 bits long, 4 parity bits are added in strategic locations to form a 12-digit message. Each of these additional bits is the parity bit for a different combination of bits in the message, as follows. (Note: for purposes of this problem, bit 1 is defined to be the leftmost bit in the sequence.)

* Parity bit in position 1 combines with bits at positions 3, 5, 7, 9 and 11.

* Parity bit in position 2 combines with bits at positions 3, 6, 7, 10 and 11.

* Parity bit in position 4 combines with bits at positions 5, 6, 7 and 12.

* Parity bit in position 8 combines with bits at positions 9, 10, 11 and 12.

Thus, for instance, if the message to be sent is

10110100

then the message to be sent should be augmented with parity bits as follows

BIT NUMBER 1 2 3 4 5 6 7 8 9 10 11 12

ORIGINAL MESSAGE 1 0 1 1 0 1 0 0

SENT MESSAGE 0 0 1 0 0 1 1 1 0 1 0 0

and it is transmitted as

001001110100

Notice that bit 1 is 0 because the sum of bits 3, 5, 7, and 11 is 1 + 0 + 1 + 0 + 0 = 0, which is an even number. And bit 8 is 1 because the sum of bits 9, 10, 11, and 12 is 0 + 1 + 0 + 0 = 1, which is odd.