AP Computer Science Principles – Unit 2.3
Data Collection & Visualization – Class Notes
1. What Is Data Collection?
Data collection is the process of gathering information so it can be analyzed and used to make decisions.
In computer science, data is collected from many sources, such as:
- Sensors (temperature, motion, light)
- Surveys and forms
- Websites and apps
- Social media interactions
- Transactions and purchases
- Scientific experiments
- Simulations
Why it matters: Modern computing relies on data to understand behavior, solve problems, and design better systems.
2. Why Do We Collect Data?
Data helps us:
- Identify patterns
Example: Students study more on Sundays; website traffic peaks at noon.
- Find trends
Example: Temperature rising over decades → climate patterns.
- Make predictions
Example: A store predicts what products will sell during holidays.
- Improve decision-making
Example: Apps recommend movies based on your past preferences.
- Automate tasks
Example: A thermostat adjusts temperature based on collected data.
3. Identifying Patterns and Trends
Patterns and trends are the key outcomes of data analysis:
A. Patterns
A pattern is a repeated or predictable form in the data.
Examples:
- People buy more hot drinks in winter.
- Students log in to an app mostly in the evening.
- Traffic sensors show morning and afternoon rush hours.
B. Trends
A trend is a change in data over time.
Examples:
- A steady rise in gas prices.
- More people using mobile devices each year.
- Decrease in energy usage during weekends.
Why They Matter in CSP
Patterns and trends help computer scientists:
- Understand behaviors
- Design better algorithms
- Optimize user experience
- Predict future outcomes
4. Data Visualization
Data visualization means turning data into pictures so it’s easier to understand.
Visualization helps us:
- Spot trends quickly
- Compare information
- Communicate results clearly
- Identify outliers or errors
Good visualizations can reveal things that raw data cannot.
5. Tools for Data Visualization
A. Charts
Charts make numbers easier to understand. Common types:
| Chart Type |
Best For |
| Bar Chart |
Comparing categories |
| Line Graph |
Showing change over time |
| Pie Chart |
Showing percentages of a whole |
| Histogram |
Showing distribution of data |
| Scatter Plot |
Showing relationships between two variables |
B. Graphs
Graphs show relationships between data points.
Examples:
- Tracking fitness data (steps vs. time)
- Graphing temperature changes
- Visualizing network connections
C. Simulations
Simulations model real-world processes when collecting actual data is too expensive, dangerous, or slow.
Examples:
- Predicting hurricanes
- Modeling population growth
- Flight simulators
- Disease spread simulations
Benefits of simulations:
- Safe
- Cheap
- Repeatable
- Can test many scenarios quickly
6. Using Visualization to Make Decisions
Visualization helps users and organizations:
- Detect problems early
- See trends that affect planning
- Make informed choices
- Communicate results to others (teachers, managers, teammates)
Example: A school visualizes student performance data and sees a drop on Fridays, so they adjust homework due dates.
7. Key AP Exam Takeaways
- Data must be collected, cleaned, and visualized to be useful.
- Patterns and trends help support claims, arguments, and predictions.
- Visualizations (charts/graphs/simulations) help us understand large data sets.
- Computers are essential because data sets are often too large for humans to analyze manually.