Let $C$ be a ternary (not necessarily linear) code of block length $8$ that can correct all single errors. Show that $C$ cannot contain more than $385$ code words.
How do you solve this and how does it differ from a binary version? I can answer the same question say for block length $8$ in a binary code. Show C has at most $28$ code words:
DERIVATION
C can correct all single errors therefore d(E)>=3. The vector space of dimension 8 over Z_2 has (2^8) elements.
If U an element of Z_2 is a code word of E another element is v an element of Z_2 is a code word iff d(u,v) >= d(E)
Let Su:= { W e Z_2 | d(u,v) <= [d(E)/2]}
Where u = code word. Su only contains one code word = u.
The number of code words in E (2^8)/|Su| reaches a max when |Su| is min. This happens when d(E) =min therefore d(E) =3
Count the number of w in Z_2 such that d(u,w) <=(3/2)
d(u,w)=0, w=u
d(u,w)=1
Therefore there are 8 options for word w such that d(u,w) =1 and Su has 9 elements.
Hence,
$$\dfrac{2^8}{9} = 28$$
How do I solve the analogous problem for a ternary code?
Hints:
How many different ternary strings with $8$ characters are there?
Given a particular string, how many strings are either exactly that string or differ from it in one place?