# Number of binary words that form a group of Hamming weight at most d

Consider binary words in {0,1}^n whose Hamming weight is at most some constant d. We want to select some of these words such that they form a group under addition. How many words can we choose at most?

Your structure is known as a group anticode with maximal distance $$d$$. The obvious construction is to take all vectors of the form $$(x_1,\ldots,x_d,0,\ldots,0)$$, obtaining a group of size $$2^d$$. Ahlswede, Another diametric theorem in Hamming spaces: optimal group anticodes showed that this is optimal, and furthermore, the solution I described is unique up to isomorphism, except when $$d = 2$$, in which case another solution is $$(0,0,0,\bar{0}),(1,1,0,\bar{0}),(1,0,1,\bar{0}),(0,1,1,\bar{0})$$.