The cardinality of a Hamming ball is the total number of elements that are any distance up to and including its radius.

The number of vectors in Hamming ball Br(x) is

(n0)+(n1)+(n2)++(nr)

Proof

Recall the definition for Br(x):

Br(x)={yZ2n:dH(x,y)r}

N.b. dH(x,y) on a binary code in the Hamming space Z2n can only be an integer 0dH(x,y)n.

By Hamming distance for binary codes can be calculated using the binomial coefficient.,
(n0) is the number of elements of Z2n that are distance 0 from n
(n1) is the number of elements of Z2n that are distance 1 from n

(nt) is the number of elements of Z2n that are distance t from n

QED

Powered by Forestry.md