Information Theory and Coding Basics
Which of the following correctly describes a variable-length code compared with a fixed-length code?
- AIt assigns codewords of the same length to every symbol, so there is no need to look for boundaries when decoding
- BIt assigns shorter codewords to less probable symbols to shorten the average code length
- CIt assigns shorter codewords to more probable symbols to shorten the average code length
Show answer and explanation
Answer: C. It assigns shorter codewords to more probable symbols to shorten the average code length
A variable-length code assigns short codewords to frequent symbols and long ones to rare symbols, shortening the average number of bits per symbol (the average code length). Morse code representing E, the most common letter in English, with a single dot follows the same idea. In exchange, the codewords are not all the same length, so the code is built to satisfy a condition such as being a prefix code, so that the boundaries can be determined in only one way.
- A. This describes a fixed-length code. A fixed-length code has fixed boundaries, but it cannot exploit skewed symbol probabilities.
- B. It is the other way round. Making rare symbols short and frequent symbols long actually lengthens the average code length.
- C. Correct. It exploits skewed probabilities to shorten the average code length.
Continue: 9 more Information Theory and Coding Basics questions