In the terminology used here, a block code assigns a distinct word of the same length to every source symbol. For a binary code with symbols this common length must satisfy . The equal-length property is what matters in this question; elsewhere the term can also refer more generally to coding blocks of source symbols.
A prefix code has no codeword that is a proper prefix of another. Its code tree therefore places source symbols at leaves. It is instantaneous because the decoder knows that a source symbol has ended as soon as its leaf is reached, without needing to inspect later transmitted symbols.
A compact code or optimal prefix code minimizes the expected codeword length for the given source probabilities and coding alphabet. The relevant comparison here is among binary prefix codes. The minimum is also the minimum among uniquely decodable codes, since the Kraft-McMillan inequality permits every uniquely decodable length list to be realized by a prefix code with the same lengths.
Every internal node of an optimal binary prefix tree has two children. If one had only one child, remove that one-edge detour from all descendant words. Prefix-freeness is preserved and at least one positive-probability word becomes shorter, strictly lowering the expected length. Thus the tree is full.
Take a leaf at maximum depth . Its sibling exists because the tree is full. That sibling cannot be an internal node, since a descendant would be deeper than . Hence it is another leaf at depth , and the corresponding codewords differ only in their final bit. This is the deepest sibling property of an optimal prefix code.
A finite full binary tree satisfies Kraft equality, , by dividing mass equally down each branch from the root. If all lengths were at least , with at least one strictly greater, that sum would be less than , a contradiction. Since the code is not a block code, the alternative that all lengths equal is excluded. Therefore some word has length below . Also a longest word must have length above : if all lengths were at most and some shorter, the Kraft sum would exceed one.
Suppose every sum of two distinct probabilities exceeds every third probability. If an optimal code were not a block code, part (b) gives two deepest sibling leaves at depth and a leaf at depth . Replace the sibling pair by a leaf labelled , and replace the former leaf by two children labelled . The resulting tree is still a prefix tree, and other word lengths are unchanged. The change in expected length is
Here . This contradicts optimality. Thus every optimal code is a block code.
Conversely, suppose distinct satisfy . Starting with the complete length- code, arrange as a sibling pair, which is possible by permuting the source labels. Its parent at depth does not contain . Label that parent , and split the old leaf into children . This gives lengths for , for , and otherwise, with expected length
If the optimal mean length is below , no optimal code can be a block code: any injective binary block code for symbols has length at least . If the optimal mean is , the constructed non-block code itself is optimal. In either case there is an optimal non-block code. This proves the reverse implication, including the equality case, and hence the strict inequality in the criterion is necessary.

Articles by others on the same topic (0)

There are currently no matching articles.