Data Compression
Introduced| English | Meaning |
|---|---|
| Compression/kəmˈpreʃn/ | Representing data using fewer bits, with or without discarding information. |
| Internet/ˈɪntənet/ | Internet |
| Lossless/ˈlɒsləs/ | Describing compression from which the original data can be recovered exactly. |
| Lossy/ˈlɒsi/ | Describing compression that discards some original information so it cannot be perfectly recovered. |
| size/saɪz/ | size |
| quality/ˈkwɒlɪti/ | The extent to which a product, service or outcome meets stated requirements or users' needs. |
| trade-off/treɪd ɒf/ | A choice that involves giving up some benefit or objective to gain another. |
| redundancy/rɪˈdʌndənsi/ | Additional or repeated data, capacity or components beyond what is strictly necessary, sometimes provided for reliability. |
| transmission/trænˈsmɪʃn/ | transmission |
Storing the same data in fewer bits
- A photo or song can hold millions of bytes — files get large.
- Compression 压缩 is any method that stores the same data using fewer bits.
- Smaller files take less space to store.
- And they are faster to send across the Internet 互联网.
Compression means storing the same data using:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Fewer bits means smaller files that store and send faster.
Match each method to its property.
Difficulty 2/5 · 140 coins + a small bonus on first completion today
Text needs lossless; photos and music often use lossy.
Which data type must use lossless compression?
Difficulty 1/5 · 100 coins + a small bonus on first completion today
One changed byte could break a program, so it must be lossless.
Lossless vs lossy
- Lossless 无损 compression keeps every bit — the data restores exactly.
- Text and program files must be lossless; one changed letter could break them.
- Lossy 有损 compression makes files much smaller by throwing away data people are unlikely to notice.
- The original cannot be restored exactly — photos, music, and video often use it.
Lossless compression trades data quality for a smaller file size.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
False. Lossless compression keeps all the original data. It is lossy compression that discards some detail to make files smaller.
The size–quality trade-off
- Lossy compression forces a trade-off 权衡 between two things.
- File size 大小: how many bits it needs. Data quality 质量: how close it is to the original.
- Squeezing smaller usually means losing more detail.
Same photo, two ways. A lossless file is 5 MB and looks perfect; a lossy file is 0.5 MB — ten times smaller — but slightly blurry when zoomed. For a fast website, pick the small lossy file; for a large sharp poster, pick the lossless one.
Run-length encoding (a lossless method)
Run-length encoding replaces a run of repeated values with one value plus a count. It is lossless — the original rebuilds exactly — but only shrinks data that has long runs.
Storing "100 white pixels" as "white, 100 times" works by removing:
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Run-length encoding replaces a run with a value plus a count — lossless.
A compressed file with fewer bits transmits across a network faster.
Difficulty 1/5 · 100 coins + a small bonus on first completion today
Fewer bits to send means faster transmission.
Removing redundancy
- Many methods work by removing redundancy 冗余 — data that repeats or can be predicted.
- A line of 100 identical white pixels can be stored as "white, 100 times" instead of listing all 100.
- That is far fewer bits for the same picture — a lossless method called run-length encoding.
- Fewer bits also means faster transmission 传输 across a network.
Compression stores data in fewer bits — saving space and speeding transmission. Lossless keeps every bit (needed for text and code); lossy discards unnoticeable data for much smaller files (photos, music). Lossy forces a size–quality trade-off, and many methods shrink files by removing redundancy.