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:

Articles by others on the same topic (0)

There are currently no matching articles.