Skip to main content

AP Computer Science P Unit 2 Cheatsheet: Data

AP Computer Science P Unit 2 Cheatsheet: Data

Start with the first 3 sections of the Unit 2 one-page cheatsheet below. The full sheet is a PDF you can print.

Bits, Bytes, and Binary Basics

  • Bit: Binary digit; either 0 or 1
  • Byte: 8 bits
  • Digital representation: All data stored as combinations of bits
  • Abstraction: Bits grouped to represent numbers, characters, colors, etc.
  • Key insight: Same bit sequence can represent different data types depending on context (e.g., 01000001 = 65 in decimal OR 'A' in ASCII)

Representation Limits & Errors

Fixed-bit integers: Limited range causes overflow when result exceeds maximum representable value.

Real numbers: Fixed bits cause roundoff errors—some real numbers stored as approximations only.

Language differences:

  • Some languages (like those on AP exam) use abstraction to represent integers limited only by memory
  • Others use fixed bits, creating strict limits

Test focus: Understand that bit limitations create errors; don't memorize specific ranges.

Data Compression: Lossless vs. Lossy

LosslessLossy
Reconstructs original data perfectlyReconstructs approximation only
Smaller reduction in sizeLarger reduction in size
Use when quality/accuracy criticalUse when minimizing size/time critical

Key principles:

  • Compression depends on redundancy in original data AND algorithm used
  • Fewer bits ≠ less information (context matters)
  • Lossy compression often produces smaller files than lossless compression, but not always.

The rest of the Unit 2 sheet

6 more sections are on the one-page PDF:

  • Binary ↔ Decimal Conversion

  • Extracting Information from Data

  • Scalability & System Capacity

  • Analog vs. Digital Data

  • Data Challenges & Cleaning

  • Processing Data with Programs

Made by you

Visual Cheatsheets

Pick a Unit 2 topic and a format: flowchart, comparison chart, vocab sheet, Cornell notes and more. Ready in about a minute.

Printable PDF · from the Fiveable shop

AP Computer Science Principles Unit 2 Cheatsheet

1 page · Data · PDF

Visual Cheatsheets

One topic, the format you pick, ready in about a minute

Format

Topic

Takes 30–60 seconds

Preview: Standard

Unit 2: Data, topic by topic

Each topic has a full study guide. See the whole unit.