# AP® Computer Science A 4.1 Ethical and Social Issues Around Data Collection

Source: https://lockincs.com/ap-csa/unit-4/4-1-ethical-and-social-issues-around-data-collection/  
Last reviewed against the College Board Course and Exam Description (CED): 2026-11-12  
CED codes: 4.1.A, 4.1.A.1, 4.1.B, 4.1.B.1, 4.1.B.2, 4.1.B.3, 4.1.C, 4.1.C.1

Collecting and storing personal data puts the privacy of users at risk, so programmers should design programs that safeguard it. A program is only as good as its data: a biased collection method, incomplete or inaccurate values, or a data set made for a different question can all lead to wrong or unfair results.

## What you will learn

- 4.1.A Explain the risks to privacy from collecting and storing personal data on computer systems.
- 4.1.B Explain why it is important to recognize data quality and possible issues when using a data set.
- 4.1.C Identify a data set that is appropriate for solving a given problem or answering a specific question.

## 1\. Personal data is a privacy risk

Every time someone uses a computer, an app or a website, personal data can be collected: names, locations, contacts, search history, health or school records. Once this data is stored on a computer system, the person’s privacy is at risk 4.1.A.1. Stored data can be stolen in a data breach, shared with other companies, or combined with other data to reveal more than the user ever agreed to share.

Programmers make choices that decide how big that risk is. When you develop a new program, you should try to safeguard the personal privacy of the user 4.1.A.1:

-   **Collect only what you need.** A fitness app that counts steps does not need the user’s contact list.
-   **Protect what you store.** Keep personal data away from places where other users or programs can read it.
-   **Keep it only as long as needed.** Old data that is deleted cannot leak.
-   **Be honest with users.** Tell them what is collected and why.

**Watch out:** “The data is only stored, not shared” does not make it safe. Storage itself is the risk.

## 2\. Algorithmic bias

Algorithmic bias describes systemic and repeated errors in a program that create unfair outcomes for a specific group of users 4.1.B.1. “Systemic” means the error comes from how the program or its data is built, so it happens again and again to the same group.

Example: a face-unlock feature is trained mostly on photos of adults. It works well for adults but often fails for children. The program has no single “bug” line, yet it keeps treating one group of users unfairly. The cause is the data used to build it.

| Feature | One random error | Algorithmic bias |
| --- | --- | --- |
| How often? | Once, by chance | Repeated |
| Who is affected? | Anyone | A specific group of users |
| Where it comes from | A slip in one run | The design or the data (systemic) |

## 3\. How was the data collected?

Before you use a data set to extrapolate new information or draw conclusions, you should know how the data was collected and whether that method could bring bias 4.1.B.2.

A school wants to know how students travel to school. Compare two collection methods:

| Collection method | Possible bias |
| --- | --- |
| An online form shared only in the cycling club group chat | Cyclists are over-represented, so “most students cycle” would be a biased conclusion. |
| A short question asked to every student at the start of first lesson | Everyone has the same chance to answer, so the result is much more representative. |

Every answer in the first data set may be true, but the method still produces a biased picture.

## 4\. Incomplete and inaccurate data

Some data sets are incomplete (values are missing) or inaccurate (values are wrong). If a program is developed or used with such data, it can work incorrectly or inefficiently 4.1.B.3.

In this example, a weather station failed on one day and stored `-999.0` as a “missing” marker. The program averages the readings without knowing that.

```
double day1 = 21.5;
double day2 = 23.0;
double day3 = -999.0;   // sensor failed; this is not a real temperature
double day4 = 22.5;

double average = (day1 + day2 + day3 + day4) / 4;
System.out.println("Average temperature: " + average);
```

Output:

```
Average temperature: -233.0
```

The algorithm is correct, but the inaccurate data makes the answer useless. A program can also become inefficient with bad data, for example by processing thousands of duplicate records.

**Watch out:** when a question describes missing values, typing errors or duplicate records, the expected answer is usually that the program may produce incorrect results.

## 5\. Choosing the right data set

The contents of a data set are usually related to a specific question or topic. A data set collected for one question might not give correct answers, or support extrapolation, for a different question 4.1.C.1.

Question: “Which hour of the day is busiest at a city library?”

| Data set | Appropriate? | Why |
| --- | --- | --- |
| Library entrance gate counts, by hour, for the last year | Yes | It measures visits per hour at that library. |
| Number of books borrowed per month | No | Monthly totals cannot show hours, and borrowing is not the same as visiting. |
| Gate counts, by hour, from a different city’s library | No | It is about a different library, so it cannot answer the question for this one. |
| A survey asking residents their favorite book | No | It is about a different topic. |

To choose, check that the data set matches the question’s topic, place (population) and time period, and that it measures the thing the question asks about.

## Common mix-ups

- Not true: If a program only stores data, it cannot harm anyone. Stored personal data can leak, be shared or be combined with other data. Every stored detail is a privacy risk, so programmers should collect only what the program needs and protect it.
- Not true: A computer program is objective, so its results cannot be unfair. Algorithmic bias is real: systemic and repeated errors in a program can create unfair outcomes for a specific group of users, often because of how the data was collected.
- Not true: More data always means better answers. A huge data set that is biased, incomplete, inaccurate or about a different question still gives wrong answers. Quality and fit matter more than size.

## In 30 seconds

- Using a computer puts personal privacy at risk; programmers should safeguard the personal privacy of users.
- Algorithmic bias is systemic and repeated errors in a program that create unfair outcomes for a specific group of users.
- Know how a data set was collected, and the bias that method can bring, before drawing conclusions from it.
- Incomplete or inaccurate data can make a program work incorrectly or inefficiently.
- A data set built for one question may not give correct answers for a different question.

## Checkpoint: 5 practice questions

### Question 1

A homework app only needs each student's name to share assignments, but its programmers also store every student's home address and location history. Which of the following best describes the main problem with this design?

- A. Unneeded personal data is stored and could be exposed or misused
- B. The app will run more slowly because addresses are long strings
- C. Storing data has no privacy risk as long as the program has no bugs
- D. Location history is not personal data, so only the addresses are a risk

**Answer: A.** Storing personal data puts users' privacy at risk, and programmers should safeguard it, for example by collecting only what the app needs. Speed is not the issue here, a bug-free program can still leak or share stored data, and location history is personal data.

### Question 2

A loan program gives lower scores, again and again, to applicants from one neighborhood, because that neighborhood was barely represented in the past data used to build the program. Which term best describes this?

- A. A logic error that affects all users equally
- B. Algorithmic bias
- C. A privacy risk from storing personal data
- D. A syntax error found by the compiler

**Answer: B.** Algorithmic bias is systemic and repeated errors in a program that create unfair outcomes for a specific group of users, which is exactly what happens here. The error does not affect all users equally, it is not about storing private data, and a syntax error would stop the program from compiling at all.

### Question 3

A city wants to know how all of its residents travel to work. It collects data with an online survey shared only on a cycling club's website. Which of the following is the most important concern before drawing conclusions from this data?

- A. The survey has too few questions to be useful
- B. Online surveys cannot store travel times accurately
- C. The collection method over-represents cyclists, so results may be biased
- D. An average cannot be computed unless every resident responds

**Answer: C.** Programmers should know how a data set was collected and the bias that method can bring. Only cycling club visitors were likely to answer, so cyclists are over-represented. The number of questions and the storage format are not the issue, and an average can be computed from any number of responses; the problem is who responded.

### Question 4

A fitness data set records each day's step count. On days when the device was not worn, the value 0 was stored instead of leaving the day out. A program computes the average number of steps per day from every value. Which of the following is the most likely result?

- A. The program does not compile because the data contains zeros
- B. The average is correct, because adding 0 does not change the sum
- C. The program throws an exception when it reads a 0
- D. The average is lower than the true average for the days the device was worn

**Answer: D.** Inaccurate data can make a program work incorrectly. The zeros do not change the sum, but they are counted as days, so the sum is divided by too many values and the average is too low. Data values do not affect compiling, and reading a 0 is not an error.

### Question 5

A student wants to answer the question "Which month had the most rainfall in my town last year?" Which of the following data sets is most appropriate?

- A. Daily rainfall amounts for the student's town for every day of last year
- B. Average yearly rainfall for every country in the world
- C. Daily temperatures for the student's town for every day of last year
- D. Daily rainfall for a city on another continent for every day of last year

**Answer: A.** A data set answers the question it was collected for. Only the first one measures rainfall, in that town, in that year, by day (so it can be grouped by month). The yearly country averages cannot show months, temperature is a different topic, and another city's rainfall does not answer the question for this town.

## Questions students ask

**What is algorithmic bias in AP® Computer Science A?**

Algorithmic bias describes systemic and repeated errors in a program that create unfair outcomes for a specific group of users. It often comes from biased or incomplete data used to build or test the program.

**How can a programmer protect user privacy?**

Collect only the personal data the program really needs, store it securely, avoid sharing it, and delete it when it is no longer needed. The goal is to safeguard the personal privacy of every user.

**Is topic 4.1 tested with code on the AP® exam?**

Topic 4.1 is about reasoning, not syntax. Expect questions that ask you to explain a privacy risk, spot a biased collection method or choose the data set that fits a question.

**What makes a data set inappropriate for a question?**

It may be about a different topic, population or time period, so it cannot give correct answers or support conclusions about the question you are asking.

---

© LockInCS, licensed CC BY-NC-ND 4.0. AP® is a trademark registered by the College Board, which is not affiliated with, and does not endorse, this website.
