AP Computer Science Principles

Unit 2 Review Notes
Binary, Data Compression, Extracting Information, and Using Programs

These notes are written as a review for AP CSP Unit 2. The goal is to help you understand the big ideas in a simple, student-friendly way.

1. What is Binary?

Computers do not think in English words or decimal numbers like people do. Computers use binary, which is a number system made of only two digits:

A binary digit is called a bit.

Why do computers use binary?

Because computer hardware is built from electronic parts that are usually in one of two states, such as:

Binary is a natural way for computers to store and process information.

2. Bits and Bytes

Bit

A bit is the smallest unit of data in computing.

Byte

A byte is 8 bits.

Common storage units:

More bytes = more storage needed.

3. Binary Numbers

In decimal, we use digits 0–9. In binary, we use only 0 and 1. Each place value in binary is a power of 2.

Binary Place Value 8 4 2 1
Binary Number 1 0 1 1

This equals:

Total = 11

1011₂ = 11₁₀

4. How Computers Represent Data

Computers use binary to represent many kinds of information, including:

Even though these seem very different, inside the computer they are all stored as bits.

Part A: Binary and Data Representation

5. Representing Text

Text is stored by giving each character a binary code. A system such as ASCII or Unicode gives each character a number, and that number is stored in binary.

Text is not stored as letters. It is stored as numbers that represent letters.

6. Representing Images

A digital image is made up of tiny dots called pixels.

A pixel is the smallest unit of a digital image. Each pixel stores information about color.

Image quality depends on:

More pixels usually means:

Resolution is the number of pixels in an image.

Better quality usually means a larger file size.

7. Representing Sound

Computers store sound by taking many measurements of a sound wave.

Sampling means a computer records sound by measuring it many times per second.

Sample Rate is how often the sound is measured.

Bit Depth also affects sound quality and file size.

Part B: Data Compression

8. What is Data Compression?

Data compression means reducing the size of a file so it needs less storage space or less bandwidth to send.

Compression helps:

9. Lossless Compression

Lossless compression reduces file size without losing any information. When the file is uncompressed, you get back the exact original file.

Examples:

With lossless compression, nothing is permanently deleted.

10. Lossy Compression

Lossy compression reduces file size by removing some data permanently.

This is often used for:

Trade-off: smaller file size, but possible loss of quality.

11. Compression Trade-Offs

Computing often involves trade-offs between:

Part C: Extracting Information from Data

12. What Does It Mean to Extract Information?

Raw data by itself is not always useful. People and computers often analyze data to find patterns, trends, or useful information.

This process is called extracting information.

13. Patterns and Trends

Computers can process data to discover:

Trend = a general direction in data over time

Pattern = something that repeats or appears regularly

Outlier = a value that is very different from the others

14. Visualization Helps

A data visualization is a chart, graph, or other display that helps people understand data more easily.

Examples:

A graph can help explain data, but it can also be misleading if it is poorly designed.

15. Correlation vs. Causation

Correlation means two things appear related.

Causation means one thing directly causes the other to happen.

Just because two things happen together does not mean one caused the other.

16. Problems with Data

Data is powerful, but it is not perfect.

Bad data can lead to bad conclusions.

17. Privacy and Data

Collecting and storing data can create privacy concerns.

Examples of personal data include:

If personal data is misused, people can be harmed.

Part D: Using Programs with Data

18. Programs Can Process Data

A program can:

19. Programs Use Input, Processing, and Output

This is a basic model for many programs.

20. Programs Can Automate Tasks

Automation means using a program to do repeated tasks automatically.

Programs can:

21. Programs Help Find Meaning in Data

A program can help answer questions like:

22. Using Lists and Data in Programs

A list is used to store multiple data values in one variable.

Programs can use lists to:

23. Filtering Data

Programs often filter data, which means selecting only the values that match a rule.

Example: From a list of scores, show only scores above 70.

24. Finding and Calculating with Data

Programs can perform common operations on data such as:

25. Why Using Programs Matters in AP CSP

In AP CSP, programs are useful because they help people:

Quick Review Summary

Binary

Images and Sound

Compression

Extracting Information

Using Programs

Key Vocabulary

Final Review Tips

  1. Why do computers use binary?
  2. How are text, images, and sound represented with bits?
  3. What is the difference between lossless and lossy compression?
  4. Why is compression useful?
  5. How can data be analyzed to extract useful information?
  6. What problems can happen with data collection?
  7. How do programs help people process and use data?