Extracting Information from Data
AP Computer Science Principles · Unit 2 — Data
Data, information, metadata and the limits of a data set
Data are recorded values; information is what we learn from them. A program turns data into information by finding patterns, trends and answers to questions. The same data set can answer some questions well and others not at all, and the exam tests whether you can tell which.
Metadata are data about data. For a photo, the image itself is the data; the date taken, location, camera model and file size are metadata. Metadata help find, organise and manage data, and changing or deleting metadata does not change the primary data. A question can be answered "using only metadata" only if every piece of information it needs appears in the metadata fields.
Before analysis, data often need cleaning: making the data uniform without changing their meaning. Typical problems are inconsistent formats ("Ben Thanh" and "ben thanh"), duplicate records, missing values, and impossible values such as a negative ride duration. Cleaning is not the same as deleting data you dislike; each change should be justified by the meaning of the data.
Three limits are always present. Bias: if the way data were collected excludes some groups, no amount of data from the included groups removes the bias. Correlation does not imply causation: two variables that rise together may both be driven by a third variable, so additional research is needed to establish cause. Incomplete data: a data set cannot answer a question about a variable it never recorded.
How programs process data
Programs let people process data sets far too large to handle by hand. The framework names the operations you should recognise in a description or a code segment:
- Filter: keep only the records that satisfy a condition (rides in June; temperatures above 30).
- Transform: compute a new value from each element (convert minutes to hours; subtract a baseline from every reading).
- Combine: join data sets on a shared field (attach each day's weather to that day's rides) or aggregate many values into one (sum, average, count, maximum).
- Visualise: produce charts, maps or tables that make a pattern visible.
Tables and spreadsheets support these operations directly, and the exam's pseudocode expresses them with lists: a filter is an IF inside a loop that appends to a new list; a transform appends a computed value; an aggregate updates an accumulator. When a data set grows beyond what one computer can process in reasonable time, the work is split among many computers — the scalability of a system describes how well it handles that growth.
When you read a question about a data set, list the fields that exist, then check each proposed question: does it need a field that is missing? Does it need the data to be cleaned first? Does it claim a cause when the data only show an association?
Worked example: Soát bảng dữ liệu trước khi phân tích
A bike-share company exports the table below (hypothetical data).
| ride_id | date | station | minutes | member |
|---|---|---|---|---|
| 1041 | 2026-06-02 | Ben Thanh | 18 | yes |
| 1042 | 2026-06-02 | ben thanh | -4 | no |
| 1043 | 2026-06-03 | Thu Thiem | yes | |
| 1041 | 2026-06-02 | Ben Thanh | 18 | yes |
(1) List every cleaning problem in the four rows. (2) Can the company use this table to find the average ride length at each station in June? (3) Can it find whether riders who are members are more satisfied than non-members?
Solution
(1) Bốn vấn đề: tên trạm không thống nhất (“Ben Thanh” và “ben thanh” là một trạm); thời lượng −4 phút là giá trị vô lý; chuyến 1043 thiếu thời lượng; dòng thứ tư trùng hoàn toàn với dòng đầu (cùng ride_id 1041). Xử lý: thống nhất tên trạm, xoá bản ghi trùng, đánh dấu hoặc loại khỏi phép tính trung bình hai dòng có thời lượng âm/trống — và ghi lại đã loại bao nhiêu dòng.
(2) Được, sau khi làm sạch: lọc theo date tháng 6, gom theo station, lấy trung bình minutes. Mọi trường cần đều có mặt.
(3) Không. Bảng không có trường nào đo mức hài lòng; biết ai là hội viên không cho biết họ hài lòng hơn hay không. Muốn trả lời phải thu thêm dữ liệu (ví dụ khảo sát sau chuyến đi), và khi thu cũng phải tránh chỉ hỏi những người dùng ứng dụng thường xuyên.