The codeword lengths are integers. For necessity, take and view codewords as nodes of the binary tree. A codeword of length has descendant words at depth . Prefix-freeness makes these descendant sets disjoint, so
For sufficiency, reorder the lengths nondecreasingly. Assign words successively. At depth , words extending previously assigned codewords number
The asserted inequality, even after dropping the later nonnegative terms, gives
Thus at least one depth- word does not extend an earlier word. Choose it. Since lengths are nondecreasing, it cannot be a proper prefix of a shorter earlier word, and equal-length duplicates have been excluded. Induction constructs the required code. Therefore Kraft inequality is necessary and sufficient:
First consider any instantaneous code. Put and . Part 1(a) gives
so .
For the construction, take the Shannon lengths . Then , so Kraft's condition holds. Also for every . Averaging gives
For a nontrivial alphabet all , so these lengths are positive and the ordinary code convention applies. For a deterministic one-symbol source, the usual zero-bit convention uses when the number of source symbols is externally known. If strictly nonempty codewords and arbitrary unframed message lengths are required instead, that degenerate case has and cannot satisfy the printed strict upper bound. This convention issue does not affect sources with at least two symbols.

Articles by others on the same topic (0)

There are currently no matching articles.