TCSLib

82 Communication Complexity — Hamming

82.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\).

82.2 Declarations

Definition 82.1 Word
#

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.

Definition 82.2 Hamming ball
#

The Hamming ball of radius \(r\) centred at \(u \in \alpha ^n\) is the finset

\[ B_r(u) = \{ v \in \alpha ^n : \mathrm{hammingDist}(u,v) \le r\} . \]
Definition 82.3 Hamming sphere
#

The Hamming sphere of radius \(r\) centred at \(u \in \alpha ^n\) is the finset

\[ S_r(u) = \{ v \in \alpha ^n : \mathrm{hammingDist}(u,v) = r\} . \]
Definition 82.4 Ball volume
#

For a length-\(n\) code over an alphabet of size \(q\), the ball volume at radius \(t\) is

\[ \mathrm{ballVol}(n,t,q) = \sum _{i=0}^{t} \binom {n}{i}(q-1)^i \in \mathbb {N}. \]
Lemma 82.5 Spheres of different radii are disjoint

For any centre \(u\) and distinct radii \(r \ne t\), the Hamming spheres \(S_r(u)\) and \(S_t(u)\) are disjoint finsets.

Lemma 82.6 Spheres are pairwise disjoint

For any centre \(u\) and bound \(r\), the family \(\{ S_t(u)\} _{t \lt r}\) is pairwise disjoint as a family of finsets indexed by \(\{ 0,\ldots ,r-1\} \).

Lemma 82.7 Ball equals disjoint union of spheres

The Hamming ball of radius \(r\) decomposes as the disjoint union

\[ B_r(u) = \bigsqcup _{k=0}^{r} S_k(u). \]
Definition 82.8 Support of a pair of words
#

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\} \).

Lemma 82.9 Support card equals Hamming distance

For any two words \(u,v\), the Hamming distance equals the cardinality of their support: \(\mathrm{hammingDist}(u,v) = |\mathrm{support}(u,v)|\).

Definition 82.10 Support fiber

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\} \).

Lemma 82.11 Support fibers over distinct sets are disjoint

If \(S \ne T\) are distinct finsets of coordinate positions, then \(\mathrm{supportFiber}(u,S)\) and \(\mathrm{supportFiber}(u,T)\) are disjoint finsets.

Lemma 82.12 Sphere as union of support fibers

The Hamming sphere of radius \(r\) centred at \(u\) equals the union of support fibers over all size-\(r\) subsets of \(\mathrm{Fin}\, n\):

\[ S_r(u) = \bigcup _{S \in \binom {[n]}{r}} \mathrm{supportFiber}(u,S). \]
Definition 82.13 Alternative symbol choices
#

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\).

Lemma 82.14 Choices cardinality

For any word \(u\) and position \(i\), the number of alternative symbols at \(i\) is \(|\mathrm{choices}(u,i)| = |\alpha | - 1\).

Lemma 82.15 Choices partition a support fiber

For a word \(u\), a set \(S\) of positions, and a position \(i\), the support fiber over \(\{ i\} \cup S\) is partitioned by the value chosen at position \(i\):

\[ \mathrm{supportFiber}(u, \{ i\} \cup S) = \bigsqcup _{a \in \mathrm{choices}(u,i)} \{ v \in \mathrm{supportFiber}(u,\{ i\} \cup S) : v_i = a\} . \]
Lemma 82.16 Each piece has the same cardinality

For \(i \notin S\) and any alternative symbol \(a \in \mathrm{choices}(u,i)\), the slice \(\{ v \in \mathrm{supportFiber}(u,\{ i\} \cup S) : v_i = a\} \) has the same cardinality as \(\mathrm{supportFiber}(u,S)\).

Lemma 82.17 Support fiber cardinality

For any word \(u\) and finset \(S \subseteq \mathrm{Fin}\, n\),

\[ |\mathrm{supportFiber}(u,S)| = (|\alpha | - 1)^{|S|}. \]
Lemma 82.18 Hamming sphere cardinality

For any centre \(u \in \alpha ^n\) and radius \(k\),

\[ |S_k(u)| = \binom {n}{k}(|\alpha |-1)^k. \]
Lemma 82.19 Hamming ball cardinality

For any centre \(u \in \alpha ^n\) and radius \(r\),

\[ |B_r(u)| = \mathrm{ballVol}(n,r,|\alpha |) = \sum _{i=0}^{r}\binom {n}{i}(|\alpha |-1)^i. \]
Lemma 82.20 Binary ball volume
#

In the binary case \(q = 2\), the ball volume simplifies to

\[ \mathrm{ballVol}(n,t,2) = \sum _{i=0}^{t}\binom {n}{i}. \]