Lecture 1: Prefix Codes Flashcards
What is meant by a uniquely decodable code?
if C+(x) != C+(y) where x != y. Essentially, if two input strings (x and y) were to encode to the same codeword,
you can’t tell whether it was x or y as the input.
What is a instantaneously decodable code? How do we generate them?
When it is possible to instantly decode a codeword as soon as we receive it, without having to look ahead for future codewords. Generate them using prefix codes.
Can a code be uniquely decodable without being a prefix (instantaneous) code?
Yes, say C = {1, 101}. Although 1 is a prefix of 101, only 101 contains a 0, so can distinguish the codewords with that.
When using a prefix code as a binary tree, what can you not do?
Once a node on the tree is selected as a codeword, no further child nodes can be also be selected.
What is an optimal code?
Using all possible codewords for a prefix code (using all the budget of a budget grid).
Explain the Kraft Equality
For lossless compression, codewords cannot be arbitaraliy short, shortening one must cause another to lengthen. A code is ‘complete’ if the equality holds (=1).
(Sum of 2^-len(k) for all codewords <= 1).
How does the Kraft Equality apply to budgets/binary tree?
All node endings are used, all the budget is used. Complete code.
Discuss the entropy bound on data compression.
The code produced must be greater or equal length to the Shannon entropy! (Limit of data compression)