AP Computer Science Principles study materials
AP Computer Science Principles study resources

AP Computer Science Principles: Data: Representation, Compression, and Extraction

AP Computer Science Principles · Work through your exam, one topic at a time.

All guide sections

Data: Representation, Compression, and Extraction

What this big idea asks you to know

Big Idea 2 covers how data is stored, represented, compressed, and used. You must know that all digital data is binary, that bits are grouped into bytes (8 bits), and that numbers, text, images, and sound are encoded using agreed conventions. Know the difference between lossless compression (original data can be perfectly reconstructed) and lossy compression (some data is discarded, often fine for images and audio but not for text or code). Understand metadata, data cleaning, and how large data sets enable patterns that small samples miss.

Concepts to master

  • Binary/hexadecimal conversion and why hexadecimal is used as shorthand.
  • Character encoding (e.g., ASCII-style codes map characters to numbers).
  • Sampling and resolution: more samples/pixels generally mean higher fidelity and larger files.
  • Compression trade-offs: file size versus fidelity.
  • Data extraction and filtering: selecting records that meet criteria.
  • Bias and error in data: incomplete or unrepresentative data leads to misleading conclusions.

Traps to watch for

Questions love the lossy-versus-lossless distinction applied to the wrong medium - e.g., claiming lossy compression is acceptable for source code or spreadsheets. Another trap is confusing file size with quality: a larger file is not automatically more accurate. Also watch for answers that treat correlation in a data set as proof of causation.

Rule of thumb

Ask Can the original be reconstructed exactly? If yes, it's lossless. If any information is permanently discarded, it's lossy - and then ask whether that loss is acceptable for the data type.

Worked example: A 4-bit code holds 2^4 = 16 distinct values, so it can represent 16 different characters or colors.