Lesson 6 - Exam practice
Test your knowledge
Work through these questions as you would in an exam. Answer the MCQ first, then write your answers to the written questions before revealing the mark scheme.
Section 1: Multiple choice
Select one answer per question. Instant feedback appears when you choose.
Question 1 of 5
Which type of compression allows the original file to be perfectly reconstructed from the compressed version?
Lossless compression removes redundant data in a way that can be reversed. The decompressed file is identical to the original. Lossy compression permanently discards data.
Question 2 of 5
A pixel row reads: B B B B B R R W W W W. Applying run-length encoding gives:
RLE replaces each run with (count, value). The row has a run of 5 Bs, 2 Rs, and 4 Ws. Notation varies -- '5B 2R 4W' or equivalent is accepted.
Question 3 of 5
In Huffman coding, which symbol receives the shortest binary code?
Huffman coding assigns shorter codes to more frequent symbols. This minimises total bits used, since common symbols are encoded more compactly.
Question 4 of 5
A 4 MB image is compressed to 1 MB using JPEG. What is the percentage space saving?
Saving = (4 - 1) / 4 × 100 = 3/4 × 100 = 75%.
Question 5 of 5
Why might RLE compression increase the file size of a photographic image?
RLE only reduces size when long runs of identical values exist. In a photograph, nearly every pixel is a different colour. Encoding each as (1, colour) doubles the data instead of reducing it.
Section 2: Written questions
Write a full answer in your notebook or on paper before checking against the lesson notes.
Written question 1
Apply run-length encoding to the following pixel sequence and calculate the percentage space saving. Show all working.
W W W W G G G G G G B B B B W W W W W W W W5 marks
Written question 2
Explain how Huffman coding works and why it produces smaller files than fixed-length binary encoding.
4 marks
Written question 3
A school stores student photographs on its server. Discuss whether lossy or lossless compression is more appropriate for this use, giving reasons for your decision.
5 marks