Data
What this unit covers
The topics below follow the published CS Principles course framework for Unit 2. This unit is worth 17–22% of the exam, so budget your time against that rather than against how long the unit takes to teach.
Lessons in this unit
- Binary & Number Representation13 min · 3 objectivesExplain why computers represent all data using bits (binary) · Convert numbers between binary and decimal · Relate the number of bits to the range of values that can be represented
- Data Compression13 min · 3 objectivesDistinguish lossless from lossy compression and their trade-offs · Explain why compression reduces storage and transmission costs · Compute and interpret a compression ratio
- Extracting Information from Data13 min · 3 objectivesExplain how patterns and correlations are found in large data sets · Distinguish correlation from causation · Describe the roles of metadata, cleaning, and filtering in analysis
- Bias in Data Collection12 min · 3 objectivesExplain how the way data is collected can introduce bias · Describe how a non-representative sample skews conclusions · Recognize privacy and consent issues in gathering data
Formulas in Unit 2
What examiners penalize here
- Watch for **overflow**: with a fixed number of bits, the representable range is 0 to 2ⁿ − 1. A value past the top cannot be stored, so the exam expects you to say it overflows — not that it rounds or is stored fine.
- Remember the trade-off in one line: **lossless = exact but larger; lossy = smaller but permanent loss.** For a compression ratio, divide original by compressed — a bigger ratio means a smaller file.
- A correlation in data never by itself proves causation. On the exam, the safe reading of "X and Y rise together" is that they are *associated* — a possible hidden variable or reversed direction must be ruled out before claiming cause.
- When a scenario describes collecting data, scan for two things: is the **sample representative**, and was there **consent/privacy** protection? Those are the two questions the exam repeatedly rewards you for asking.
Practice CS Principles
Our practice bank is drawn from across the whole course rather than filtered to one unit, which is closer to how the exam asks anyway — it will not tell you which unit a question is testing.
Questions about this unit
How much of the AP Computer Science Principles exam is Unit 2?
Unit 2, Data, is worth 17–22% of the CS Principles multiple-choice section according to the published course framework. Across all 5 units that makes it one of the heaviest units on the exam, and worth front-loading.
What topics are covered in CS Principles Unit 2?
Data covers Binary, Data compression, Extracting information and Bias.
How should I study CS Principles Unit 2?
Read the 4 lessons below first — about 50 minutes — then work practice questions on these topics. Finish with practice questions and read the explanation for every one you get right by elimination as well as the ones you miss.
All 5 units of AP Computer Science Principles
Unit names, topics and exam weights follow the published College Board course framework for AP Computer Science Principles. AP® is a trademark registered by the College Board, which does not endorse this site.