Making Big Things Small
Chapter Field Guide
Measurable Learning Outcomes
- Encode and decode data using Run-Length Encoding (RLE) and Huffman prefix codes.
- Explain the pigeonhole proof showing no lossless algorithm can shrink every possible file.
- Contrast lossless compression (ZIP/PNG) with lossy quantization (JPEG/MP3).
Core Scientific Intuition
Compression exploits predictability and repetition. Huffman coding assigns shorter bit codes to frequent symbols and longer codes to rare ones, using prefix-free binary trees so bits decode unambiguously. By the pigeonhole principle, there are fewer short bitstrings than long ones, so any lossless compressor that shrinks structured files must expand some random files.
Units & assumptions: Applies to memoryless symbol sources; real formats (DEFLATE/LZ77) also exploit repeated substrings.
Worked Example
In "AAAAABBBCC", RLE stores (5,A)(3,B)(2,C). On random text like "ABCDEFGH", naive RLE doubles the size to (1,A)(1,B)... showing why input structure determines compression gain.
Hands-On Exploration
Interactive Laboratory
Test the concepts directly with 3 interactive panels, live controls, and visual feedback.
Open Interactive Lab →Three Guided Projects
Structured experiments with hypotheses, boundary tests, hints, and reflection prompts.
View 3 Projects →Source Code (7 Snippets)
Inspect byte-identical printed JavaScript blocks, download `.js` files, or test runnable blocks in the isolated sandbox.
Browse Code →Self-Check Quiz (5 Questions)
Immediate explanations for every choice, unlimited retries, and local-only score tracking.
Take Self-Check Quiz →Book Chapter Outline (Reference Guide)
Section headings from Volume 1 for cross-referencing with the printed book.
Show all 32 book section headings
- The phone that ran out of room
- PEOPLE BEHIND THE SCIENCE
- Abraham Lempel (1936-2023)
- Jacob Ziv (1931-2023)
- Two ways to make data smaller
- Lossless compression
- Lossy compression
- Meet a pioneer: Claude Shannon (1916-2001)
- Why predictability saves bits
- Run-length encoding (RLE)
- Meet a pioneer: David A. Huffman (1925-1999)
- Give common symbols shorter codes
- ZIP and PNG: patterns inside patterns
- Why does a ZIP file sometimes get bigger?
- How a photo trades detail for space
- A science fair about image quality
- How music and movies fit on a phone
- Project 1: pack a repeated message
- Project 2: build the code tree
- Project 2 continued: encode and decode
- Project 3: trade precision for size
- Enter the compression laboratory
- Experiment A: the run counter
- Experiment B: the code tree
- Experiment C: a quality control
- Detective mission: a tiny archive with a big secret
- Answers
- When a compressor makes the wrong choice
- Now invent something
- The next mystery
- Scientific vocabulary and references
- Explore the standards and history
Primary Sources & Further Reading
External links are provided for independent verification and deeper study. Link availability can change over time; see the Resources page for verification notes.
| Source | Type | Link |
|---|---|---|
| Read more | reference | https://www.cs.technion.ac.il/news/view-new.php?nwid=1365 |
| Read more | reference | https://www.itsoc.org/profile/8725 |
| Further reading: IEEE Spectrum, Celebrating Claude Shannon. | educational-archive | https://spectrum.ieee.org/celebrating-claude-shannon |
| Original 1948 paper: A Mathematical Theory of Communication | reference | https://doi.org/10.1002/j.1538-7305.1948.tb01338.x |
| University of California, Santa Cruz: biography and achievements | reference | https://news.ucsc.edu/1999/10/faculty-member-david-huffman-dies-at-74/ |
| W3C: PNG specification | primary-standard | https://www.w3.org/TR/png/ |
| IETF: RFC 1951, DEFLATE | reference | https://www.rfc-editor.org/rfc/rfc1951 |
| MDN: image formats | official-docs | https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types |
| MDN: lossy compression | official-docs | https://developer.mozilla.org/en-US/docs/Glossary/Lossy_compression |
| IEEE: Huffman original paper | reference | https://doi.org/10.1109/JRPROC.1952.273898 |