AP Computer Science Principles Unit 2 Cheat Sheet
A one-page visual summary of Data — every key idea, compression type, and exam trap you need, on a single screen.
← Back to Unit 2 hub
The basics
What it covers: How data is represented as bits, how it is compressed, and how programs extract information from data.
Exam weight: Big Idea 2 is about 17–22% of the AP CSP multiple-choice exam.
The big question: How is all data represented with bits, and how do we compress it and turn it into useful information?
Computational thinking practices: Computational Solution Design, Algorithms & Program Development, Abstraction, Code Analysis, Computing Innovations, and Responsible Computing.
Key topics at a glance
Bits & Bytes
A bit is a 0 or 1 — the smallest unit of data. A byte is 8 bits. All data (numbers, text, images, sound) is ultimately stored as bits.
Binary Numbers
Convert binary → decimal by adding the place values (powers of 2) where there is a 1. n bits represent 2ⁿ values. Too big for the bits → overflow.
Analog vs. Digital
Analog data is continuous; digital data is discrete. Sampling converts analog to digital — finer samples = more accurate.
Data Abstraction
Bits are an abstraction: the same sequence can represent a number, letter, color, or sound depending on how a program interprets it.
Data Compression
Lossless: no data lost, fully recoverable (ZIP, PNG). Lossy: some data permanently discarded, smaller size (JPEG, MP3).
Compression Tradeoff
Lossless keeps all quality but shrinks less; lossy shrinks more but loses fidelity. Use lossless when every detail matters.
Information & Metadata
Data = raw facts; information = insight from analyzing data. Metadata = data about data (date, size, location).
Extracting & Using Data
Find patterns by filtering, sorting, and aggregating. Correlation ≠ causation. Clean data first. Programs process large datasets at scale.
The key terms you must know
- Bit — a single binary digit, 0 or 1; the smallest unit of data.
- Byte — a group of 8 bits.
- Binary — the base-2 number system computers use.
- 2ⁿ rule — n bits can represent 2ⁿ different values.
- Overflow — a value too large for the available bits.
- Analog vs. digital — continuous data vs. discrete, bit-based data.
- Sampling — measuring an analog signal at intervals to digitize it.
- Abstraction (of bits) — the same bits can mean different things depending on interpretation.
- Data compression — reducing the number of bits needed to store/transmit data.
- Lossless compression — reduces size with no data lost (recoverable).
- Lossy compression — reduces size by discarding some data (not fully recoverable).
- Data vs. information — raw facts vs. insight gained from analysis.
- Metadata — data about data.
- Correlation vs. causation — association does not prove cause.
- Cleaning data — fixing/removing errors before analysis.
Key themes to remember
- Everything is bits. Numbers, text, images, and sound are all stored as 0s and 1s.
- Bits are an abstraction. Meaning depends on interpretation, not the bits themselves.
- Compression trades size for fidelity. Choose lossless or lossy based on whether loss is acceptable.
- Data is not information until it is analyzed. Programs turn raw data into insight.
- Be careful with conclusions. Correlation is not causation, and dirty data leads to wrong results.
Common exam traps
- n bits = 2ⁿ values, not n or 2n. Each added bit doubles the number of possible values.
- Lossy loss is permanent. You cannot recover the original data from a lossy-compressed file.
- Use lossless for text and program files; lossy is for media where some quality loss is acceptable.
- Correlation does not imply causation. A pattern in data is not proof that one thing causes another.
- Metadata is data about data, not the main content itself (e.g., a photo's date, not the photo).
- Overflow is a data-representation limit, not a compression method.
- Cleaning data matters. Analyzing messy or biased data produces misleading information.