1
$\begingroup$

Given an alphabet of $n$ symbolswith probabilities $p_i$ for symbol $i$, we need to encode the symbols (in a prefix-free way) to binary codewords $c(i)$ with length $\ell(c(i))$ to minimize the expression $$a(1-a)L,$$ where $$L=n^{-1}\sum_{i=1}^n \ell(c(i))$$ is the average codeword length per symbol, and $a$ is the relative frequency of $1$s in all codewords, i.e., $$ a=\frac{\sum_{i=1}^n H(c(i))}{\sum_{i=1}^n \ell(c(i))} $$

Apparently Huffman code is not optimal in this particular context. Is there a way to find the optimal code?

$\endgroup$
3
  • $\begingroup$ a is surely not the percentage of 1s but the relative frequency of 1s. also, what does "a large number of coded symbols" mean? why not all codewords? or is there another parameter? so please make your question mathematically precise. $\endgroup$
    – kodlu
    Commented Dec 1, 2020 at 20:06
  • $\begingroup$ Thank you. Corrected. $\endgroup$
    – lchen
    Commented Dec 2, 2020 at 9:27
  • $\begingroup$ you were still not precise. have a look at my edit, and fix if necessary. $\endgroup$
    – kodlu
    Commented Dec 2, 2020 at 9:44

0

You must log in to answer this question.