What is the maximum number vectors of Hamming weight at most $w$ in a $d$-dimensional subspace of $\mathbb{F}_p^n$, where $w,d,p$ are constant and $p$ is odd. (The Hamming weight is the number of nonzero coordinates.) In particular, does an upper bound of the form $d^{Cw}$ hold for some constant $C$ depending only on $p$?
1 Answer
Answer. It is $\sum_{k=0}^w (p-1)^k{d\choose k}$ (for a coordinate subspace, the equality holds).
Proof. Denote by $N(f)$, for $f=(x_1,\ldots,x_n)\in \mathbb{F}_p^n\setminus 0$, the minimal $i$ for which $x_i\ne 0$. By Gauss elimination we may find a basis $f_1,\ldots,f_d$ in our $d$-dimensional space such that $N(f_1)<N(f_2)<\ldots<N(f_d)$. Note that any linear combination of more than $w$ $f_i$'s (with non-zero coefficients) has more than $w$ non-zero coordinates. Thus all vectors with Hamming weight at most $w$ are linear combinations of at most $w$ $f_i$'s, so the bound.