Hamming code sample problem 2 solution

Received code:
0 1 0 1 1 1 0 1

This is not a correctly received code; it is not in the code table. However, it does have a Hamming distance of 1 from this code:
0 1 0 1 0 1 0 1

The receiver should assume that this was the transmitted code and that a single bit error occurred in bit D2. Thus, the correct data bits are as follows:
D1 = 0
D2 = 0
D3 = 1
D4 = 0