Parity Bit Detecting Odd Bit Errors

244 Views Asked by At

I'm going over a past paper which has a true or false question with the following statement.

A single parity bit computed over 128 data bits can detect an error when bit-flips occur in exactly 93 of the 128 data bits, and no bit-flip occurs in the parity bit.

I understand that a parity bit can detect all odd numbers of bit flips (including the parity bit). Since the parity bit has not flipped and an odd number of bit flips have occurred in the data is clear that the error will be detected by the parity bit and that this statement is in fact true. Would that be correct?

1

There are 1 best solutions below

0
On BEST ANSWER

Yes, this is correct. The parity bit $p$ is determined so that $p \equiv \sum_{i=1}^{128}b_i \pmod{2}$ where $b_i$ denotes the correct bits.

If you now have the changed bits $b_i'$, you know that for $93$ you have $b_i' = b_i+1$ modulo $2$ while for the others you have $b_i' =b_i$.

Thus

$$\sum_{i=1}^{128}b_i' \equiv \sum_{i=1}^{128}b_i +93 \equiv \sum_{i=1}^{128}b_i +1 \equiv p+1 \not\equiv p \pmod{2} $$ and you detect the error.