$n,k$ are integers and I need to find the maximal integer $M$ such that there exist $M$ different n-dimensional vectors whose components are in $\{-1,1\}$ satisfying: any two of $M$ vectors has exactly $k$ different components.
For example if $n=4$, $k=1$ $M$ will be $2$ because we can assume $X_1=(1,1,1,1)$ then $X_2$ has one component $-1$, others are $1$,for example $X_2=(-1,1,1,1)$. However, different $X_3$ can not be found because any new $X_3$ should also has only one $-1$ component but different from $X_2$, which will make $X_2,X_3$ have $2$ different components.
I tried but find it difficult to find the formula, A good upper boundary will also be helpful as I think at least induction can be used.