My problem:
Let $q\geq 2, n\geq 2$ be integers. Show that $A_{q}\left(n,2\right)=q^{n-1}$, where $A_{q}\left(n,2\right)$ denotes the largest possible size $M$ for which there exists an $\left(n,M,d\right)$-code over $A$.
My work so far:
Let $C=A^{n}$ be the set of all code words of length $n$. Then, because we have a minimum distance of $2$, for any distinct $c_{i} \in C$, we know that they will differ in at least two positions. Thus, a $q$-ary code of length $n$ will not be bigger than this, and so we conclude that $A_{q}\left(n, 2\right)=q^{n-1}$.
Is this proof valid? How can I improve my result? As always, thanks for the help!
The bound is incorrect (it may be a LaTeX error). The Singleton bound immediately gives $A_q(n,2)\le q^{n-1}$, a bound attained by the linear code attaching a check digit to each input word of length $n-1$. Hence $A_q(n,2)=q^{n-1}$.