liveBook · Manning

Compression

As explained in How Computers Make Books

Compression is the reduction of the amount of data needed to represent information while preserving either all or an acceptably useful part of its content.

Compression reduces the space needed to represent information, helping large files move faster and occupy less storage. The transformation must preserve enough information to be useful; in lossless compression, it remains reversible. section 6.0 section 6.1

A shorter coffee order

“Four espressos, two double espressos, a cappuccino, and two lattes” can become “4E2DC2L.” The seven-character message is much shorter than the original, but only because the recipient already knows the decoding instructions. section 6.1

Compression works best when data contains patterns. Frequent words or sequences can receive short codes, while uncommon material remains literal. A word-list scheme replacing the hundred most-used English words with two-character codes reduced a 975-character passage to 880 characters after adjacent codes were joined. section 6.2

Figure 6.1 Our example text, from Metamorphosis by Franz Kafka

Inspect the sample passage alongside the word list and successive compressed forms to see how repeated language becomes shorter codes. section 6.2

Compression involves several important trade-offs:

  • Uniform data may offer fewer useful patterns, limiting how much it can shrink. section 6.1
  • Some messages cannot be shortened when all possible messages are equally likely; encoding savings in one case can require extra space elsewhere. section 6.1
  • Lossless methods preserve all content, while lossy methods discard carefully chosen information for greater size reductions. section 6.7

How How Computers Make Books covers it

How deep it goes
Explains reversible representations, pattern-based codes, and basic limits, while stopping short of specialized algorithms.
Examples
Uses a coffee-order abbreviation and a common-word code applied to a passage from Metamorphosis.
What it assumes
Assumes only familiarity with messages and characters, and builds the need for coding from simple examples.
What you can do after
Evaluate simple compression schemes by comparing representations, repeated patterns, reversibility, and measured size.
How it connects
Connects compression with data representation, patterns, storage, transmission, text, images, and video.

Also explained in

Compare how 11 books explain compression →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of How Computers Make Books. The section links point to the parts of the book it draws on.