How does an alphabet size relate to the Kraft-McMillan Inequality?

317 Views Asked by At

I'm trying to figure out how the alphabet size m relates to the McMillan Inequality.

I'm using Norman L Bigg's equation which is $\sum_{i=1}^M \frac{ni}{b^i}$$=\frac{n_1}{b^1}, \frac{n_2}{b^2}, . . . , \frac{n_M}{b^M}$

With this, I'm trying to answer this question: Let us say that a code is complete if it is PF and K = 1. Show that if there is a complete b-ary code for an alphabet of size m, then b - 1 must divide m - 1.

I have an answer but I don't think it's right due to the alphabet size. To note M is just an integer while m is the alphabet size.

My method was to do $ni=m$ therefore $. . .+\frac{m-1}{(b-1)^{m-1}}+\frac{m}{(b-1)^m} = 1$ Using the end part of the equation.

After rearranging I get, $b(m-1)+1=(b-1)^m$ and by taking out a factor of $b-1$ on the right hand side I can get $m-1=(b-1)*[\frac{(b-1)^{m-1}}{b}-\frac{1}{b(b-1)}]$

I'm trying to figure if my method is correct, thanks.

1

There are 1 best solutions below

3
On

That should be

$$K=\sum_{i=1}^M\frac{n_i}{b^i}=\frac{n_1}b+\frac{n_2}{b^2}+\ldots+\frac{n_M}{b^M}\;,$$

where $b$ is the size of the output alphabet, and $n_i$ is the number of code words of length $i$ for $i=1,\ldots,M$. (Thus, we might as well assume that $M$ is the maximum length of a code word.) It appears that $m$ is the size of the input alphabet, so $m=\sum_{i=1}^Mn_i$. Thus, you’re trying to show that if $K=1$, $b-1$ divides $m-1=n_1+\ldots+n_M-1$.

If $$\sum_{i=1}^M\frac{n_i}{b^i}=1\;,$$ then we can multiply through by $b^M$ to get $$\sum_{i=1}^Mb^{M-i}n_i=b^M\;,$$

or if you prefer,

$$b^{M-1}n_1+b^{M-2}n_2+\ldots+bn_{M-1}+n_M=b^M\;.$$

Thus,

$$b^{M-1}n_1+b^{M-2}n_2+\ldots+bn_{M-1}+n_M\equiv b^M\!\!\!\pmod{b-1}\;.\tag{1}$$

Now use the fact that $b\equiv1\pmod{b-1}$, so that $b^k\equiv1\pmod{b-1}$ for $k\ge 0$, and eliminate all instances of $b$ from $(1)$ to get the desired result.