Full teaching narration is free with Private Starter.Create free account
Back to curriculum
Computer ScienceGrade 7· U.S. National — Common Core & NGSS
Aligned to:U.S. educational frameworks

Auditing a Rule-Based Algorithm for Fairness

Students trace a decision-making algorithm with sample inputs, identify rules that may produce unfair results, and revise the algorithm to better meet accuracy and fairness criteria.

Auditing a Rule-Based Algorithm for Fairness

Illustrations are auto-generated and may be placeholders. They can be refreshed to match the narration.

Full teaching narration is included free with a Private Starter account.Create free account

How Rule-Based Algorithms Decide

A rule-based algorithm follows a fixed sequence of instructions to turn inputs into an outcome. Imagine a school has a limited number of laptops to lend. Its algorithm uses three inputs: whether an application arrived by Friday, whether the student’s attendance is at least 95 percent, and whether the student has a computer at home. It first rejects late applications. Next, it rejects applicants with attendance below 95 percent. Finally, it approves applicants who do not have a home computer. These rules make decisions consistent, but consistency alone does not guarantee accuracy or fairness. An accurate algorithm should identify students who need reliable computer access. A fair algorithm should give students a reasonable opportunity to qualify and should not use unrelated circumstances against them. People must examine the rules, the information they use, and the outcomes they produce.

A flowchart shows three inputs moving through laptop application rules to an approval or denial outcome.
A flowchart shows three inputs moving through laptop application rules to an approval or denial outcome.Source: Illustrated for this lesson

Trace the Algorithm

To trace an algorithm, follow every instruction in order and record what happens at each step. Do not skip a rule or change its meaning. Consider Maya, who applied on Thursday, has 96 percent attendance, and has no computer at home. She passes the deadline rule, passes the attendance rule, and is approved because she lacks a computer. Now trace Jordan’s application. Jordan has 98 percent attendance and no computer, but the application arrived on Monday because the online form was unavailable at home. The algorithm stops at the first rule and denies the request. Elise applied on time and has no computer, but her attendance is 92 percent because of documented medical appointments. She is denied at the attendance rule. A trace makes the algorithm’s exact behavior visible, including outcomes that its designers may not have expected.

A trace table shows Maya, Jordan, and Elise moving through the deadline, attendance, and computer checks.
A trace table shows Maya, Jordan, and Elise moving through the deadline, attendance, and computer checks.Source: Illustrated for this lesson

Compare Outcomes

After tracing the cases, compare the outcomes with clear criteria. The accuracy criterion asks whether the algorithm gives laptops to students who lack reliable access for schoolwork. The fairness criterion asks whether students with similar needs have a similar chance to receive help. Maya, Jordan, and Elise all lack home computers, so all three have strong need. However, only Maya is approved. Jordan’s late form and Elise’s attendance cause different outcomes even though neither fact changes their need for a laptop. Also consider Devon, who technically has a computer at home but must share it with four family members. The algorithm denies Devon because it treats any home computer as reliable access. Comparing cases shows both false denials and missing information. Fairness does not always mean identical outcomes; it means that differences in outcomes should be connected to relevant, consistently applied reasons.

A comparison chart shows the four students' computer access needs beside the algorithm's approval and denial outcomes.
A comparison chart shows the four students' computer access needs beside the algorithm's approval and denial outcomes.Source: Illustrated for this lesson

Identify Unfair Rules

A rule may be unfair when it uses information unrelated to the decision’s purpose or creates an avoidable barrier. The attendance rule is questionable because illness, disability, transportation problems, or family responsibilities can lower attendance without reducing a student’s need for a computer. The online deadline can disadvantage students who lack internet access, which is the same problem the laptop program is meant to address. The home-computer question is too simple because owning a shared or broken device is not the same as having reliable access. Auditors should listen to affected students and families because their perspectives can reveal barriers designers missed. Fair participation also reflects civic principles: people should have a meaningful opportunity to request a public-school resource and ask for a decision to be reviewed. Auditors should focus on relevant evidence rather than assumptions about individuals or groups.

A barrier diagram shows how the attendance rule, online deadline, and home-computer question can block students with genuine need.
A barrier diagram shows how the attendance rule, online deadline, and home-computer question can block students with genuine need.Source: Illustrated for this lesson

Revise and Test the Algorithm

A revised algorithm should better match the program’s purpose while respecting the limited laptop supply. First, accept requests online, on paper, or verbally and provide a correction period for missed information. Second, ask whether the student has reliable access to a working device for school assignments. Do not use attendance because it is not evidence of computer access. Third, rank applicants by relevant need: no reliable device first, limited or shared access second, and dependable personal access third. If there are not enough laptops for students at the same need level, use a documented random lottery and create a waiting list. Testing the revision changes the sample outcomes. Maya, Jordan, and Elise enter the highest-need group despite deadline or attendance differences. Devon enters the shared-access group. Auditors can repeat the same test cases, compare both versions, and check whether the revision improves accuracy and fairness without exceeding the laptop supply.

A revised flowchart sorts the four students by reliable device access and sends tied applicants to a lottery and waiting list.
A revised flowchart sorts the four students by reliable device access and sends tied applicants to a lottery and waiting list.Source: Illustrated for this lesson