Unit 4 · 12 min
4.1 Ethical and Social Issues Around Data Collection
Good code with bad data still gives bad answers, and personal data always needs protecting.
Summary, objectives and course and exam description (CED) codes
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.
By the end of this session you can
- 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.
Reviewed against the CED on
1LearnThe notes, the traps and how to remember them
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.
Lock it in: memory hooks
- PrivacyCollect less, protect more: data you never store can never leak.
- Algorithmic biasSystemic, repeated, unfair: bias is not one bad result, it is the same error hitting the same group again and again.
- Data qualityGarbage in, garbage out: missing or wrong values make a correct algorithm give wrong answers.
- Right data setRight question, right data: a data set answers the question it was built for.
Common misconceptions
"If a program only stores data, it cannot harm anyone."
Not quite. 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.
"A computer program is objective, so its results cannot be unfair."
Not quite. 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.
"More data always means better answers."
Not quite. 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.
Exam traps
- Algorithmic bias is about unfair outcomes for a specific group, not about a single random bug.
- A survey answered only by volunteers, or only by one group, has a biased collection method even if every answer is accurate.
- A question asks for the most appropriate data set: pick the one that matches the exact question, population and time period, not the biggest one.
2PracticeRecall it, then check yourself
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.
Cover this list, say the points out loud, then take the checkpoint without scrolling back up.
Checkpoint · 5 questions
Checkpoint: Ethical and Social Issues Around Data Collection
Pick an answer to mark it. Every answer is explained, and you can try any question again. Your saved score counts first tries only, and stays in this browser.
3PrevailLock it in for exam day
By the numbers
- Data quality checks before you use a data set four checks CED 4.1.B.2, 4.1.B.3, 4.1.C.1
- How was it collected, and could that method bring bias?
- Is it complete?
- Is it accurate?
- Was it made for the question you are asking?
- What bad data can do to a program two effects CED 4.1.B.3
- the program works incorrectlywrong results
- the program works inefficientlywasted time or resources
Key terms: flip the cards
Read the term, say the definition out loud, then flip to check. Struggling a little to remember is what makes it stick.
-
Data settap to flip
A collection of specific pieces of information or data, such as a week of temperatures or a list of scores.
Example and CED codes -
Bias in datatap to flip
Bias that comes from how data is collected or used; algorithmic bias is systemic, repeated errors in a program that create unfair outcomes for a specific group.
Example and CED codes
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.