Information Theory and Coding Basics
Which of the following data is most likely to be made smallest by run-length encoding?
- AA drawing of black lines on a white background, represented as a two-level black-and-white image
- BAn image such as a photograph, in which the values of neighboring pixels change finely
- CData after encryption, in which 0s and 1s appear to be arranged at random
Show answer and explanation
Answer: A. A drawing of black lines on a white background, represented as a two-level black-and-white image
Run-length encoding represents the length of a run of the same value as a number, so data in which the same value continues for a long time shrink the most. In a two-level drawing with a mostly white background, white pixels continue for long stretches, so the effect is large; fax coding also uses this idea. In data whose values change finely, the runs are short and the result can even be larger than the original.
- A. Correct. White and black pixels continue for long stretches, so there are few runs.
- B. Pixels often differ from their neighbors, so the runs are short and the data hardly shrink, or even grow.
- C. Data that look random contain almost no long runs of the same value and hardly shrink with any lossless compression.
Continue: 9 more Information Theory and Coding Basics questions