All 5 CS Principles units
💡
AP Computer Science Principles · Unit 2 of 5

Data

17–22% of the exam4 lessons · 51 min

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.

BinaryData compressionExtracting informationBias

Lessons in this unit

Formulas in Unit 2

Range of n bits
patterns = 2ⁿ · largest unsigned value = 2ⁿ − 1
n bits produce 2ⁿ distinct patterns, representing the integers 0 through 2ⁿ − 1. Each added bit doubles the number of representable values.
Compression ratio
compression ratio = original size / compressed size
A ratio of 4:1 means the compressed data is one-quarter the original size. Equivalently, space saved = (original − compressed) / original.

What examiners penalize here

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

  1. Unit 1 · Creative Development
  2. Unit 2 · Data
  3. Unit 3 · Algorithms & Programming
  4. Unit 4 · Computer Systems & Networks
  5. Unit 5 · Impact of Computing

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.