Rectangle Symmetry and Error Detection
What could a cardboard postcard resting on your desk possibly have in common with a spacecraft transmitting binary telemetry across a noisy radio link?
At first glance, one belongs to Euclidean geometry and the other to digital telecommunications. Yet one of the deepest lessons of modern mathematics is that abstract algebra strips away physical costumes. When two completely different systems obey the same composition table, they are realizations of the same abstract group, and any structural theorem proved about one translates immediately into a theorem about the other.
In this article, we take a non-square rectangle in the plane, write down its four rigid symmetries, and watch that exact four-element group reappear inside a 3-bit communication channel as the classical $[3, 2, 2]$ single parity-check code. Along the way, we will see how group homomorphisms, kernels, and quotient cosets explain both why single-bit errors are guaranteed to be caught and why two simultaneous bit flips slip past the detector in disguise.
1. The Symmetry Group of a Non-Square Rectangle ($D_2$)
Place a rectangle that is not a square ($a \neq b > 0$) in the Cartesian plane, centered at the origin with vertices at $(\pm a, \pm b)$. Why do we insist that $a \neq b$? Because a square ($a = b$) admits $90^\circ$ rotations and diagonal reflections, which do not commute and enlarge its symmetry group to the 8-element dihedral group $D_4$. When the width and height differ ($a \neq b$), a $90^\circ$ turn swaps the long and short sides, visibly altering the footprint of the shape.
Only four distance-preserving transformations map the non-square rectangle back onto its exact original footprint:
- $e$ (Identity): Do nothing, $(x, y) \mapsto (x, y)$.
- $h$ (Horizontal-Axis Reflection): Flip across the $x$-axis, $(x, y) \mapsto (x, -y)$.
- $v$ (Vertical-Axis Reflection): Flip across the $y$-axis, $(x, y) \mapsto (-x, y)$.
- $r$ ($180^\circ$ Half-Turn Rotation): Rotate by $\pi$ radians around the origin, $(x, y) \mapsto (-x, -y)$.
Let us check what happens when we compose these four transformations one after another (writing $A \circ B$ for applying $B$ first, then $A$):
1. Every symmetry is its own inverse: Flipping a rectangle twice across the same axis, or rotating it twice by $180^\circ$, brings every corner back home:
$$e^2 = h^2 = v^2 = r^2 = e$$
2. Reflecting across both axes produces the $180^\circ$ rotation: Sending $(x, y) \mapsto (x, -y) \mapsto (-x, -y)$ gives the exact same result regardless of order:
$$h \circ v = v \circ h = r$$
3. Any two non-trivial symmetries multiply to give the third: Composing a reflection with the $180^\circ$ rotation cancels one sign flip and leaves the other:
$$h \circ r = r \circ h = v, \qquad v \circ r = r \circ v = h$$
Collecting all sixteen products gives the Cayley table of the dihedral group $(D_2, \circ)$:
| $\circ$ | $e$ | $h$ | $v$ | $r$ |
|---|---|---|---|---|
| $e$ | $e$ | $h$ | $v$ | $r$ |
| $h$ | $h$ | $e$ | $r$ | $v$ |
| $v$ | $v$ | $r$ | $e$ | $h$ |
| $r$ | $r$ | $v$ | $h$ | $e$ |
Notice that the table is symmetric across its main diagonal ($A \circ B = B \circ A$), so $D_2$ is an Abelian (commutative) group of order $4$. In his 1884 Vorlesungen über das Ikosaeder, Felix Klein named this abstract structure the Vierergruppe (the Klein four-group, denoted $V_4$). Up to isomorphism, there are only two groups of order $4$: the cyclic group $C_4 \cong \mathbb{Z}_4$ (which contains elements of order $4$, like a $90^\circ$ rotation) and the Klein four-group $V_4 \cong \mathbb{Z}_2 \times \mathbb{Z}_2$, characterized by the rule that every non-identity element has order $2$.
2. Noisy Binary Channels and the $[3, 2, 2]$ Single Parity-Check Code
Now let us leave geometry behind and step into digital communication. Suppose we want to transmit a 2-bit message $m = (m_1, m_2) \in \mathbb{F}_2^2 = \{00, 01, 10, 11\}$ across a noisy channel where thermal noise or cosmic rays can flip a bit ($0 \leftrightarrow 1$).
If we transmit the raw 2-bit string $(m_1, m_2)$ directly, we are completely defenseless: if $01$ suffers a single-bit flip in the first position, it arrives as $11$, which is another valid message! The receiver has no way of knowing that an error occurred.
To make single-bit errors visible, we append a third bit $c_3$, chosen so that the total number of $1$s in the transmitted 3-bit word $c = (c_1, c_2, c_3)$ is always even:
$$(m_1, m_2) \longmapsto (c_1, c_2, c_3) = (m_1,\; m_2,\; m_1 \oplus m_2)$$
Here $\oplus$ denotes addition modulo $2$ (logical XOR), where $0 \oplus 0 = 0$, $0 \oplus 1 = 1$, $1 \oplus 0 = 1$, and $1 \oplus 1 = 0$. In linear coding theory over the finite field $\mathbb{F}_2 = \{0, 1\}$, this encoding is generated by the $2 \times 3$ generator matrix $G$ and checked by the $1 \times 3$ parity-check matrix $H$:
$$G = \begin{pmatrix} 1 & 0 & 1 \\ 0 & 1 & 1 \end{pmatrix}, \qquad H = \begin{pmatrix} 1 & 1 & 1 \end{pmatrix}, \qquad G H^T = \begin{pmatrix} 0 \\ 0 \end{pmatrix} \pmod{2}$$
Multiplying each of the four possible 2-bit messages $m \in \mathbb{F}_2^2$ by $G$ produces our codebook of four valid even-weight codewords inside the 8-element space $\mathbb{F}_2^3$:
$$C = \{000,\; 011,\; 101,\; 110\}$$
In coding theory, $C$ is called the $[3, 2, 2]$ single parity-check (SPC) code:
- Block length $n = 3$: Each transmitted codeword has $3$ physical bits.
- Dimension $k = 2$: The code carries $k = 2$ independent information bits ($|C| = 2^k = 4$ codewords).
- Minimum Hamming distance $d = 2$: The Hamming distance $d_H(x, y)$ between two bitstrings is the number of positions where they differ, which equals the Hamming weight (number of $1$s) of their XOR sum, $w(x \oplus y)$. Every pair of distinct codewords in $C$ differs in exactly $2$ bit positions, so $d = \min_{c \neq c'} d_H(c, c') = 2$.
3. The Explicit Isomorphism $(D_2, \circ) \cong (C, \oplus)$
What happens when we add two valid codewords in $C$ using bitwise XOR $\oplus$? For any two binary strings $x, y \in \mathbb{F}_2^3$, their Hamming weights satisfy:
$$w(x \oplus y) = w(x) + w(y) - 2\,w(x \wedge y) \equiv w(x) + w(y) \pmod{2}$$
Because the sum of two even numbers minus an even overlap is always even, the bitwise XOR of two even-weight codewords is automatically another even-weight codeword in $C$!
Let us check the group structure of $(C, \oplus)$:
- Identity: $000 \oplus c = c$ for every $c \in C$.
- Self-inverse (order 2): Since $1 \oplus 1 = 0$ in $\mathbb{F}_2$, XORing any codeword with itself cancels every bit:
$$000 \oplus 000 = 011 \oplus 011 = 101 \oplus 101 = 110 \oplus 110 = 000$$
- Product of distinct non-zero codewords: XORing any two non-zero codewords yields the third:
$$011 \oplus 101 = 110, \qquad 011 \oplus 110 = 101, \qquad 101 \oplus 110 = 011$$
This is the exact same algebraic structure as our rectangle symmetries! Define the bijection $\Phi: D_2 \to C$ by matching the identity with $000$ and pairing the three non-trivial symmetries with the three weight-2 codewords:
| Rectangle Symmetry $g \in D_2$ | Coordinate Action on $(x, y)$ | Binary Codeword $\Phi(g) \in C$ |
|---|---|---|
| $e$ (Identity) | $(x, y) \mapsto (x, y)$ | $000$ |
| $h$ (Horizontal reflection) | $(x, y) \mapsto (x, -y)$ | $011$ |
| $v$ (Vertical reflection) | $(x, y) \mapsto (-x, y)$ | $101$ |
| $r = h \circ v$ ($180^\circ$ rotation) | $(x, y) \mapsto (-x, -y)$ | $110 = 011 \oplus 101$ |
Comparing the Cayley table of $(C, \oplus)$ directly with our earlier table for $(D_2, \circ)$ confirms that $\Phi(g_1 \circ g_2) = \Phi(g_1) \oplus \Phi(g_2)$ for every pair of elements:
| $\oplus$ | $000$ | $011$ | $101$ | $110$ |
|---|---|---|---|---|
| $000$ | $000$ | $011$ | $101$ | $110$ |
| $011$ | $011$ | $000$ | $110$ | $101$ |
| $101$ | $101$ | $110$ | $000$ | $011$ |
| $110$ | $110$ | $101$ | $011$ | $000$ |
Therefore, the symmetry group of a non-square rectangle and the additive group of codewords of the $[3, 2, 2]$ parity code are isomorphic:
$$(D_2, \circ) \cong (C, \oplus) \cong \mathbb{Z}_2 \times \mathbb{Z}_2 \cong V_4$$
(One helpful algebraic distinction is worth keeping in mind: $(C, \oplus) \cong V_4$ is the 4-element additive group of codewords under XOR. If instead we ask which permutations of the three coordinate axes $\{1, 2, 3\}$ map the set $C$ to itself, any permutation of three bits preserves total Hamming weight, so the coordinate-permutation automorphism group of $C$ is the 6-element symmetric group $S_3$.)
4. Syndromes, Quotient Cosets, and the Limits of Error Detection
Now let us see how group theory explains error detection itself. All $2^3 = 8$ possible three-bit strings form the ambient Abelian group $G = (\mathbb{F}_2^3, \oplus)$. When a transmitter sends a codeword $c \in C$ and the noisy channel introduces an error vector $e = (e_1, e_2, e_3) \in \mathbb{F}_2^3$ (where $e_i = 1$ means bit $i$ flipped), the receiver observes:
$$y = c \oplus e$$
To test whether $y$ is uncorrupted without knowing which codeword $c$ was sent, the receiver computes the parity syndrome $s: (\mathbb{F}_2^3, \oplus) \to (\mathbb{F}_2, \oplus)$:
$$s(y) = y H^T = y_1 \oplus y_2 \oplus y_3 \pmod{2}$$
Because addition in $\mathbb{F}_2$ is commutative and associative, the syndrome map $s$ is a surjective group homomorphism:
$$s(x \oplus y) = (x_1 \oplus y_1) \oplus (x_2 \oplus y_2) \oplus (x_3 \oplus y_3) = s(x) \oplus s(y)$$
What is the kernel of this homomorphism (the set of 3-bit strings sent to the identity $0 \in \mathbb{F}_2$)? A 3-bit string has XOR sum $0$ if and only if it contains an even number of $1$s:
$$\ker(s) = \{y \in \mathbb{F}_2^3 : s(y) = 0\} = \{000, 011, 101, 110\} = C$$
Our Klein four-group code $C$ is literally the kernel of the syndrome homomorphism! Because $s(c) = 0$ for every valid codeword $c \in C$, evaluating the syndrome on a received word $y = c \oplus e$ strips away the message completely and isolates the parity of the error:
$$s(y) = s(c \oplus e) = \underbrace{s(c)}_{0} \oplus s(e) = s(e)$$
By the First Isomorphism Theorem, the normal subgroup $C = \ker(s) \triangleleft \mathbb{F}_2^3$ partitions the 8-element space $\mathbb{F}_2^3$ into two disjoint cosets of size $4$, forming the quotient group:
$$\mathbb{F}_2^3 / C \cong \mathbb{F}_2$$
| Syndrome $s(y)$ | Coset in $\mathbb{F}_2^3 / C$ | Member Bitstrings | Physical Meaning |
|---|---|---|---|
| $s = 0$ | $000 \oplus C = C$ | $\{000, 011, 101, 110\}$ | Even weight: valid codewords (no detectable error) |
| $s = 1$ | $100 \oplus C$ | $\{100, 111, 001, 010\}$ | Odd weight: corrupted words (error detected!) |
This coset partition immediately tells us what the $[3, 2, 2]$ code can and cannot do:
- Every single-bit error is detected ($w(e) = 1$): The three possible single-bit flips are $e \in \{100, 010, 001\}$. Each has odd weight, so $s(e) = 1$. Adding any single-bit error to a codeword $c \in C$ pushes $y = c \oplus e$ out of the kernel $C$ into the odd-parity coset $100 \oplus C$, triggering the syndrome alarm $s(y) = 1$.
- Why single-bit errors cannot be corrected here: Suppose the receiver measures $y = 100$, so $s(y) = 1$. Which codeword was sent? Notice that $100$ is one bit flip away from $000$ (via $e = 100$), one bit flip away from $101$ (via $e = 001$), and one bit flip away from $110$ (via $e = 010$). Because all three weight-1 errors share the same syndrome coset $100 \oplus C$, a 1-bit syndrome cannot distinguish which of the three positions flipped! Correcting single-bit errors requires minimum distance $d \ge 3$ so each weight-1 error occupies its own distinct coset.
- Why double-bit errors escape detection ($w(e) = 2$): What if two bits flip simultaneously, say $e \in \{011, 101, 110\}$? Look at the set of weight-2 errors: they are non-zero elements of the code $C = \ker(s)$ itself! In the language of our rectangle, a 2-bit error acts like a non-trivial symmetry $h, v,$ or $r \in D_2$: by closure of the group, $c \oplus e$ lands on another valid codeword $c' \in C$ with syndrome $s(y) = 0$, fooling the receiver into accepting a corrupted message.
5. Epilogue: A Blueprint for Quantum Stabilizer Codes
It is remarkable how much coding theory is already visible inside a simple rectangle:
- The subgroup $C \cong D_2 \cong \mathbb{Z}_2^2$ defines the classical code of valid bitstrings.
- The quotient group $\mathbb{F}_2^3 / C \cong \mathbb{Z}_2$ classifies the error syndromes measurable without disturbing the message label.
- Non-trivial elements inside the kernel ($C \setminus \{000\}$) represent undetectable logical errors that map one valid codeword to another.
When you move from classical bits to quantum error correction (explored in detail in my companion article, Group Theory for Quantum Computing: Paulis, Codes, and Magic States), the parity check $y_1 \oplus y_2 \oplus y_3$ becomes a Pauli check like $Z \otimes Z \otimes Z$. Its $+1$ eigenspace is spanned by $|000\rangle, |011\rangle, |101\rangle, |110\rangle$: quantum superpositions of our classical codewords. More generally, commuting Hermitian Pauli checks $g_1, \dots, g_r$ generate an Abelian stabilizer group $\mathcal{S}$ that excludes $-I$. The quantum codespace is the Hilbert subspace
$$\mathcal{Q} = \{|\psi\rangle \in (\mathbb{C}^2)^{\otimes n} : g|\psi\rangle = |\psi\rangle \text{ for every } g \in \mathcal{S}\} = \bigcap_{j=1}^{r} \ker(g_j - I),$$
an intersection of kernels of linear maps on state vectors.
There is also a syndrome homomorphism, but its inputs are now Pauli error operators, not state vectors. For a Pauli operator $E \in \mathcal{P}_n$, the commutation relation $g_j E = (-1)^{s_j(E)} E g_j$ defines a group homomorphism $s_{\mathrm{P}} : \mathcal{P}_n \longrightarrow \mathbb{F}_2^r$ whose kernel
$$K_{\mathrm{syn}} = \ker s_{\mathrm{P}} = C_{\mathcal{P}_n}(\mathcal{S}) = \{E \in \mathcal{P}_n : g_j E = E g_j \text{ for every } j\}$$
is the Pauli centralizer of $\mathcal{S}$. Even for a single check on one qubit, the state-space codespace and the operator-space kernel are distinct mathematical objects:
$$\mathcal{S} = \langle Z \rangle, \qquad \mathcal{Q} = \operatorname{span}\{|0\rangle\}, \qquad K_{\mathrm{syn}} = \{\pm I, \pm iI, \pm Z, \pm iZ\}.$$
Quotients then separate into two distinct roles on the operator side. For $r$ independent checks, $\mathcal{P}_n / K_{\mathrm{syn}} \cong \mathbb{F}_2^r$ classifies syndrome outcomes: two Pauli errors have the same syndrome precisely when their relative operator lies in $K_{\mathrm{syn}}$. Within the zero-syndrome operators, $K_{\mathrm{syn}} / \mathcal{S}$ identifies operators having the same linear action on encoded states while retaining global phases, consistently with the companion article. Removing overall phases via $\Phi_n = \{I, -I, iI, -iI\}$ gives $K_{\mathrm{syn}} / (\mathcal{S}\Phi_n)$, whose nonidentity classes are the undetectable logical Pauli actions that can change encoded information (whereas a phase multiple of a stabilizer lies outside $\mathcal{S}$ without corrupting encoded data). These are groups of operations acting on the codespace; they are not the codespace itself.
Originally published in a shorter Bengali outreach edition as "একটা আয়তক্ষেত্র কীভাবে তথ্যের ভুল ধরতে শেখায়?" on Bigganblog.