Unit 2: Data

AP Computer Science Principles: 51 practice questions with detailed explanations.

Unit Study Guide

Executive Summary

Computers store everything as bits. Compression shrinks data, tools extract meaning from it, and privacy concerns follow whenever data describes people.

Binary numbers

Bits are 0s and 1s; a byte is 8 bits. With n bits you can represent 2^n values (8 bits → 256 values, 0 to 255). Overflow happens when a result needs more bits than available. Converting: each position is a power of two; 1011 = 8 + 0 + 2 + 1 = 11.

Compression

Lossy compression drops information permanently (JPEG, MP3) — smaller files, some quality lost. Lossless compression restores the original exactly (PNG, ZIP, FLAC). Choose lossy for photos and audio where small loss is fine; lossless for text and data that must survive exactly.

Working with data

Metadata is data about data (photo date, location). Cleaning fixes bad entries; filtering keeps records matching a condition; sorting orders them. Programs search, filter, and compute statistics over datasets. Patterns come from comparing many records.

Privacy and bias

Data describing people raises privacy issues; PII includes names, addresses, and emails. Anonymization strips identifiers. Biased data — underrepresentation or skewed collection — produces unfair conclusions. A survey of app users misses non-users.

Exam traps

n bits give 2^n values, not 2n. Lossless vs lossy is about whether the original is exactly restorable. Metadata describes other data. Bias lives in the collection, not the analysis.

Top 5 Concepts to Master

  1. 1Convert small binary numbers to decimal and back.
  2. 2Choose lossy vs lossless compression.
  3. 3Identify metadata and PII.
  4. 4Recognize sources of data bias.

Key Terms & Definitions

Practice with Flashcards
Bit

Binary digit, 0 or 1.

Byte

Eight bits.

Overflow

Result too large for the available bits.

Lossy compression

Drops information; cannot restore exactly.

Lossless compression

Restores the original exactly.

Metadata

Data that describes other data.

Personally identifiable information

Data identifying a specific person.

Data bias

Skewed data producing unfair conclusions.

Common Misconceptions: Exam Traps

8 bits can represent 256 through 511.

Correct: They represent 0 through 255.

Lossy compression is always better.

Correct: Lossless is required when data must survive exactly.

A photo’s pixels are metadata.

Correct: Pixels are content; date and location are metadata.

Larger samples automatically remove bias.

Correct: Bias comes from how data is collected.

Question Bank Breakdown

By difficulty

easy 19medium 31hard 1

By topic

Binary Numbers 19Data Privacy 8Extracting Information from Data 8Data Compression 7Using Programs with Data 5Bias in Data 4

All Questions in this Unit