Shorter codes for frequent characters
Gives common characters short bit codes and rare ones longer codes, so a whole message uses fewer bits than if every character used the same fixed number of bits.
Understanding Shorter codes for frequent characters in Years 9–10 Data & Information
What it does: The tally shows A appears 6 times, B twice and C once, so A should get the shortest code. Multiplying each letter's count by its code length and adding them gives 12 bits, which is less than the 18 bits needed with fixed-length codes. You need the character frequencies first so you know which characters should get the short codes.
Common mistakes: The message has 9 characters and each uses 2 bits, so the fixed-length total is 9 * 2 = 18 bits, not 16. B appears only once in AABAACAD, so the count should be 1. Counting frequencies correctly is the first step in giving the common characters shorter codes.
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
variable-length codingFill in the Blanks
Spot the Error
Student with a class code? Join your class →