teach-ict.com logo

THE education site for computer science and ICT

Answer: Question 5


Answer:

For this image

5a. We have decided to used ‘W’ for the white and ‘R’ for the red, although any other pair of characters would do as well – you just need to define it beforehand so it can be de-compressed.

The RLE is

6W
6W
3W3R
6R
6R

5b. Overall, the uncompressed representation uses 30 bytes. Run length encoding reduces this to (2+2+4+2+2 = 12)
The compression ratio = 30/12 = 2.5