D = 1010001101
P = 110101
1101010110
-----------------
110101 | 101000110100000
110101
111011
110101
111010
110101
111110
110101
101100
110101
110010
110101
01110
So the remainder is 01110
We can now Build the message 25D+R
M = 101000110101110
Send this. When it arrives, we divide by P again.
1101010110
-----------------
110101 | 101000110101110
110101
111011
110101
111010
110101
111110
110101
101111
110101
110101
110101
0
10110 and 10110 have a hamming distance of 0
10110 and 00110 have a hamming distance of 1
10110 and 00100 have a hamming distance of 2
10110 and 01100 have a hamming distance of 3
00 00000
01 00111
10 11001
11 11101