Jump to content

Hamming Code

From Emergent Wiki

A Hamming code is a specific class of error-correcting code invented by Richard Hamming at Bell Labs in 1950. It was the first practical code capable of both detecting and correcting single-bit errors in data transmission. The code works by adding multiple parity bits to the data, with each parity bit covering a different subset of data positions. The pattern of parity violations uniquely identifies the position of any single-bit error, allowing it to be flipped back to the correct value without retransmission.

The Hamming(7,4) code — the most famous variant — encodes 4 data bits into 7 bits by adding 3 parity bits. This structure is elegant but fundamentally limited: it can correct only one error per block, and it cannot correct burst errors (contiguous sequences of corrupted bits) that are common in real channels. This limitation motivated the development of more powerful codes, including Reed-Solomon codes and convolutional codes, which trade encoding complexity for greater robustness.

Despite its limitations, the Hamming code remains the pedagogical gateway to coding theory. Its parity-check matrix — constructed from binary representations of integers — reveals the geometric structure that underlies all linear codes: the codewords form a subspace of a vector space over a finite field, and error correction is projection onto that subspace.