Number of block codes of length n on r-ary alphabet

74 Views Asked by At

I need help in finding the number of block codes of length $n$ on an $r$-ary alphabet for an exam.

I though that the number would be $r^n$ since there are $n$ positions per code, each with $r$ options. But this is not correct, I am thinking that I need to take into account the different orders of the codewords, such that the number is a permutation, $ \frac{n!}{(n-r)!}$.

But I think this would be the number of different codewords of a block code. I am a little confused on this. Any help is appreciated.

Thank you.

1

There are 1 best solutions below

0
On

This is a very badly worded question since even if you assume it is asking about the total number of possible codes, which is (since a code must be nonempty we omit the empty subset of $\{0,1,\ldots,r-1\}^n$) is given by $$ 2^{r^n}-1 $$ a huge number of those "distinct" codes are equivalent. Anyway, hope this helps.