Grade by Grade
D. Topics in Computer Science · Topics in Computer Science: Sustainability, Ethics, Emerging Technologies and Careers

Ethics of Artificial Intelligence: Bias, Accountability and Regulation

D2.1 D3.1About 75 minutes
Learning goals
  • I can explain how bias, proxy variables, feedback loops and opacity cause harm in AI systems.
  • I can calculate selection rates and true positive rates by group and interpret a fairness audit.
  • I can describe, with dates, how the EU, Canada and Ontario were regulating AI as of October 2026.
  • I can analyse the impact of an AI system on different members of society.

Words to know

algorithmic bias
Systematic unfairness in a model's outputs toward certain people or groups.
proxy variable
A feature closely linked to a sensitive attribute that can carry the same bias.
feedback loop
A cycle in which a model's outputs change the data it later learns from, reinforcing its patterns.
selection rate
The fraction of a group that a model selects or approves.
true positive rate
Of the people who truly belong in the positive class, the fraction the model correctly selects.
deepfake
Realistic AI-generated or altered images, audio or video of real people.
risk-based regulation
Rules whose strictness depends on how much harm a system could cause.

Decisions made by models

Artificial intelligence now helps decide which job applicants get interviews, which loan applications are approved, which posts you see, and what a chatbot tells you. In Grade 11 (ICS3U, Artificial Intelligence, Machine Learning and Data Mining) you built a nearest-neighbour classifier and met bias and privacy as issues. This lesson analyses AI ethics in depth (D2.1) and looks at the impact of AI on society (D3.1), including how governments are responding, with dates, because this area changes month by month.

Where harm comes from

  • Biased training data. A model learns patterns from past data. If past hiring favoured one group, a model trained on it can learn to favour that group too.
  • Proxy variables. Removing a sensitive attribute (such as gender) doesn't remove bias if other features (such as certain hobbies or postal areas) are strongly linked to it.
  • Feedback loops. If a model sends more inspections to one neighbourhood, more problems are found there, which "confirms" the model.
  • Opacity. Complex models can be hard to explain, so people can't challenge decisions about them.
  • Generative AI risks. Systems that produce text, images, audio and video can state false information confidently (often called "hallucination"), create convincing deepfakes of real people, and raise the copyright questions you met in Intellectual Property.
  • Wider impacts: changes to jobs, concentration of power in a few large companies, and the energy and water use of data centres from The Full Footprint of Computing.

Measuring fairness

Suppose a model screens job applicants and marks some as "interview". We know which applicants were actually qualified. Two common fairness checks compare groups:

  • Selection rate: the fraction of each group the model selects. Very different rates are called a disparity.
  • True positive rate (TPR): of the people who were actually qualified, the fraction the model selected. If qualified people in one group are selected far less often, the model is failing them.

Researchers have shown that when groups have different base rates, it is generally impossible to make several fairness measures equal at the same time, so choosing a fairness measure is an ethical decision, not just a technical one.

# (group, actually qualified?, model selected?)
results = [
("A", True, True), ("A", True, True), ("A", False, True),
("A", False, False), ("A", True, True),
("B", True, False), ("B", False, False), ("B", True, True),
("B", False, False), ("B", True, False),
]
def rates(group):
rows = [r for r in results if r[0] == group]
selected = sum(1 for g, q, s in rows if s)
qualified = [r for r in rows if r[1]]
qualified_selected = sum(1 for g, q, s in qualified if s)
return selected / len(rows), qualified_selected / len(qualified)
for g in ["A", "B"]:
sel, tpr = rates(g)
print(f"Group {g}: selection rate {sel:.2f}, true positive rate {tpr:.2f}")

Each tuple is one applicant. The generator expressions count matching rows.

Group A: selection rate 0.80, true positive rate 1.00
Group B: selection rate 0.20, true positive rate 0.33

Output of the program above (what Python prints).

Worked example

Example 1: Reading the fairness audit

Use the ten results in the program. (a) Find each group's selection rate and true positive rate by hand. (b) Is there evidence of unfairness? (c) Suggest two next steps.

  1. Group A has 5 people; the model selected 4 (rows 1, 2, 3, 5). Selection rate = 4 ÷ 5 = 0.80.
  2. Group A's qualified people are rows 1, 2 and 5 (3 people), and all 3 were selected: TPR = 3 ÷ 3 = 1.00.
  3. Group B has 5 people; only row 3 ("B", True, True) was selected: selection rate = 1 ÷ 5 = 0.20.
  4. Group B's qualified people: rows 1, 3 and 5 (3 people); 1 selected: TPR = 1 ÷ 3 ≈ 0.33.
  5. (b) Both groups have the same number of qualified people (3 of 5), yet qualified people in Group B are selected a third as often. That is strong evidence the model is unfair to Group B (with only ten people, we'd want more data to be sure).
  6. (c) Next steps: examine the training data and features for bias and proxies; test on a larger dataset; involve affected people; require human review of rejections; don't deploy until the gap is fixed and explained.

Group A: selection 0.80, TPR 1.00. Group B: selection 0.20, TPR 0.33. Equally qualified groups are treated very differently, so the model needs investigation before use.

A screening model's results by group (from the program)Group Aselection rate 80%qualified people selected 100%Group Bselection rate 20%qualified people selected 33%Both measures differ between groups, which is a warning sign worth investigating.
Selection rates (blue) and true positive rates (green) for the two groups in the program. Equally qualified people in Group B are selected far less often.

How governments are responding (as of October 2026)

European Union. The EU AI Act entered into force on August 1, 2024. It sorts AI systems by risk. Bans on "unacceptable-risk" practices (such as social scoring by public authorities) have applied since February 2, 2025, and obligations for providers of general-purpose AI models since August 2, 2025. In 2026 the EU adopted amendments (the "Digital Omnibus on AI", Regulation (EU) 2026/1744) that delayed most high-risk obligations: to December 2, 2027 for systems listed in Annex III (such as AI used in hiring, education and credit) and to August 2, 2028 for AI in products covered by other EU safety laws. The amendments also added bans, from December 2, 2026, on AI systems that generate sexual images of real people without consent and child sexual abuse material.

Canada. The proposed Artificial Intelligence and Data Act (part of Bill C-27) died when Parliament was prorogued on January 6, 2025. Canada still has no comprehensive AI law. Instead:

  • a Voluntary Code of Conduct on the responsible development and management of advanced generative AI systems (2023);
  • the Canadian AI Safety Institute, launched in November 2024;
  • the federal Directive on Automated Decision-Making, which applies to federal government institutions;
  • a national AI strategy, "AI for All", released on June 4, 2026, which promises targeted laws on issues such as deepfakes and online safety, and more funding for the AI Safety Institute, rather than one comprehensive AI act;
  • Bill C-36 (introduced June 15, 2026, not yet law), which would give people a right to an explanation of automated decisions that significantly affect them.

Ontario. The Strengthening Cyber Security and Building Trust in the Public Sector Act, 2024 lets the province require public-sector organizations that use AI to be transparent, manage risks and provide human oversight in prescribed circumstances.

The EU AI Act's risk-based approach (simplified)Unacceptable risk: bannede.g. social scoring by authoritiesHigh risk: strict requirementse.g. AI in hiring, education, creditLimited risk: transparencye.g. chatbots, AI-generated content labelsMinimal risk: no new obligationse.g. spam filters, game AISeparate obligations apply to general-purpose AI models.
The EU AI Act's risk tiers, simplified. The higher the risk to people's safety and rights, the stricter the rules.
Just for fun

A machine-learning model walks into a café. The barista asks, "What can I get you?"

The model looks around and says, "What's everyone else having?"

Hands-on activity

Fairness audit of a toy model

You need: a computer with Python.

  1. Copy the fairness program. Add five more applicants to each group (make up whether each is qualified, and decide what the model predicts).
  2. Run it and record selection rates and true positive rates.
  3. Now pretend you are the developer. Change only the predictions (not who is qualified) to make Group B's true positive rate equal Group A's. What happened to the selection rates?
  4. Write a short memo to a manager: what the audit found, which fairness measure you think matters most for hiring and why, and what you recommend before deployment.

What to look for: correctly computed rates, recognition that fixing one measure can change another, and a recommendation that includes human review and better data, not just "tweak the numbers".

Your turn

1

Name three sources of harm in AI systems.

2

Define selection rate and true positive rate.

3

Why doesn't deleting the gender column guarantee a model is fair to all genders?

4

When did the EU AI Act enter into force, and when did its bans start to apply?

5

Does Canada have a comprehensive AI law as of October 2026? Explain.

6

What is a deepfake, and why is it an ethical issue?

More practice: warm-up

1

What does "hallucination" mean for a chatbot?

2

Name the four risk tiers of the EU AI Act.

3

When was Canada's national AI strategy, "AI for All", released?

4

A group has 10 people, the model selects 3. What is the selection rate?

5

Which federal directive governs automated decision systems used by federal institutions?

More practice: on your own

1

In a group, 8 people are qualified and the model selects 6 of them. It also selects 2 unqualified people out of 12. Find the TPR and the selection rate.

2

Explain a feedback loop using an AI system that recommends videos.

3

The Digital Omnibus delayed some EU high-risk rules. Give one argument for the delay and one against.

4

Why is choosing a fairness measure an ethical decision?

5

A school wants to use an AI tool to flag students 'at risk of failing'. List three questions you would ask before it is used.

Challenge

1

Modify rates so it also returns the false positive rate: of the people who were NOT qualified, the fraction selected. What are the values for groups A and B?

2

Analyse with the four lenses from Analysing Ethical Issues in Computing: a company replaces human customer-service agents with a chatbot.

3

Compare the EU and Canadian approaches to AI regulation as of October 2026 and argue which is better for a country like Canada.

Check your understanding

Quiz

1.

Of 10 qualified applicants in a group, a model selects 4. What is the true positive rate?

2.

Which statement about AI regulation in Canada is accurate as of October 2026?

3.

Under the EU AI Act as amended in 2026, when do most obligations for Annex III high-risk systems (such as AI in hiring) apply?

4.

What is a proxy variable?

5.

Why is choosing a fairness measure partly an ethical decision?

6.

Which is an example of AI "hallucination"?

For parents and teachers

Big idea: This lesson treats AI as an ethical issue (D2.1) and an emerging technology with wide social impact (D3.1). Students audit a toy model for fairness and learn how governments are responding, with dates.

How to help: Ask your teen to explain Example 1 to you: why is a gap in true positive rates between equally qualified groups a red flag? Discuss AI tools you see at work or in the news and ask who could be harmed if they are wrong.

Common difficulties:

  • Confusing selection rate (all people in a group) with true positive rate (only qualified people).
  • Assuming removing a sensitive column removes bias.
  • Treating proposed laws as passed. As of October 2026, Canada has no comprehensive AI law and Bill C-36 is not yet law; the EU's high-risk rules were delayed to 2027 and 2028.
  • AI regulation changes quickly; check dates before relying on any fact here.