Level:
Correct: 0
Incorrect: 0
Marks: 0/0
Exam Practice
Subject:
Topics:
Cambridge IGCSE Computer Science (Paper 1) Smart practice A mixed round aimed at your weak spots
Unit 1
Data representation
Unit 2
Data transmission
Unit 3
Hardware
Unit 4
Software
Unit 5
The internet and its uses
Unit 6
Automated and emerging technologies
Automated systems
Automated systems
0%
Artificial intelligence
Artificial intelligence
0%
Avg
score:
–
Topics
done:
0/39

Data compression

Practise 31 exam-style questions on Data compression for Cambridge IGCSE Computer Science (Paper 1). Write your answer as you would in the exam and get it marked in seconds against the mark scheme, point by point, with an AI tutor on hand if you get stuck.

  • 31 questions
  • 1–6 marks each
  • Instant marking
  • No sign-up needed
20 questions, marked as you go

Sample questions with model answers

Here are 4 of the questions in this topic, each with a model answer, an explanation of why it earns the marks and the mark scheme an examiner would use.

Question 1

1 mark

One row of a black and white image is stored using run length encoding as:

4 0 2 1 3 0

Each pair is the number of pixels followed by the colour code, where 0 is white and 1 is black.

State the original binary data for this row of pixels.

Model answer

000011000 (4 white, 2 black, 3 white).

Explanation

Read the data in pairs: (4, 0) means four 0s, (2, 1) means two 1s and (3, 0) means three 0s. Writing them out in order rebuilds the row exactly, which is why RLE is lossless.

Mark scheme
  1. 1 mark

    000011000

    accept with or without spaces; must be 9 bits

Question 2

2 marks

The diagram shows a black and white bitmap image. Row 1 can be stored using run length encoding as 5W 3B (5 white pixels followed by 3 black pixels).

Give the run length encoding for row 2 and for row 4 in the same format.

Bitmap image drawn as a grid of 8 × 4 pixels (8 wide, 4 high), each pixel white or black. A key gives the binary code of each colour: 0 = white, 1 = black. The columns are numbered 1 to 8 along the top and the rows 1 to 4 down the left. The pixels, row by row from the top (left to right): row 1: 5 white, 3 black; row 2: 2 white, 4 black, 2 white; row 3: 8 black; row 4: black, 6 white, black.

Model answer

Row 2: 2W 4B 2W
Row 4: 1B 6W 1B

Explanation

Count the pixels of each colour from left to right until the colour changes. Row 4 starts with a single black pixel, which is written as 1B; leaving out runs of length 1 would make the data impossible to decode.

Mark scheme
  1. 1 mark

    Row 2: 2W 4B 2W

    accept with or without spaces

  2. 1 mark

    Row 4: 1B 6W 1B

    accept with or without spaces

Question 3

3 marks

A hospital stores digital scans of patients' brains. Doctors use the scans to look for very small changes.

Explain why the hospital should use lossless compression rather than lossy compression for these scans.

Model answer

Lossless compression does not permanently remove any data, so each scan can be restored exactly as it was taken. Lossy compression permanently removes data and could remove the very small details that doctors are looking for, which could lead to a wrong diagnosis. Lossless compression still reduces the file size, so the hospital saves storage space without any loss of quality.

Explanation

When every detail matters, the file must be restored exactly, so lossless compression is the only safe choice. The trade-off is that lossless compression gives a smaller reduction in file size than lossy.

Mark scheme
  1. 1 mark

    Lossless compression does not permanently remove any data / the scan can be restored exactly

    max 3

  2. 1 mark

    Lossy compression permanently removes data, which could remove small details

  3. 1 mark

    Doctors could miss a small change / make a wrong diagnosis if detail was lost

  4. 1 mark

    The file size is still reduced, saving storage space, without affecting quality

Question 4

4 marks

Give the missing terms A to D in this description of data compression.

Compression reduces the A of a file, so it needs less storage space and less B when it is transmitted. C compression permanently removes data, for example by reducing the colour depth of an image. Lossless compression, such as D, reduces the file size without permanent loss of data.

Model answer

A: size
B: bandwidth
C: lossy
D: run length encoding (RLE)

Explanation

Compression reduces file size, which reduces the storage space and bandwidth needed. Lossy compression removes data permanently, e.g. by reducing colour depth, while lossless compression such as RLE keeps all of the data.

Mark scheme
  1. 1 mark

    A: size

    accept file size

  2. 1 mark

    B: bandwidth

    accept transmission time

  3. 1 mark

    C: lossy

  4. 1 mark

    D: run length encoding (RLE)

Ready to try the rest? Every answer you write is marked against the mark scheme, so you can see exactly where the marks are.

AI Tutor Hints first, answers after you try

Hi! Stuck? Ask me for a hint and I’ll help you work it out. Once you’ve checked your answer I can explain exactly where the marks are.