AP CSP Algorithmic Bias
AP CSP Algorithmic Bias: Complete Guide (2025‑2026)
Algorithmic bias occurs when a computer algorithm produces systematically unfair or discriminatory outcomes for certain groups. Bias can enter through training data that reflects historical inequalities, data that underrepresents some populations, or through the assumptions baked into the algorithm’s design. Algorithmic bias is a key AP CSP topic because computing algorithms are increasingly used to make high-stakes decisions about hiring, lending, criminal justice, and healthcare.
Contents
Sources of Algorithmic Bias
Bias usually enters through data, not code. An algorithm that accurately learns from biased historical data will faithfully replicate that bias at scale.
A tech company builds an AI resume screener trained on 10 years of hiring data. The company historically hired mostly men for technical roles. The AI learns patterns associated with successful hires.
How does this algorithm become biased even though the engineers never intended it to be biased?
The algorithm learns that certain features correlate with past hires: attended certain schools, have certain hobbies, use certain language patterns. These correlations reflect historical hiring patterns that favored men. The algorithm penalizes resumes that mention women’s sports teams or clubs with female-dominated membership, because such applicants were rarely hired historically. The engineers never wrote ‘downrank women;’ but the algorithm learned this pattern from data. The bias is in the training data, not the code.
Real-World Examples
- Trained predominantly on lighter-skinned faces
- Higher error rates for darker-skinned individuals
- Error rate disparity documented in research
- Deployed in law enforcement and security
- Has led to documented wrongful arrests
- Trained on historical arrest patterns
- Historical over-policing of certain neighborhoods
- Algorithm recommends more policing in same areas
- Creates self-fulfilling feedback loop
- More arrests → more training data → more predictions
Harms and Accountability
A bank uses an algorithm to decide who gets approved for loans. The algorithm uses ZIP code as a feature. Certain ZIP codes have predominantly minority populations. Applicants from those ZIP codes are denied at higher rates.
Is this bias? Who is harmed? Who is responsible?
Yes, this is algorithmic bias. ZIP code is a proxy for race — using it introduces racial disparities in lending decisions, which may constitute discrimination even if race is never explicitly used. Harms: qualified applicants are denied credit, reducing wealth-building opportunities for already-disadvantaged communities; the bank reinforces historical redlining patterns. Responsibility: the engineers who chose the features, the managers who approved the system, and the organization deploying it. The AP CSP exam emphasizes that developers have responsibility to test for bias across subgroups, not just overall accuracy.
Common Exam Pitfalls
Most biased algorithms were not designed to be biased. The harm is real regardless of intent. The AP exam focuses on how bias enters and how to detect/prevent it.
An algorithm can be 95% accurate overall but 70% accurate for one demographic group. Group-level accuracy disparities are the key measure of bias.
Proxy variables (ZIP code, school attended, hobbies) can encode the same information. Removing race from inputs does not guarantee a race-neutral outcome.
An algorithm that over-predicts risk for a group leads to actions (more policing, loan denials) that generate data that further confirms the prediction. The bias compounds over time.
Check for Understanding
1. Algorithmic bias most commonly originates from:
- Intentional discrimination by programmers.
- Training data that reflects or amplifies historical human biases.
- Errors in mathematical calculations within the algorithm.
- Insufficient computing power to process data accurately.
2. A facial recognition system has a 99% accuracy rate overall but a 75% accuracy rate for darker-skinned faces. This is:
- Acceptable — 99% overall accuracy is excellent.
- An example of algorithmic bias — the algorithm performs significantly worse for a demographic group.
- Not bias because it is not intentional.
- Unavoidable due to technical limitations.
3. A hiring algorithm never uses gender as an input feature. However, it penalizes resumes that list women’s sports teams. This is:
- Not bias because gender is not in the input data.
- Bias through proxy variables — women’s team membership encodes gender indirectly.
- Acceptable because the algorithm treats all hobbies equally.
- A programming error, not algorithmic bias.
4. Consider: I. Removing race from an algorithm’s inputs guarantees a race-neutral outcome. II. Bias in training data can cause an algorithm to perpetuate historical discrimination. III. Algorithmic bias is always the result of intentional discrimination.
- I only
- II only
- I and III only
- I, II, and III
5. A predictive policing algorithm recommends more police patrols in neighborhoods where more arrests have historically occurred. This may be problematic because:
- Algorithms should not be used by law enforcement.
- The algorithm creates a feedback loop: more patrols → more arrests → more predictions of crime → more patrols.
- The algorithm cannot process geographic data accurately.
- Historical arrest data is always inaccurate.
6. What is the most effective way to test whether an algorithm is biased?
- Review the code for discriminatory logic.
- Analyze accuracy and error rates across different demographic groups.
- Ensure the training dataset is very large.
- Remove all personal information from the training data.
7. A loan approval algorithm uses ZIP code as a feature. ZIP codes in the training area correlate strongly with race due to historical residential segregation. This feature:
- Is acceptable because ZIP code is a neutral geographic variable.
- Introduces racial bias through a proxy variable, even though race is not explicitly used.
- Is not biased because the algorithm treats all ZIP codes identically.
- Only causes bias if the programmer intended it to.
8. Who bears responsibility for addressing algorithmic bias?
- Only the company’s legal team.
- Developers who build the algorithm, organizations that deploy it, and policymakers who regulate it.
- Only the individuals whose data was used for training.
- No one — algorithms make objective mathematical decisions.
9. A medical diagnosis algorithm is trained mostly on data from male patients. For which patients might this algorithm underperform?
- Older male patients only.
- Female patients, because the algorithm learned patterns predominantly from male physiology.
- Patients with rare conditions.
- All patients equally.
10. An algorithm’s designers argue: “We cannot be held responsible for bias because we did not intend to discriminate.” The strongest counterargument is:
- Intentions are what matter legally.
- The harm from biased outcomes is real regardless of intent, and developers have a responsibility to test for and mitigate bias before deployment.
- Any algorithm that is mathematically correct cannot be biased.
- Bias only matters when it affects a majority population.
How the AP Exam Tests This
- Identify the source of algorithmic bias in a given scenario (training data, proxy variables, feedback loops)
- Explain why removing a protected attribute does not guarantee unbiased outcomes
- Determine whether a described outcome constitutes algorithmic bias
- I/II/III: which statements about algorithmic bias are correct
- Describe a feedback loop created by a biased algorithm
FAQ
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]