Let $\mathbb {F}_{q}$ be the finite field of $q$ elements. In this paper we obtain bounds on the following counting problem: given a polynomial $f(x)\in \mathbb {F}_{q} [x]$ of degree $k+m$ and a non-negative integer $r$ , count the number of polynomials $g(x)\in \mathbb {F}_{q} [x]$ of degree at most $k-1$ such that $f(x)+g(x)$ has exactly $r$ roots in $\mathbb {F}_{q}$ . Previously, explicit formulas were known only for the cases $m=0, 1, 2$ . As an application, we obtain an asymptotic formula on the list size of the standard Reed-Solomon code $[q, k, q-k+1]_{q}$ .
We use the generating function approach to derive simple expressions for the factorial moments of the distance distribution over Reed-Solomon codes. We obtain better upper bounds for the error term of a counting formula given by Li and Wan, which gives nontrivial estimates on the number of polynomials over finite fields with prescribed leading coefficients and a given number of linear factors. This improvement leads to new results on the classification of deep holes of Reed-Solomon codes.