<s>
In	O
coding	B-Error_Name
theory	I-Error_Name
,	O
Hamming(7,4 )	O
is	O
a	O
linear	O
error-correcting	O
code	O
that	O
encodes	O
four	O
bits	O
of	O
data	O
into	O
seven	O
bits	O
by	O
adding	O
three	O
parity	B-Error_Name
bits	I-Error_Name
.	O
</s>
<s>
It	O
is	O
a	O
member	O
of	O
a	O
larger	O
family	O
of	O
Hamming	B-Error_Name
codes	I-Error_Name
,	O
but	O
the	O
term	O
Hamming	B-Error_Name
code	I-Error_Name
often	O
refers	O
to	O
this	O
specific	O
code	O
that	O
Richard	O
W	O
.	O
Hamming	B-Error_Name
introduced	O
in	O
1950	O
.	O
</s>
<s>
At	O
the	O
time	O
,	O
Hamming	B-Error_Name
worked	O
at	O
Bell	O
Telephone	O
Laboratories	O
and	O
was	O
frustrated	O
with	O
the	O
error-prone	O
punched	B-Architecture
card	I-Architecture
reader	O
,	O
which	O
is	O
why	O
he	O
started	O
working	O
on	O
error-correcting	O
codes	O
.	O
</s>
<s>
The	O
Hamming	B-Error_Name
code	I-Error_Name
adds	O
three	O
additional	O
check	B-Error_Name
bits	I-Error_Name
to	O
every	O
four	O
data	O
bits	O
of	O
the	O
message	O
.	O
</s>
<s>
Hamming	B-Error_Name
's	O
(	O
7	O
,	O
4	O
)	O
algorithm	O
can	O
correct	O
any	O
single-bit	O
error	O
,	O
or	O
detect	O
all	O
single-bit	O
and	O
two-bit	O
errors	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
the	O
minimal	O
Hamming	B-Error_Name
distance	O
between	O
any	O
two	O
correct	O
codewords	O
is	O
3	O
,	O
and	O
received	O
words	O
can	O
be	O
correctly	O
decoded	O
if	O
they	O
are	O
at	O
a	O
distance	O
of	O
at	O
most	O
one	O
from	O
the	O
codeword	O
that	O
was	O
transmitted	O
by	O
the	O
sender	O
.	O
</s>
<s>
This	O
means	O
that	O
for	O
transmission	O
medium	O
situations	O
where	O
burst	O
errors	O
do	O
not	O
occur	O
,	O
Hamming	B-Error_Name
's	O
(	O
7	O
,	O
4	O
)	O
code	O
is	O
effective	O
(	O
as	O
the	O
medium	O
would	O
have	O
to	O
be	O
extremely	O
noisy	O
for	O
two	O
out	O
of	O
seven	O
bits	O
to	O
be	O
flipped	O
)	O
.	O
</s>
<s>
In	O
quantum	O
information	O
,	O
the	O
Hamming	B-Error_Name
(	O
7	O
,	O
4	O
)	O
is	O
used	O
as	O
the	O
base	O
for	O
the	O
Steane	O
code	O
,	O
a	O
type	O
of	O
CSS	O
code	O
used	O
for	O
quantum	B-Device
error	I-Device
correction	I-Device
.	O
</s>
<s>
The	O
goal	O
of	O
the	O
Hamming	B-Error_Name
codes	I-Error_Name
is	O
to	O
create	O
a	O
set	O
of	O
parity	B-Error_Name
bits	I-Error_Name
that	O
overlap	O
so	O
that	O
a	O
single-bit	O
error	O
in	O
a	O
data	O
bit	O
or	O
a	O
parity	B-Error_Name
bit	I-Error_Name
can	O
be	O
detected	O
and	O
corrected	O
.	O
</s>
<s>
While	O
multiple	O
overlaps	O
can	O
be	O
created	O
,	O
the	O
general	O
method	O
is	O
presented	O
in	O
Hamming	B-Error_Name
codes	I-Error_Name
.	O
</s>
<s>
This	O
table	O
describes	O
which	O
parity	B-Error_Name
bits	I-Error_Name
cover	O
which	O
transmitted	O
bits	O
in	O
the	O
encoded	O
word	O
.	O
</s>
<s>
For	O
example	O
,	O
p2	O
provides	O
an	O
even	B-Error_Name
parity	I-Error_Name
for	O
bits	O
2	O
,	O
3	O
,	O
6	O
,	O
and	O
7	O
.	O
</s>
<s>
It	O
also	O
details	O
which	O
transmitted	O
bit	O
is	O
covered	O
by	O
which	O
parity	B-Error_Name
bit	I-Error_Name
by	O
reading	O
the	O
column	O
.	O
</s>
<s>
For	O
example	O
,	O
d1	O
is	O
covered	O
by	O
p1	O
and	O
p2	O
but	O
not	O
p3	O
This	O
table	O
will	O
have	O
a	O
striking	O
resemblance	O
to	O
the	O
parity-check	O
matrix	O
(	O
H	O
)	O
in	O
the	O
next	O
section	O
.	O
</s>
<s>
So	O
,	O
by	O
picking	O
the	O
parity	B-Error_Name
bit	I-Error_Name
coverage	O
correctly	O
,	O
all	O
errors	O
with	O
a	O
Hamming	B-Error_Name
distance	O
of	O
1	O
can	O
be	O
detected	O
and	O
corrected	O
,	O
which	O
is	O
the	O
point	O
of	O
using	O
a	O
Hamming	B-Error_Name
code	I-Error_Name
.	O
</s>
<s>
Hamming	B-Error_Name
codes	I-Error_Name
can	O
be	O
computed	O
in	O
linear	B-Language
algebra	I-Language
terms	O
through	O
matrices	B-Architecture
because	O
Hamming	B-Error_Name
codes	I-Error_Name
are	O
linear	O
codes	O
.	O
</s>
<s>
For	O
the	O
purposes	O
of	O
Hamming	B-Error_Name
codes	I-Error_Name
,	O
two	O
Hamming	B-Error_Name
matrices	B-Architecture
can	O
be	O
defined	O
:	O
the	O
code	O
generator	O
matrix	O
G	O
and	O
the	O
parity-check	O
matrix	O
H	O
:	O
</s>
<s>
As	O
mentioned	O
above	O
,	O
rows	O
1	O
,	O
2	O
,	O
and	O
4	O
of	O
G	O
should	O
look	O
familiar	O
as	O
they	O
map	O
the	O
data	O
bits	O
to	O
their	O
parity	B-Error_Name
bits	I-Error_Name
:	O
</s>
<s>
In	O
fact	O
,	O
these	O
four	O
rows	O
are	O
linearly	O
independent	O
and	O
form	O
the	O
identity	B-Algorithm
matrix	I-Algorithm
(	O
by	O
design	O
,	O
not	O
coincidence	O
)	O
.	O
</s>
<s>
The	O
original	O
4	O
data	O
bits	O
are	O
converted	O
to	O
seven	O
bits	O
(	O
hence	O
the	O
name	O
"	O
Hamming(7,4 )	O
"	O
)	O
with	O
three	O
parity	B-Error_Name
bits	I-Error_Name
added	O
to	O
ensure	O
even	B-Error_Name
parity	I-Error_Name
using	O
the	O
above	O
data	O
bit	O
coverages	O
.	O
</s>
<s>
The	O
first	O
table	O
above	O
shows	O
the	O
mapping	O
between	O
each	O
data	O
and	O
parity	B-Error_Name
bit	I-Error_Name
into	O
its	O
final	O
bit	O
position	O
(	O
1	O
through	O
7	O
)	O
but	O
this	O
can	O
also	O
be	O
presented	O
in	O
a	O
Venn	B-Application
diagram	I-Application
.	O
</s>
<s>
The	O
first	O
diagram	O
in	O
this	O
article	O
shows	O
three	O
circles	O
(	O
one	O
for	O
each	O
parity	B-Error_Name
bit	I-Error_Name
)	O
and	O
encloses	O
data	O
bits	O
that	O
each	O
parity	B-Error_Name
bit	I-Error_Name
covers	O
.	O
</s>
<s>
In	O
the	O
adjacent	O
diagram	O
,	O
the	O
seven	O
bits	O
of	O
the	O
encoded	O
word	O
are	O
inserted	O
into	O
their	O
respective	O
locations	O
;	O
from	O
inspection	O
it	O
is	O
clear	O
that	O
the	O
parity	B-Error_Name
of	O
the	O
red	O
,	O
green	O
,	O
and	O
blue	O
circles	O
are	O
even	O
:	O
</s>
<s>
What	O
will	O
be	O
shown	O
shortly	O
is	O
that	O
if	O
,	O
during	O
transmission	O
,	O
a	O
bit	O
is	O
flipped	O
then	O
the	O
parity	B-Error_Name
of	O
two	O
or	O
all	O
three	O
circles	O
will	O
be	O
incorrect	O
and	O
the	O
errored	O
bit	O
can	O
be	O
determined	O
(	O
even	O
if	O
one	O
of	O
the	O
parity	B-Error_Name
bits	I-Error_Name
)	O
by	O
knowing	O
that	O
the	O
parity	B-Error_Name
of	O
all	O
three	O
of	O
these	O
circles	O
should	O
be	O
even	O
.	O
</s>
<s>
This	O
conclusion	O
is	O
based	O
on	O
the	O
observation	O
that	O
when	O
the	O
data	O
vector	O
is	O
multiplied	O
by	O
G	O
,	O
a	O
change	O
of	O
basis	O
occurs	O
into	O
a	O
vector	O
subspace	O
that	O
is	O
the	O
kernel	B-Algorithm
of	O
H	O
.	O
As	O
long	O
as	O
nothing	O
happens	O
during	O
transmission	O
,	O
r	O
will	O
remain	O
in	O
the	O
kernel	B-Algorithm
of	O
H	O
and	O
the	O
multiplication	O
will	O
yield	O
the	O
null	O
vector	O
.	O
</s>
<s>
The	O
diagram	O
to	O
the	O
right	O
shows	O
the	O
bit	O
error	O
(	O
shown	O
in	O
blue	O
text	O
)	O
and	O
the	O
bad	O
parity	B-Error_Name
created	O
(	O
shown	O
in	O
red	O
text	O
)	O
in	O
the	O
red	O
and	O
green	O
circles	O
.	O
</s>
<s>
The	O
bit	O
error	O
can	O
be	O
detected	O
by	O
computing	O
the	O
parity	B-Error_Name
of	O
the	O
red	O
,	O
green	O
,	O
and	O
blue	O
circles	O
.	O
</s>
<s>
If	O
a	O
bad	O
parity	B-Error_Name
is	O
detected	O
then	O
the	O
data	O
bit	O
that	O
overlaps	O
only	O
the	O
bad	O
parity	B-Error_Name
circles	O
is	O
the	O
bit	O
with	O
the	O
error	O
.	O
</s>
<s>
In	O
the	O
above	O
example	O
,	O
the	O
red	O
and	O
green	O
circles	O
have	O
bad	O
parity	B-Error_Name
so	O
the	O
bit	O
corresponding	O
to	O
the	O
intersection	O
of	O
red	O
and	O
green	O
but	O
not	O
blue	O
indicates	O
the	O
errored	O
bit	O
.	O
</s>
<s>
which	O
corresponds	O
to	O
the	O
fifth	O
column	O
of	O
H	O
.	O
Furthermore	O
,	O
the	O
general	O
algorithm	O
used	O
(	O
see	O
Hamming	B-Error_Name
code	I-Error_Name
#General	O
algorithm	O
)	O
was	O
intentional	O
in	O
its	O
construction	O
so	O
that	O
the	O
syndrome	O
of	O
101	O
corresponds	O
to	O
the	O
binary	O
value	O
of	O
5	O
,	O
which	O
indicates	O
the	O
fifth	O
bit	O
was	O
corrupted	O
.	O
</s>
<s>
Alternatively	O
,	O
Hamming	B-Error_Name
codes	I-Error_Name
can	O
be	O
used	O
to	O
detect	O
single	O
and	O
double	O
bit	O
errors	O
,	O
by	O
merely	O
noting	O
that	O
the	O
product	O
of	O
H	O
is	O
nonzero	O
whenever	O
errors	O
have	O
occurred	O
.	O
</s>
<s>
This	O
yields	O
only	O
one	O
circle	O
(	O
green	O
)	O
with	O
an	O
invalid	O
parity	B-Error_Name
but	O
the	O
errors	O
are	O
not	O
recoverable	O
.	O
</s>
<s>
However	O
,	O
the	O
Hamming	B-Error_Name
(	O
7	O
,	O
4	O
)	O
and	O
similar	O
Hamming	B-Error_Name
codes	I-Error_Name
cannot	O
distinguish	O
between	O
single-bit	O
errors	O
and	O
two-bit	O
errors	O
.	O
</s>
<s>
Similarly	O
,	O
Hamming	B-Error_Name
codes	I-Error_Name
cannot	O
detect	O
or	O
recover	O
from	O
an	O
arbitrary	O
three-bit	O
error	O
;	O
Consider	O
the	O
diagram	O
:	O
if	O
the	O
bit	O
in	O
the	O
green	O
circle	O
(	O
colored	O
red	O
)	O
were	O
1	O
,	O
the	O
parity	B-Error_Name
checking	I-Error_Name
would	O
return	O
the	O
null	O
vector	O
,	O
indicating	O
that	O
there	O
is	O
no	O
error	O
in	O
the	O
codeword	O
.	O
</s>
<s>
Included	O
is	O
the	O
eight-bit	O
value	O
if	O
an	O
extra	O
parity	B-Error_Name
bit	I-Error_Name
is	O
used	O
(	O
see	O
Hamming(7,4 )	O
code	O
with	O
an	O
additional	O
parity	B-Error_Name
bit	I-Error_Name
)	O
.	O
</s>
<s>
(	O
The	O
data	O
bits	O
are	O
shown	O
in	O
blue	O
;	O
the	O
parity	B-Error_Name
bits	I-Error_Name
are	O
shown	O
in	O
red	O
;	O
and	O
the	O
extra	O
parity	B-Error_Name
bit	I-Error_Name
shown	O
in	O
green	O
.	O
)	O
</s>
<s>
The	O
Hamming(7,4 )	O
code	O
is	O
closely	O
related	O
to	O
the	O
E7	O
lattice	O
and	O
,	O
in	O
fact	O
,	O
can	O
be	O
used	O
to	O
construct	O
it	O
,	O
or	O
more	O
precisely	O
,	O
its	O
dual	O
lattice	O
E7∗	O
(	O
a	O
similar	O
construction	O
for	O
E7	O
uses	O
the	O
dual	O
code	O
[7,3,4]2	O
)	O
.	O
</s>
<s>
For	O
instance	O
,	O
the	O
extended	O
(	O
8	O
,	O
4	O
)	O
-Hamming	O
code	O
,	O
which	O
arises	O
from	O
the	O
addition	O
of	O
a	O
parity	B-Error_Name
bit	I-Error_Name
,	O
is	O
also	O
related	O
to	O
the	O
E8	O
lattice	O
.	O
</s>
