What Is a Parity-Check Matrix in Binary Coding?
A parity-check matrix is a fundamental linear algebra tool used in error-detecting and error-correcting codes to verify whether a transmitted binary message has arrived intact. In digital communications, binary data is grouped into structured blocks called codewords. The parity-check matrix acts as a set of linear equations that every valid codeword must satisfy, allowing the receiver to instantly detect bit flips or corruption without needing prior knowledge of the original message content.
In an \((n, k)\) binary linear block code, data is transmitted in blocks of \(n\) bits, consisting of \(k\) information bits and \(m = n - k\) parity (redundancy) bits. The parity-check matrix, denoted as \(H\), has dimensions \((n - k) \times n\). Each row in matrix \(H\) represents a specific linear parity equation, and each column corresponds to a specific bit position in the binary codeword. Because the system operates entirely in the binary number system (Galois Field \(GF(2)\)), all mathematical operations rely on modulo-2 arithmetic, where addition is equivalent to the logical XOR operation and multiplication is equivalent to logical AND.
To validate a received binary vector \(r\) of length \(n\), the receiver multiplies the parity-check matrix \(H\) by the transpose of the received vector \(r^T\) using modulo-2 arithmetic. The resulting \((n - k) \times 1\) binary vector is known as the syndrome (\(S\)):
\[S = H r^T \pmod 2\]
Validation occurs based on the value of the syndrome:
- Zero Syndrome (\(S = 0\)): If every element of the resulting syndrome vector is zero, the received vector satisfies all parity equations simultaneously. The system confirms that \(r\) is a valid codeword and accepts it as error-free.
- Non-Zero Syndrome (\(S \neq 0\)): If the result contains any ones, at least one parity condition has failed. The system flags the received data as corrupted.
When a transmission error occurs, the received vector can be expressed as \(r = c + e\), where \(c\) is the original valid codeword and \(e\) is an error vector containing ones at the corrupted bit positions. Because matrix multiplication is distributive, the syndrome calculation yields:
\[S = H (c + e)^T = H c^T + H e^T \pmod 2\]
Since \(H c^T = 0\) for any valid codeword, the equation simplifies to \(S = H e^T\). This means the syndrome depends exclusively on the error pattern \(e\), not the transmitted message itself. In advanced schemes like Hamming codes or Low-Density Parity-Check (LDPC) codes, the specific non-zero pattern of the syndrome identifies the exact location of the flipped bits, allowing the receiver to invert them back to their correct binary state.