Homeschool Guide: These lesson plans are a guide for parents. Content may contain errors — always cross-reference with official exam board specifications.

data compression

FoundationHigherAll Boards

4 detailed 50-minute lessons with teaching scripts, worked examples, parent guides, and assessment criteria.

Fastmail

Lesson Overview

Total Lessons: 4
Tier: Foundation and Higher
Duration: 50 minutes per lesson (200 minutes total)
Exam Boards: AQA, Edexcel, OCR, Eduqas, CCEA

Learning Objectives

Prerequisites

Materials & Equipment

Lesson 1: Introduction: data compression

Duration: 50 minutes

Starter Activity (5 minutes)

Quick Recall

Write down everything you already know about data compression. Then check against the key terms: Key Difference, Rule of Thumb, GCSE Computer Science Exam Tips. Use a mini-whiteboard or paper.

Main Content (35 minutes)

Parent/Teacher Guide:
Before lesson: Read the script below. Pre-teach key vocab: Key Difference, Rule of Thumb, GCSE Computer Science Exam Tips.
If stuck: Re-read the revision notes (link above), then break the content into smaller steps.
Extension: See the Stretch & Challenge ideas in Lesson 4.
Teaching Script (35 mins):
Mins 0-5 - Hook: "Today: data compression. By the end you will be able to answer exam questions on it unaided. It connects to the rest of Computer Science because the ideas here recur across the spec."
Mins 5-20 - Direct Instruction: Work through the core ideas below one at a time; after each, ask your student to explain it back in their own words.
Mins 20-30 - Guided Practice: Model the worked example together, then let your student attempt the first practice question with guidance.
Mins 30-35 - Independent Practice: 2-3 practice questions from Lesson 3 below, with immediate feedback.
First Look

Start with the revision notes summary, then attempt: Explain the difference between lossy and lossless compression.

Plenary (5 minutes)

Check Out

Your student states one thing they learned and one question they still have about data compression.

Lesson 2: Core Concepts: data compression

Duration: 50 minutes

Starter Activity (5 minutes)

Review Previous Lesson

Quick recap: write 3 key points from Lesson 1 on data compression. Check them against the notes below.

Main Content (35 minutes)

Definition: Data compression reduces the number of bits needed to represent data. This saves storage space and reduces the time needed to transmit data over a network.
Key Difference: Lossy compression discards some data permanently - you cannot get the original back. Lossless compression finds more efficient ways to represent the same data - the original can be perfectly reconstructed.
Definition: Huffman coding is a lossless compression algorithm that assigns shorter binary codes to more frequently occurring characters and longer codes to less frequent characters.
Definition: Run length encoding (RLE) is a lossless compression method that replaces sequences of the same data value (runs) with a count and the value, stored as frequency/data pairs.
Important: RLE only works well when data has many consecutive repeated values. It is very effective for simple graphics with large areas of the same colour (like icons or diagrams) but poor for complex data with little repetition (like photographs or random data).
Rule of Thumb: Use lossy when small file size matters more than perfect accuracy (media streaming, web images). Use lossless when data integrity is essential (documents, code, medical images). Use RLE when data has long runs of identical values. Use Huffman when characters have varying frequencies.
TermMeaningExample
How it worksPermanently removes data that is less important or noticeableReduces file size without losing any data
Data recoveryOriginal data CANNOT be fully restoredOriginal data CAN be fully restored
Compression ratioHigher (much smaller files)Lower (moderately smaller files)
QualitySome quality is lostNo quality loss - exact original
File examplesJPEG, MP3, MP4PNG, FLAC, ZIP
Typical useStreaming, web images, musicText files, code, medical images, archives
Streaming music onlineLossy (MP3)Small file size needed; slight quality loss acceptable
Archiving important documentsLossless (ZIP)Must preserve exact data; no data loss acceptable

Practice (10 minutes)

Q: Explain the difference between lossy and lossless compression.

Answer: Lossy compression permanently removes some data to achieve a smaller file size; the original cannot be restored. Lossless compression reduces file size without losing any data; the original can be perfectly reconstructed.

Plenary (5 minutes)

Explain Back

Your student teaches the key points back to you without looking. Fill any gaps immediately.

Lesson 3: Application: data compression

Duration: 50 minutes

Starter Activity (5 minutes)

Quick Recall

Recall the key terms: Key Difference, Rule of Thumb, GCSE Computer Science Exam Tips. Define each in one sentence.

Main Content (35 minutes)

Parent/Teacher Guide: Let your student attempt each question alone first, then compare with the model answer. Award method marks for correct working even if the final answer is wrong.

Q1: Explain the difference between lossy and lossless compression.

Answer: Lossy compression permanently removes some data to achieve a smaller file size; the original cannot be restored. Lossless compression reduces file size without losing any data; the original can be perfectly reconstructed.

Q2: The string "MISSISSIPPI" has these character frequencies: M=1, I=4, S=4, P=2. Construct a Huffman tree and assign codes to each character.

Answer: Combine M(1) and P(2) → MP(3). Combine MP(3) and I(4) or S(4): e.g. MP(3) and one of the 4s → e.g. MP(3) + I(4) = MPI(7). Then MPI(7) + S(4) = root(11). Codes will vary depending on tree construction, but shorter codes for I and S, longer for M and P.

Q3: Using the Huffman codes from Q2, calculate the total bit length of "MISSISSIPPI" and compare it to a fixed-length encoding.

Answer: With 4 characters, fixed-length needs 2 bits each. Fixed = 11 x 2 = 22 bits. Huffman depends on your tree from Q2, but should be fewer than 22 bits (likely around 18-19 bits). The saving comes from I and S having short codes.

Q4: Apply run length encoding to this bitmap row: 111110000011111

Answer: RLE: 5,1 5,0 5,1 (or 51150051 depending on notation). Original = 15 values; Compressed = 6 values.

Q5: Explain why RLE would not be a good compression method for a photograph.

Answer: A photograph contains thousands of subtly different colours in adjacent pixels, with very few long runs of identical values. RLE would produce frequency/data pairs for nearly every pixel, making the compressed file similar in size to or larger than the original. Lossy compression (JPEG) is better for photographs.

Plenary (5 minutes)

Error Review

Review any questions answered incorrectly. Identify whether the error was knowledge, method, or reading the question.

Lesson 4: Exam Practice: data compression

Duration: 50 minutes

Starter Activity (5 minutes)

Command Words

Review what these command words require: state (one point), describe (say what happens), explain (say why), compare (both sides), evaluate (judgement).

Main Content (35 minutes)

Extended Answer

Extended question: Full-Mark Response A bitmap image contains the following pixel data: RRRRGGGGBBBBYYYY. Explain how run-length encoding would compress this data, and calculate the compression ratio. [4 marks] <div class="

Original data: RRRRGGGGBBBBYYYY (16 characters) RLE compression stores each colour and its count: R4G4B4Y4 (8 characters) Each run is encoded as: colour character + count digit. Compression ratio = original size ÷ compressed size = 16 ÷ 8 = 2:1 The data has been compressed to half its original size. RLE is effective here because the data contains long runs of identical values. If the data were RGBYRGBY (no repeats), RLE would not compress it effectively.

Exam Tips: Know the difference between lossy and lossless and give examples of each | Practise building Huffman trees step by step - show all stages | Always compare Huffman encoding to fixed-length and calculate the saving | Remember RLE uses frequency/data pairs - show the format clearly | Explain WHY a compression method is suitable for a given scenario, not just which one | For Huffman, remember: no code is a prefix of another code | State that RLE can increase file size if data has few repeated runs
Common Errors: ✗ Confusing lossy and lossless compression ✓ Lossy compression permanently removes data to reduce file size; the original cannot be restored. Lossless compression reduces file size without losing any data; the original can be perfectly reconstructed. ✗ Thinking lossy compression makes files useless ✓ Lossy compression removes data that is less noticeable to humans (e.g. high frequencies in audio, fine detail in images). The result is still usable — just not identical to the original. ✗ Not understanding how RLE works — thinking it compresses all data ✓ Run-length encoding (RLE) only compresses data with repeated sequences. Data without repetition (e.g. ABCDEF) would actually increase in size
Stretch & Challenge (Grade 8-9):
  • Synoptic links: explain how data compression connects to another Computer Science topic you have studied
  • Real-world: research one real-world use or example of data compression
  • Critical: "What are the limitations of the models used in data compression?"

Plenary (5 minutes)

Assessment Criteria
  • Got it: Confident explanation + correct worked examples
  • Getting there: Main points OK, needs support with detail
  • Not yet: Confused on key concepts - re-run Lesson 2

Homework & Consolidation

Recommended Resources

🎓 Smart Lesson (Guided)