Given positive integers $n$ and $d \le n$, what is the maximum possible number $M(n, d)$ of binary $n$-vectors such that the Hamming distance between each pair of those vectors is exactly $d$? For instance, if $n = 3$ and $d = 2$, the answer is $M = 4$ (the vectors are, e.g., $000$, $011$, $101$, and $110$).
Some rules can be easily derived. For example:
- $M(n, d) = 2$ if $d$ is odd.
- $M(n, d) = 2$ if $d > 2n/3$ (e.g., for $n = 8$ and $d = 6$, we can pick $00000000$ and $00111111$, but now we are stuck; however, if $n = 9$ and $d = 6$, we can produce four vectors).
- $M(n, 2) = n$ if $n \neq 3$; the vectors are just the $n$ neighbors of some vertex of the $n$-hypercube. However, $M(3, 2) = 4$.
I also suspect that $M(4k-1, 2k) = 4k$ (e.g., $M(3, 2) = 4$, $M(7, 4) = 8$, etc.), since in this case the vectors can be derived from the $(4k)$-Hadamard matrix by deleting the first column and turning the elements $-1$ into zeros. However, the Hadamard matrix is just one way of generating such vectors, and it tells us nothing about other $(n, d)$ pairs.
Any help will be greatly appreciated!