Data Representation · 4 question types
Past paper frequency (2018 to 2024)
This topic accounts for approximately 4% of your exam marks.
File size calculations and lossless vs lossy compression are regular 3 to 4 mark questions.
RLE is a simple lossless method that works well on data containing long runs of the same value repeating in a row.
The decoder reverses this by expanding each pair back into count copies of value.
RLE is only effective if the data has long runs:
In the worst case, RLE can actually increase the file size: if every value is different from the next, each value becomes a 1-value run, so the output is roughly twice the original size.
The decoded data is bit-identical to the original. RLE counts as lossless because expanding each (count, value) pair back to count copies of value perfectly restores the input.