For a strictly positive probability distribution on source symbols, with , every optimal binary prefix code has common length if and only if for every three distinct symbols. It suffices to compare the sum of the two smallest probabilities with the largest.
An optimal binary prefix tree has no node with only one child, because removing that detour would strictly shorten positive-probability words. It therefore satisfies equality in the Kraft inequality. If it is not a fixed-length tree, it has a deepest sibling pair at depth and a short leaf at depth . Exchanging that pair with the short leaf changes the expected codeword length by . Strict positivity of every pair sum over a third probability makes this change negative, contradicting optimality.
Conversely, if , begin with the complete depth- tree, place at sibling leaves, replace their parent by , and replace the previous leaf by children . The new expected length is and its lengths are unequal. If the optimum is below , every optimal tree is nonuniform; if it is , this modified tree is a nonuniform optimum. Thus equality in the probability condition already defeats the assertion that every optimum has fixed length.
Articles by others on the same topic
There are currently no matching articles.