Data Compression

Analog signals (continuous sound waves or light intensity) are digitized by sampling at regular intervals.

What to practice

  • Explain how analog data are sampled into discrete digital representations.
  • Compare lossless and lossy compression algorithms and select the appropriate method for a given scenario.
  • Distinguish primary data from metadata and explain how metadata enables filtering, sorting, and privacy risks.

1. Core Concept Instruction

Analog signals (continuous sound waves or light intensity) are digitized by sampling at regular intervals and quantizing each sample into a finite number of bits; higher sampling rates and higher bit depths produce more accurate digital approximations at the cost of larger file sizes. Data compression reduces the number of bits needed to store or transmit files: (1) Lossless Compression algorithms (such as run-length encoding of repeated values, dictionary methods like LZW and LZ77 that replace repeated sequences, and Huffman coding, which gives frequent symbols shorter codes; ZIP and PNG combine LZ77 and Huffman coding in DEFLATE, while GIF uses LZW) guarantee that the exact original bit-for-bit file can be reconstructed with zero loss of information—mandatory for executable code, text documents, spreadsheets, and financial/medical records. (2) Lossy Compression algorithms (such as JPEG, MP3, and MP4) permanently discard perceptually minor details to achieve much smaller file sizes, but the exact original bits cannot be recovered. Metadata is 'data about data' (e.g., photo timestamp, GPS coordinates, author, file size); modifying or deleting metadata does not alter the primary content payload itself.

2. Worked Examples

Worked Dictionary Lossless Compression & RGB Image Bit Calculation

(a) A lossless dictionary scheme replaces "ban" with '#' and "ana" with '$'. Compress "banana_bandana" and count the character savings. (b) How many uncompressed bits are required for the pixel grid of a 100 x 80 RGB image using 8 bits per color channel?

Result:

Run-Length Lossless Compression Ratio & Metadata vs. Payload Separation

A monochrome icon row has 40 consecutive white pixels (W) followed by 20 black pixels (B). Compare raw 1-bit encoding against run-length encoding (40W, 20B) and identify which camera fields are metadata.

Result: Lossless run-length encoding reconstructs all 60 pixels exactly; EXIF headers are metadata

Core Concept Review

Analog signals (continuous sound waves or light intensity) are digitized by sampling at regular intervals and quantizing each sample into a finite number of bits; higher sampling rates and higher bit depths produce more accurate digital approximations at the cost of larger file sizes. Data compression reduces the number of bits needed to store or transmit files: (1) Lossless Compression algorithms (such as Run-Length Encoding and LZW/Huffman dictionary substitution used in ZIP, PNG, and GIF) guarantee that the exact original bit-for-bit file can be reconstructed with zero loss of information—mandatory for executable code, text documents, spreadsheets, and financial/medical records. (2) Lossy Compression algorithms (such as JPEG, MP3, and MP4) permanently discard perceptually minor details to achieve much smaller file sizes, but the exact original bits cannot be recovered. Metadata is 'data about data' (e.g., photo timestamp, GPS coordinates, author, file size); modifying or deleting metadata does not alter the primary content payload itself.

Extended Concept Analysis

Analog signals (continuous sound waves or light intensity) are digitized by sampling at regular intervals and quantizing each sample into a finite number of bits; higher sampling rates and higher bit depths produce more accurate digital approximations at the cost of larger file sizes. Data compression reduces the number of bits needed to store or transmit files: (1) Lossless Compression algorithms (such as Run-Length Encoding and LZW/Huffman dictionary substitution used in ZIP, PNG, and GIF) guarantee that the exact original bit-for-bit file can be reconstructed with zero loss of information—mandatory for executable code, text documents, spreadsheets, and financial/medical records. (2) Lossy Compression algorithms (such as JPEG, MP3, and MP4) permanently discard perceptually minor details to achieve much smaller file sizes, but the exact original bits cannot be recovered. Metadata is 'data about data' (e.g., photo timestamp, GPS coordinates, author, file size); modifying or deleting metadata does not alter the primary content payload itself.

Worked Problem Walkthrough

Worked Dictionary Lossless Compression & RGB Image Bit Calculation

(a) A lossless dictionary scheme replaces "ban" with '#' and "ana" with '$'. Compress "banana_bandana" and count the character savings. (b) How many uncompressed bits are required for the pixel grid of a 100 x 80 RGB image using 8 bits per color channel?

Run-Length Lossless Compression Ratio & Metadata vs. Payload Separation

A monochrome icon row has 40 consecutive white pixels (W) followed by 20 black pixels (B). Compare raw 1-bit encoding against run-length encoding (40W, 20B) and identify which camera fields are metadata.

Common Exam Traps & How to Avoid Them

  • Claiming that lossy compression is always smaller than lossless compression for every file, or that lossy files can be restored to the original high-resolution source.

  • Thinking that encrypting or deleting a file's metadata changes the primary message body.

Key Vocabulary

  • Lossless Compression: A data compression technique in which no data are lost and the original file can be reconstructed bit-for-bit.

  • Metadata: Descriptive data about a file or transmission (such as timestamp, geolocation, sender, or resolution) separate from the primary content.

Use this chapter companion

Review the lesson, attempt the original practice, then check the explanation. Your printed study guide remains complete without the website.

Independence

Skill by Skill Prep is independent. SAT® and AP® are trademarks registered by the College Board, which is not affiliated with, and does not endorse, this website or book. PSAT/NMSQT® is a registered trademark of the College Board and the National Merit Scholarship Corporation, which are not affiliated with, and do not endorse, this site. Bluebook™ is a trademark of the College Board. ACT® is a trademark of ACT Education Corp., which is not affiliated with and does not endorse this website or book. Desmos is a trademark of Desmos Studio PBC. Practice results describe these questions, not official scores or admission predictions.

Last updated .