Skip to main content
KetQat

Appearance

Equation · introductory

Hamming bound

The balls of radius t around the codewords of a t-error-correcting code are disjoint, which limits the number of codewords. Codes meeting the bound with equality are called perfect.

Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

∣C∣ ∑i=0t(ni) (q−1)i  ≤  q n,t=⌊d−12⌋\lvert C\rvert \,\sum_{i=0}^{t} \binom{n}{i}\,(q-1)^{i} \;\le\; q^{\,n}, \qquad t = \left\lfloor \tfrac{d-1}{2} \right\rfloor

The sum counts the words within Hamming distance tt of a fixed word. For a binary linear code the bound reads ∑i=0t(ni)≤2 n−k\sum_{i=0}^{t} \binom{n}{i} \le 2^{\,n-k}: there must be at least as many syndromes as errors to be told apart. It goes back to Hamming.

A code meeting the bound with equality is perfect: every word lies within distance tt of exactly one codeword. The Hamming codes are perfect with t=1t = 1, since 2 2r−1−r (1+(2r−1))=2 2r−12^{\,2^r - 1 - r}\,(1 + (2^r - 1)) = 2^{\,2^r - 1}.

Unlike its quantum analogue, the quantum Hamming bound, which in general is proved only for non-degenerate codes, this bound holds for every classical code.

Holds when

  • Any code C⊆AnC \subseteq A^n over an alphabet of size qq with minimum distance dd; linearity is not needed. For a linear [n,k,d]q[n, k, d]_q code, ∣C∣=qk\abs{C} = q^k.

Proof

Proof of the Hamming boundMachine-checked

For c∈Anc \in A^n let Bt(c)={ y∈An:d(y,c)≤t }B_t(c) = \{\, y \in A^n : d(y, c) \le t \,\}. A word at distance exactly ii from cc is obtained by choosing ii positions and, in each, one of the q−1q - 1 other symbols, so

∣Bt(c)∣  =  ∑i=0t(ni) (q−1)i.\abs{B_t(c)} \;=\; \sum_{i=0}^{t} \binom{n}{i}\,(q-1)^{i} .

Let c≠c′c \ne c' be codewords and suppose y∈Bt(c)∩Bt(c′)y \in B_t(c) \cap B_t(c'). The Hamming distance is a metric, so d(c,c′)≤d(c,y)+d(y,c′)≤2t≤d−1d(c, c') \le d(c, y) + d(y, c') \le 2t \le d - 1, contradicting the minimum distance. The balls around the ∣C∣\abs{C} codewords are therefore pairwise disjoint subsets of AnA^n, and

∣C∣⋅∑i=0t(ni) (q−1)i  ≤  q n.\abs{C} \cdot \sum_{i=0}^{t} \binom{n}{i}\,(q-1)^{i} \;\le\; q^{\,n} .

Equality holds exactly when the balls cover AnA^n.

Builds on
Related
Mentioned in

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. R. W. Hamming (1950). Error Detecting and Error Correcting Codes. Bell System Technical Journal 29 (2), 147-160. doi:10.1002/j.1538-7305.1950.tb00463.x
  2. W. Cary Huffman, Vera Pless (2003). Fundamentals of Error-Correcting Codes. Cambridge University Press. doi:10.1017/CBO9780511807077

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass with notes · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Bound, ball-volume count and perfect-code definition compared with Guruswami-Rudra-Sudan, Essential Coding Theory (open draft), Thms 1.6.2, 1.7.2, Def. 1.7.3; perfectness of Hamming codes recomputed by enumeration for r = 2, 3, 4; remark on the quantum bound compared with Gottesman, arXiv quant-ph/9604038 (Sec. I and Appendix A); hamming-1950 metadata compared with Crossref.

    The record said the quantum Hamming bound is proved only for non-degenerate codes; Gottesman (quant-ph/9604038, Appendix A) proves it for a class of degenerate one-error-correcting codes. Changed to 'in general is proved only for non-degenerate codes'.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 76732af955fe6a2b. Source file knowledge/records/equation/hamming-bound.md in the content repository (readable there once it is public).