IGCSE · Practice questions · Lossy and lossless compression

Squeeze the data.

Six original Cambridge-style questions on lossy and lossless compression, with worked solutions.

Original questions All questions on this page are original work, written in the Cambridge IGCSE style. They are not from past papers. They test the same concepts and skills the syllabus rewards.
Keep these straight

Lost or kept.

01
Explain
[2 marks]

Give two reasons why files are compressed before they are sent over the internet.

  • Less bandwidth is needed. ✓
  • The transmission time is shorter (also accept: less storage space is needed). ✓
02
Explain
[2 marks]

Describe the difference between lossy and lossless compression.

  • Lossy compression permanently removes data, so the original file cannot be recovered. ✓
  • Lossless compression reduces the file size without permanent loss of data, so the original can be rebuilt exactly. ✓
03
Apply
[2 marks]

Use run length encoding to compress the text PPPPPQQRRRRRRR.

  • Runs: 5 P, 2 Q, 7 R. ✓
  • 5P 2Q 7R. ✓
04
Calculate
[2 marks]

The text PPPPPQQRRRRRRR is stored using 1 byte per character. In the RLE version each count and each character uses 1 byte. Calculate the number of bytes saved.

  • Original 14 bytes; RLE 3 pairs = 6 bytes. ✓
  • 14 − 6 = 8 bytes saved. ✓
05
Apply
[3 marks]

A school uploads photos to its website and also sends spreadsheets of exam marks. State which type of compression should be used for each and justify your answers.

  • Photos: lossy, because the file is much smaller so the page loads faster. ✓
  • The data lost from a photo is unlikely to be noticed. ✓
  • Spreadsheets: lossless, because every value must be kept exactly; losing data would change the marks. ✓
06
Analysis
[2 marks]

A student says "run length encoding always makes a file smaller." Explain, with an example, why this is not true.

  • RLE only saves space when there are runs of repeated values. ✓
  • e.g. ABCD becomes 1A 1B 1C 1D, which is 8 values instead of 4, so the file is larger. ✓

Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.