Dictionary (substitution) compression
Give each repeated word or phrase a short code, store the code table once, then replace every repeat with its code so the data takes up fewer characters.
Understanding Dictionary (substitution) compression in Years 9–10 Data & Information
What it does: The code table lists each short code with the repeated phrase it stands for, and is stored only once. Each repeat of "the cat" is replaced by 1 in its original position, so the order of the sentence stays the same. One copy of the table is enough to rebuild all the repeats. Storing it again and again would waste the space we are trying to save. Each replacement saves 7 - 1 = 6 characters. 5 x 6 = 30. The table entry costs extra characters, so the real saving is a bit lower.
Common mistakes: Every repeat of "go" must be replaced with its code. The third "go" was left in, so the line should be out ← "1 1 1 home". The code Z replaces "the" in the packed text, so the table must say Z = "the". With "cat" in the table the message would decode wrongly.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 6–16) and word search (Modules 6–132).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
dictionary compressionFill in the Blanks
Spot the Error
Student with a class code? Join your class →