Big Idea 2 — Data
How computers represent data with bits, how data is shrunk for storage and transmission, and how people and programs turn raw data into useful information. This Big Idea is worth 17–22% of the AP exam. Each section ends with a short practice set — click "Show answer" to check yourself.
Big Idea 1 — Creative Development
How computing innovations are made: working with others, understanding what a program does and why, following a design process, and finding and fixing mistakes. This Big Idea is worth 10–13% of the AP exam and also underpins the Create Performance Task. Each section ends with a short practice set — click "Show answer" to check yourself.
Binary Numbers
Computers store everything — numbers, text, images, sound — as a sequence of bits. A bit (binary digit) is either 0 or 1. A group of 8 bits is a byte.
- Binary (base 2) uses two digits; each position is a power of 2 (…, 16, 8, 4, 2, 1), unlike decimal (base 10).
- Abstraction — the same bits can mean different things (a number, a letter, a color) depending on how the program interprets them.
- Analog data varies smoothly and continuously (sound waves). Computers capture it by sampling — measuring at regular intervals — to get digital data. More samples means a closer match to the original.
| Place value | 8 | 4 | 2 | 1 | Decimal |
|---|---|---|---|---|---|
| 1011 | 1 | 0 | 1 | 1 | 8 + 2 + 1 = 11 |
| 1101 | 1 | 1 | 0 | 1 | 8 + 4 + 1 = 13 |
- n bits can represent 2n different values, from 0 up to 2n − 1. Adding one bit doubles the number of values.
- To represent N distinct items, you need enough bits so that 2n ≥ N.
- Overflow error — a result is too large for the fixed number of bits available.
- Round-off error — some real numbers (like 1/3 or 0.1) can't be stored exactly in binary, so the computer stores a close approximation.
- Examples of representation: text via ASCII/Unicode codes, images as pixels with red-green-blue values, sound as sampled amplitudes.
1. Convert binary 11001 to decimal.
Show answer
2. What is the minimum number of bits needed to give 100 students each a unique ID?
Show answer
3. A program stores a counter in 4 bits and adds 1 to the value 15. What happens?
Show answer
Data Compression
Data compression reduces the number of bits needed to store or transmit data. Smaller files save storage space and send faster over a network. There are two types:
| Type | How it works | Examples |
|---|---|---|
| Lossless | Original data can be perfectly reconstructed; no information is lost | ZIP, PNG, GIF, FLAC |
| Lossy | Discards some data permanently, so the original cannot be fully restored; usually a much smaller file | JPEG, MP3, MP4 |
- Trade-off — lossy gives smaller files but lower quality; lossless keeps quality but saves less space.
- Choose based on need: lossless for text, code, or medical images where every bit matters; lossy for streaming video or music where small quality loss is acceptable.
- Lossless compression often finds repeated patterns. Example — run-length encoding:
Original : AAAABBBCC (9 characters) Compressed: 4A3B2C (6 characters) // Decompressing gives back AAAABBBCC exactly, so this is lossless.
1. A photographer needs to keep an image exactly as captured so it can be edited later. Which compression type is better?
Show answer
2. Give one advantage and one disadvantage of lossy compression.
Show answer
3. Compress WWWWWWWXXY using run-length encoding.
Show answer
7W2X1YExtracting Information from Data
Data is raw values; information is the meaning and patterns drawn from it. Computing lets us find trends in datasets far too big for people to analyze by hand.
- Metadata — data about data (e.g. a photo's date, location, size, or author). It helps organize, find, and group data, and changing it doesn't change the main data.
- Big data — extremely large datasets that need computers (often many working together) to process.
- Correlation is not causation — two things changing together doesn't prove one causes the other.
- Data cleaning — fixing problems such as incomplete, duplicate, invalid, or inconsistent entries so results are accurate.
- Bias in data — a dataset that leaves out groups or is collected unfairly can lead to misleading conclusions.
- Combining data sources can reveal new insights (e.g. weather data plus sales data), but can also raise privacy concerns.
- Scalability — a solution that still works well as the amount of data grows.
1. A phone photo records the time and GPS location it was taken. What is this extra data called?
Show answer
2. Ice-cream sales and sunburn cases both rise in summer. Does this show that ice cream causes sunburn?
Show answer
3. A survey about a school's lunch menu only asks students in one grade. Why might the results be misleading?
Show answer
Using Programs with Data
Programs help us collect, store, process, and visualize data. Data can come from files, databases, sensors, websites, or user input, and programs let us work with it at scale.
| Operation | What it does | Example |
|---|---|---|
| Filtering | Keeps only items that meet a condition | Only scores of 70 or above |
| Searching / counting | Finds items or counts matches | How many orders came from Mumbai |
| Combining | Merges data from multiple sources | Join student names with test scores |
| Cleaning | Removes or fixes bad entries | Delete duplicate rows |
| Transforming | Changes format or computes new values | Convert Celsius to Fahrenheit |
passing <- []
FOR EACH score IN scores
{
IF (score >= 70)
{
APPEND(passing, score) // filtering
}
}
DISPLAY(LENGTH(passing)) // counting
- Tools — spreadsheets, databases, and programs can all be used to analyze data; programs are best for large or repeated tasks.
- Visualizations (charts, graphs, tables) make patterns easier to see and communicate.
- Challenges — data can be messy, huge, biased, or in different formats; cleaning and checking it is a major part of the work.
- Privacy and security — collecting and combining personal data must be done responsibly.
1. A program removes all rows with missing values from a survey file. Which operation is this?
Show answer
2. Why is a program better than a person for analyzing a dataset of 10 million records?
Show answer
3. Why might a bar chart help when sharing results of a data analysis?