Hamming balls, the Hamming bound and the Gilbert–Varshamov bound #
The words ∀ i, β i at Hamming distance exactly r from a word x are obtained by choosing the
r positions where they differ and a different letter at each, so there are
∑_{|S| = r} ∏_{i ∈ S} (|β i| - 1) of them, whatever x is
(Cslib.Code.card_filter_hammingDist_eq); over an alphabet of q letters at each of n positions
this is C(n, r) (q - 1) ^ r (Cslib.Code.card_filter_hammingDist_eq_choose_mul_pow). Balls of
radius r around the words of a code of minimum distance Cslib.Code.minDist more than 2 r are
disjoint, so the code has at most q ^ n / V words, where V is the size of a ball: the
Hamming bound (Cslib.Code.card_mul_card_filter_hammingDist_le_le_prod,
Cslib.Code.card_mul_sum_choose_le_of_two_mul_lt_minDist) [Hamming1950],
[MacWilliams and Sloane, Chapter 1, Theorem 6][MacWilliamsSloane1977]. Conversely, the balls of
radius d - 1 around a largest code of minimum distance at least d cover every word, so some
code of minimum distance at least d has at least q ^ n / V words, where V is the size of a
ball of radius d - 1: the Gilbert–Varshamov bound
(Cslib.Code.exists_le_minDist_and_prod_le_card_mul_card_filter_hammingDist_lt,
Cslib.Code.exists_le_minDist_and_pow_le_card_mul_sum_choose) [Gilbert1952], by Gilbert's greedy
argument; Varshamov proved the same bound for linear codes [Varshamov1957]. The same greedy argument
covers any finite set of words by the balls of radius r around a subset whose words are pairwise
more than r apart (Cslib.Code.exists_subset_pairwise_lt_hammingDist_forall_exists_le). Over
16 letters the
balls of radius less than ⌈L / 2⌉ have at most 8 ^ L words, so some code of length L has
2 ^ L words any two of which differ in at least half of the positions
(Cslib.Code.exists_two_pow_le_card_and_le_two_mul_hammingDist).
Main results #
Cslib.Code.card_filter_hammingDist_eq: the size of a Hamming sphere.Cslib.Code.card_filter_hammingDist_le_eq_sum: the size of a Hamming ball, as a sum of sphere sizes.Cslib.Code.card_filter_hammingDist_le_le_pow: a Hamming ball of radiusroverqletters atnpositions has at most(n (q - 1) + 1) ^ rwords.Cslib.Code.card_mul_card_filter_hammingDist_le_le_prod: the Hamming bound.Cslib.Code.card_mul_sum_choose_le_of_two_mul_lt_minDist: the Hamming bound over aq-letter alphabet.Cslib.Code.exists_subset_pairwise_lt_hammingDist_forall_exists_le: a finite set of words is covered by the balls of radiusraround a subset of words pairwise more thanrapart.Cslib.Code.exists_le_minDist_and_prod_le_card_mul_card_filter_hammingDist_lt: the Gilbert–Varshamov bound.Cslib.Code.exists_le_minDist_and_pow_le_card_mul_sum_choose: the Gilbert–Varshamov bound over aq-letter alphabet.Cslib.Code.exists_two_pow_le_card_and_le_two_mul_hammingDist:2 ^ Lwords of lengthLover16letters, any two differing in at least half of the positions.
References #
- [R. W. Hamming, Error detecting and error correcting codes][Hamming1950]
- [E. N. Gilbert, A comparison of signalling alphabets][Gilbert1952]
- [R. R. Varshamov, Estimate of the number of signals in error correcting codes][Varshamov1957]
- [F. J. MacWilliams, N. J. A. Sloane, The Theory of Error-Correcting Codes] [MacWilliamsSloane1977]
The words differing from x exactly at the positions S: a different letter at each position
of S.
The size of a Hamming sphere: the words at distance r from x. It does not depend on
x.
Over an alphabet of q letters at each of n positions, a Hamming sphere of radius r has
C(n, r) (q - 1) ^ r words.
The size of a Hamming ball is the sum of the sizes of the spheres.
Over an alphabet of q letters at each of n positions, a Hamming ball of radius r has at
most (n (q - 1) + 1) ^ r words: by the binomial theorem this dominates
∑_{j ≤ r} C(n, j) (q - 1) ^ j.
The Hamming bound: a code of minimum distance more than 2 r has at most ∏ i, |β i|
words in all of its balls of radius r together.
The Hamming bound [Hamming1950] over a q-letter alphabet at each of n positions: a code
of minimum distance more than 2 r has at most q ^ n / V words, where
V = ∑_{j ≤ r} C(n, j) (q - 1) ^ j is the size of a ball of radius r.
Covering by a maximal separated subset: every finite set L of words contains a subset
C of words pairwise more than r apart such that every word of L lies within distance r of
a word of C. A largest such subset works: a word of L farther than r from all of it could
be added to it.
The Gilbert–Varshamov bound [Gilbert1952]: for d ≥ 1 there is a code of minimum distance
at least d which has at least ∏ i, |β i| / V words, where V is the size of a ball of radius
d - 1. A largest such code works: its balls of radius d - 1 cover every word, since a word at
distance at least d from every codeword could be added to it.
The Gilbert–Varshamov bound [Gilbert1952] over a q-letter alphabet at each of n
positions: for d ≥ 1 some code of minimum distance at least d has at least q ^ n / V words,
where V = ∑_{j < d} C(n, j) (q - 1) ^ j is the size of a ball of radius d - 1.
A code of rate 1 / 4 and relative distance 1 / 2: some code of length L over 16
letters has at least 2 ^ L words, any two of which differ in at least half of the positions. By
the Gilbert–Varshamov bound, since the balls of radius less than ⌈L / 2⌉ have at most 8 ^ L
words.