Hamming code for the bit sequence
Solution:
First we find redundant bits (r)Â such that 2r >= r+m+1
so here r = 4
So there are 4 redundant bits;
r1,r2,r4,r8Â Â Â Â Â Â Â Â
Bits after insertion of redundant bits…
1Â 0Â 0Â 1Â r8Â 1Â 1Â 0 r4Â 1 r2Â r1
^                …………………          ^
12th bit                                   1st bit  (r1)
r1 is calculated from even parity of bits number ( 1,3,5,7,9,11)
r2 is calculated from even parity of bits (2,3,6,7,10,11)
r4 is calculated from even parity of bits (4,5,6,7,12)
r8 is calculated from even parity of bits (8,9,10,11,12)
calculation of r1
as bit no. 3 = 1
   bit no. 5 = 0
   bit no. 7 = 1
   bit no. 9 = 1
   bit no. 11 = 0
to make no. of 1's even we have r1 = 1
count no of 1's for which r2 take cares of bit (2,3,6,7,10,11)
No. of 1's are found to be = 3 (on bit 3,6,7)
It is clearly odd (for even parity we have to make no of 1's = even , if already no of ones is even, then simply r = 0)
So what we we'll do is, make r2 = 1 to make no of 1's = even
Similarly ,
r2 =1
r4 =1
r8 =0
Hence Following are the redundancy bits.
r1 = 1
r2 = 1
r4 = 1
r8 = 0
So the Hamming code is 100101101111