TCSLib

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

Definition 79.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 79.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 79.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 79.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 79.5 Disjointness of Hamming spheres of distinct radii
✓

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.

Lemma 79.6 Pairwise disjointness of Hamming spheres
✓

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.

Lemma 79.7 Hamming ball as the disjoint union of spheres
✓

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

\[ B_r(u) = \bigsqcup _{k=0}^{r} S_k(u). \]
Definition 79.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 79.9 Hamming distance as the size of the support
✓

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:

\[ d(u,v) = \left\lvert \{ i \in \mathrm{Fin}\, n : u_i \ne v_i\} \right\rvert . \]
Definition 79.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 79.11 Disjointness of support fibers over distinct sets
✓

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

Lemma 79.12 Hamming sphere as a union of support fibers
✓

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

\[ S_r(u) = \bigcup _{\substack {S \subseteq \{ 1,\dots ,n\} \\ \left\lvert S\right\rvert = r}} \{ \, v \in \alpha ^n : v \text{ and } u \text{ differ in exactly the positions of } S \, \} . \]
Definition 79.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 79.14 Number of alternative symbols at a position
✓

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

Lemma 79.15 Partitioning a support fiber by the symbol at one coordinate
✓

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

\[ F = \bigsqcup _{\substack {a \in \alpha \\ a \ne u_i}} \{ \, v \in F : v_i = a \, \} . \]
Lemma 79.16 Support fibers split into equal-cardinality slices
✓

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

Lemma 79.17 Cardinality of a support fiber
✓

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

\[ (\left\lvert \alpha \right\rvert - 1)^{\left\lvert S\right\rvert }. \]
Lemma 79.18 Cardinality of a Hamming sphere
✓

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

\[ \left\lvert S_k(u)\right\rvert = \binom {n}{k}\, (\left\lvert \alpha \right\rvert -1)^k. \]
Lemma 79.19 Hamming ball 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,

\[ \left\lvert B_r(u)\right\rvert = \sum _{i=0}^{r} \binom {n}{i}\, (\left\lvert \alpha \right\rvert - 1)^i. \]
Lemma 79.20 Binary ball volume
✓
#

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

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