79 Communication Complexity — Hamming
79.1 Overview
This module develops the combinatorics of Hamming balls and spheres over a finite alphabet \(\alpha \) of size \(q\). The main results are exact cardinality formulas: the Hamming sphere of radius \(k\) centred at any word has size \(\binom {n}{k}(q-1)^k\), and the Hamming ball of radius \(r\) has size \(\mathrm{ballVol}(n,r,q) = \sum _{i=0}^{r}\binom {n}{i}(q-1)^i\).
79.2 Declarations
A word of length \(n\) over alphabet \(\alpha \) is a function \(\mathrm{Fin}\, n \to \alpha \); it is an abbreviation for the type of length-\(n\) codewords used throughout this module.
The Hamming ball of radius \(r\) centred at \(u \in \alpha ^n\) is the finset
The Hamming sphere of radius \(r\) centred at \(u \in \alpha ^n\) is the finset
For a length-\(n\) code over an alphabet of size \(q\), the ball volume at radius \(t\) is
Let \(\alpha \) be a finite alphabet, fix a centre word \(u \in \alpha ^n\), and let \(r\) and \(t\) be natural numbers with \(r \ne t\). Then the Hamming sphere \(S_r(u) = \{ v \in \alpha ^n : d(u,v) = r\} \) of radius \(r\) and the Hamming sphere \(S_t(u) = \{ v \in \alpha ^n : d(u,v) = t\} \) of radius \(t\), both centred at \(u\), are disjoint, where \(d\) denotes the Hamming distance.
Let \(\alpha \) be a finite alphabet, let \(u \in \alpha ^n\) be a word of length \(n\), and let \(r\) be a natural number. For \(t \in \mathbb {N}\), write \(S_t(u)\) for the Hamming sphere of radius \(t\) centred at \(u\). Then the family \(\{ S_t(u)\} _{t \in \{ 0,1,\ldots ,r-1\} }\) is pairwise disjoint: for any two distinct indices \(s, t\) with \(s, t \lt r\), the spheres \(S_s(u)\) and \(S_t(u)\) share no common word.
Let \(u \in \alpha ^n\) be a word of length \(n\) over a finite alphabet \(\alpha \), and let \(r\) be a natural number. Then the Hamming ball of radius \(r\) centred at \(u\) is the disjoint union of the Hamming spheres of radii \(0, 1, \dots , r\) centred at \(u\):
The support of \(v\) relative to \(u\) is the finset of coordinate positions where the two words differ: \(\mathrm{support}(u,v) = \{ i \in \mathrm{Fin}\, n : u_i \ne v_i\} \).
Let \(u,v\) be words of length \(n\) over a finite alphabet \(\alpha \), that is, functions \(\mathrm{Fin}\, n \to \alpha \). Then the Hamming distance between them equals the number of coordinates on which they differ:
For a word \(u\) and a finset \(S \subseteq \mathrm{Fin}\, n\), the support fiber is the set of words that differ from \(u\) at exactly the positions in \(S\): \(\mathrm{supportFiber}(u,S) = \{ v : \mathrm{support}(u,v) = S\} \).
Fix a word \(u\) of length \(n\) over a finite alphabet, and let \(S\) and \(T\) be two distinct sets of coordinate positions in \(\{ 0,\dots ,n-1\} \). Then the support fiber of \(u\) over \(S\) and the support fiber of \(u\) over \(T\) are disjoint: no word \(v\) can differ from \(u\) at exactly the positions in \(S\) while also differing from \(u\) at exactly the positions in \(T\).
Let \(\alpha \) be a finite alphabet, let \(u \in \alpha ^n\) be a word of length \(n\), and let \(r\) be a natural number. Then the Hamming sphere \(S_r(u)\) of radius \(r\) centred at \(u\) is the union, taken over all \(r\)-element subsets \(S\) of the \(n\) coordinate positions, of the support fibers of \(u\) over \(S\) — that is, the sets of words differing from \(u\) at exactly the positions in \(S\):
For a word \(u\) and position \(i\), the choices at \(i\) is the finset of symbols \(a \in \alpha \) with \(a \ne u_i\), i.e. the non-trivial alternatives for position \(i\).
Let \(\alpha \) be a finite alphabet, let \(u \colon \mathrm{Fin}\, n \to \alpha \) be a word of length \(n\) over \(\alpha \), and let \(i\) be a position. Then the set of symbols \(a \in \alpha \) with \(a \ne u_i\) has cardinality \(\left\lvert \alpha \right\rvert - 1\).
Let \(\alpha \) be a finite alphabet, and let \(u\) be a word of length \(n\) over \(\alpha \), that is, a function \(u \colon \mathrm{Fin}\, n \to \alpha \). Fix a set \(S \subseteq \mathrm{Fin}\, n\) of coordinate positions together with a further position \(i \in \mathrm{Fin}\, n\), and let \(F\) be the support fiber of \(u\) over \(\{ i\} \cup S\), namely the set of words that differ from \(u\) in exactly the positions belonging to \(\{ i\} \cup S\). Since \(i\) lies in \(\{ i\} \cup S\), every word in \(F\) carries at position \(i\) some symbol distinct from \(u_i\), and grouping the words of \(F\) by that symbol partitions \(F\): it equals the disjoint union, taken over all symbols \(a \in \alpha \) with \(a \ne u_i\), of the sets \(\{ v \in F : v_i = a\} \),
Let \(u\) be a word of length \(n\) over a finite alphabet \(\alpha \), let \(S\) be a set of coordinate positions, and let \(i\) be a position with \(i \notin S\). For every symbol \(a \in \alpha \) with \(a \ne u_i\), the words in the support fiber of \(u\) over \(\{ i\} \cup S\) — those differing from \(u\) at exactly the positions in \(\{ i\} \cup S\) — whose entry at position \(i\) equals \(a\) are exactly as many as the words in the support fiber of \(u\) over \(S\), that is, the words differing from \(u\) at exactly the positions in \(S\).
Let \(\alpha \) be a finite alphabet, fix a word \(u \colon \{ 1,\dots ,n\} \to \alpha \) of length \(n\), and let \(S \subseteq \{ 1,\dots ,n\} \) be a set of coordinate positions. Then the number of words \(v\) of length \(n\) over \(\alpha \) that differ from \(u\) at exactly the positions in \(S\) (that is, \(v_i \ne u_i\) for \(i \in S\) and \(v_i = u_i\) for \(i \notin S\)) is
Let \(\alpha \) be a finite alphabet and fix a word \(u \in \alpha ^n\) of length \(n\), where the Hamming distance \(d(x,y)\) between two words counts the coordinates in which they differ. For every radius \(k \in \mathbb {N}\), the Hamming sphere \(S_k(u) = \{ v \in \alpha ^n : d(u,v) = k\} \) of words at Hamming distance exactly \(k\) from \(u\) has cardinality
Let \(\alpha \) be a finite alphabet, and consider words of length \(n\) over \(\alpha \). For any centre word \(u \in \alpha ^n\) and any radius \(r\), the Hamming ball \(B_r(u)\) has cardinality equal to the ball volume at radius \(r\) for a length-\(n\) code over an alphabet of size \(\left\lvert \alpha \right\rvert \); that is,
For all \(n, t \in \mathbb {N}\), write \(V_q(n,t) = \sum _{i=0}^{t} \binom {n}{i}(q-1)^i\) for the ball volume at radius \(t\) of a length-\(n\) code over an alphabet of size \(q\). Over a binary alphabet, i.e. taking \(q = 2\), this reduces to the partial sum of binomial coefficients