Information Theory and Coding Basics

Which of the following data is most likely to be made smallest by run-length encoding?

  1. AA drawing of black lines on a white background, represented as a two-level black-and-white image
  2. BAn image such as a photograph, in which the values of neighboring pixels change finely
  3. 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.
Practice this topic Back to topic

Books on Information Theory and Coding Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Information Theory and Coding Basics questions

  1. Which of the following correctly describes the idea of the LZ77 method used in ZIP, gzip and similar tools?
  2. Data compressed with the LZ77 method are to be restored. The data consist of "character A", "character B" and "(distance 2, length 5)", in that order. (distance d, length L) means repeating L times, one character at a time, "copy the character d characters back from the end of the restored string to its end". Which of the following is the restored string?
  3. When compressing data, which of the following must use lossless compression rather than lossy compression?
  4. A single even parity bit is added to a bit string of data so that the number of 1s is even, and the receiver checks the number of 1s. Which of the following correctly describes this check?
  5. Four rows of 4-bit data were sent with an even parity bit for each row at its right end and a final row of even parity bits for each column (vertical and horizontal parity). The received bits were row 1: 1011 1, row 2: 0100 0, row 3: 1100 0, row 4: 0101 0 and parity row: 0100 (the rightmost bit of each row is its row parity). If exactly one bit is wrong, which of the following is its position?