If a message, say two bytes, has been received, and it's known to have been encoded using Hamming code, but the parity used for encoding (even / odd) is not known, would the application of both Hamming code with odd and even parity work to identify errors on the message received?
-
1Please have a look at this question: stackoverflow.com/questions/388599/how-does-the-hamming-code-work/ – Toon Krijthe Dec 23 '12 at 22:23
1 Answers
If you do not know if even or odd parity is used, you can't tell if a single message is changed in error.
Example: using odd parity on a 4 bit message:
1101 --[Add parity]-> 11010 --[Introduce error]-> 10010.
The received message contains an even number of 1's. We know it is send using odd parity, so an error has occured.
Using an unknown parity on a 4 bit message:
1101 --[Add parity]-> 1101? --[Introduce error]-> 1001?.
We don't know the parity so we have no way to determine if an error has occured for this message.
But there is hope.
If we assume, the channel to be moderately reliable, and there are a lot of messages send, we could use probability to determine the error.
Example: collect a certain amount of messages. If at least 90% of them have odd parity, we could assume, the even parity messages to be in error.
If the number of received odd and even parity messages are close together, we are in real trouble. Either the channel is completely unreliable, or the sender uses both odd and even parity.

- 52,876
- 38
- 145
- 202
-
1voila! Exactly what I was thinking, and the exact confirmation I've been looking for! Thank you very much! +1 for the explanation, and +1 up there in the comment, for your 2yr old response. Nice drawings down there! (: – Rubens Dec 23 '12 at 22:46
-
haha! Thanks! Everything is so clear now, so incredibly comprehensible (: – Rubens Dec 23 '12 at 22:49