I am trying to answer the following short question:
Consider a code $C$ of length 9 over an alphabet of size 6 with minimum distance 5. What is the upper bound of the number of codewords in $C$? Is it possible for $C$ to be perfect?
I am familiar with the 'sphere-packing' bound, so that
$$M \leq \frac{q^n}{{n \choose 0} + {n \choose 1}(q - 1) + \ldots {n \choose t}(q-1)^t}$$
Using the data I have been given, I compute the denominator as 946, by taking $d = 5 = 2t + 1 \rightarrow t = 2$. I then get that the numerator is $6^9 = 10,077,696$. The resulting number is not an integer. Is this evidence that the code cannot achieve this bound, or is there something that I am missing?
Many thanks
To find the upper bound on $|C|$ just apply the floor function to the right hand side, since we know the cardinality has to be an integer.
For $C$ to be perfect, this upper bound must be achieved exactly, i.e., the RHS should have been an integer, so that there are no 'leftover points' outside spheres of radius $t$ centred on codewords.