Math · Intermediate · Lesson 7 of 7
Compression Codes
Short codes for common symbols
An interactive lesson with 8 steps, about 7 minutes: you predict, drag and solve, with instant feedback on every answer. It runs in your browser and needs JavaScript.
What you’ll learn
- Variable-length prefix codes give short codes to common symbols.
- Decodable lengths satisfy Kraft: ; the average can't beat the entropy.
- Huffman’s algorithm builds an optimal code; random data can’t be compressed.
Steps
- Not every letter is equal
- Prefix-free
- Design the code
- The saving
- Huffman’s algorithm
- Building a Huffman tree
- Build a Huffman code
- Compressing everything?