Define an algorithm, describe its characteristics, components and representations, explain efficiency and the main uses of algorithms, and evaluate dilemmas of bias, accountability, black boxes and human judgement.
Each is in the Digital Society glossary, with every other term in the subject.
A finite, ordered set of clear instructions that takes some input and produces an output, in order to solve a specific problem or perform a specific task.
The obligation of organisations that design or use algorithms to take responsibility for their outcomes, explain how decisions were reached, allow people to challenge them and correct any harm caused.
Systematic and repeatable errors in an algorithm's outputs that create unfair outcomes for particular people or groups, arising from its data, its design or the way it is used.
A measure of the resources, mainly the number of steps (time) and the amount of memory, that an algorithm uses to produce its output, especially as the amount of input data grows.
The aim that an algorithm's outcomes treat people and groups justly; there are several competing definitions, such as equal error rates or equal accuracy, which often cannot all be met at once.
Openness about the fact that an algorithm is used, what data it uses, how it works and how its outputs are applied, so that affected people and independent reviewers can understand and scrutinise it.
An algorithm that finds relationships between items, such as products often bought together or videos watched by similar users; the basis of many recommendation systems.
Define an algorithm and identify the characteristics that make a set of steps an algorithm: unambiguous, finite, with well-defined inputs and outputs, and feasible.
Describe the components of an algorithm: instructions, variables, conditionals and loops.
Distinguish between natural language, flowcharts, pseudocode, code and programming languages as ways of representing an algorithm, and describe a simple algorithm shown in each form.
Explain what efficiency means for an algorithm and compare the efficiency of a linear search and a binary search.
Outline the main uses of algorithms, from sorting, searching and filtering to machine learning and the creation of other algorithms.
Analyse how algorithmic bias, a lack of transparency, black box algorithms and the loss of human judgement affect people and communities.
Evaluate the use of algorithms to make decisions about people, with reference to real-world examples such as the 2020 grading algorithm in England.
An algorithm is a defined sequence of steps that solves a problem or completes a task. Algorithms decide which posts appear in a social media feed, which route a navigation app suggests, which loan applications a bank approves and, in 2020, which grades hundreds of thousands of school leavers in England received. Understanding what algorithms are, and how they can go wrong, is basic to understanding how a digital society works.
Algorithms are the instructions inside every digital system. They turn the data studied in 3.1 Data into decisions and actions, they run on the machines studied in 3.3 Computers, and they are the foundation of 3.6 Artificial intelligence. Because algorithms increasingly make or shape decisions about people, they are closely tied to the concepts of power (who designs them and who is judged by them), systems (how they interact with people and institutions) and values and ethics (whether their outcomes are fair). They appear in every context of the course, from health care triage to political news feeds.
With a free account, Augment remembers where you stopped and what you have practiced.
The tendency to over-rely on the output of an automated system, accepting its decisions or recommendations even when other information suggests they are wrong.
A searching algorithm for sorted lists that checks the middle item and discards the half that cannot contain the target, repeating until the item is found; each step halves the search.
An algorithm whose inner workings cannot be seen or understood by the people affected by it, either because it is kept secret or because, like a large neural network, it is too complex to explain.
An algorithm that places each item into one of several categories, such as spam or not spam, or a normal or suspicious payment.
A decision point in an algorithm that checks whether a condition is true and chooses which instructions to carry out next, usually written as IF... THEN... ELSE.
A characteristic of an algorithm: it can actually be carried out with the time, computing power, memory and data available.
A situation in which personalisation algorithms show people mainly content that matches their existing interests and views, so they encounter fewer different perspectives.
An algorithm that removes items that do not meet given criteria and keeps those that do, such as hiding emails marked as spam or search results above a price limit.
A characteristic of an algorithm: it always stops after a limited number of steps, with a clear end condition, rather than running forever.
A diagram that represents an algorithm with standard shapes joined by arrows: ovals for start and end, parallelograms for input and output, rectangles for processes and diamonds for decisions.
The data an algorithm starts with, which must be clearly defined, including what happens if the data is missing or invalid.
A single step in an algorithm that tells the computer to do one thing, such as store a value, compare two numbers or display a message.
A searching algorithm that checks each item in a list in turn, from the start, until it finds the target or reaches the end; it works on unsorted lists but is slow for large ones.
A component of an algorithm that repeats a block of instructions, either for each item in a collection, a set number of times, or while a condition remains true.
Ordinary human language, such as English or Spanish, used to describe an algorithm in a form anyone can read but which can be ambiguous.
The result an algorithm produces from its input, such as a route, a ranking, a category or a decision.
An algorithm that ranks items by importance or urgency so the most important come first, such as search results or emergency calls.
A formal language with exact rules of syntax, such as Python or JavaScript, used to write algorithms as programs that computers can carry out.
A structured, step-by-step description of an algorithm that resembles a programming language, using keywords such as IF and FOR EACH, but is written for people to read rather than for a computer to run.
An algorithm that predicts which items, such as videos, songs, products or posts, a user is likely to engage with, based on their past behaviour and that of similar users, and ranks them for display.
An algorithm that finds an item, or items that match a request, within a collection of data.
The order in which an algorithm's instructions are carried out, one after another; changing the order usually changes the result.
An algorithm that puts items into an order according to a rule, such as alphabetical, numerical, by date or by price.
An algorithm or program written in a programming language, which people can read and edit and which is translated into machine code before a computer runs it.
A way of describing how the number of steps an algorithm needs grows as its input grows, for example in step with the data (linear) or much more slowly (logarithmic).
A characteristic of an algorithm: every step has only one possible meaning, so anyone or any machine following it would do exactly the same thing.
A named storage place in an algorithm or program for a value that can change while it runs, such as a running total or the highest score so far.
An algorithm is a plan for getting from a starting point to a result. A cooking recipe, the instructions for assembling furniture and the long division method learned at school all share its basic shape: a fixed set of steps, carried out in order, that turns something given at the start into something wanted at the end. What makes algorithms central to digital society is that computers can follow them at enormous speed and scale, without tiring, millions of times a second.
The word comes from the name of Muhammad ibn Musa al-Khwarizmi, a ninth-century mathematician working in Baghdad whose books explained step-by-step methods for calculation. In 1843 Ada Lovelace published notes on Charles Babbage's planned Analytical Engine that included a method for the machine to calculate the Bernoulli numbers, often described as the first algorithm written for a machine.
An algorithm is an idea: the logic of how a problem is solved. A program is that idea written in a form a computer can carry out. The same algorithm for sorting names alphabetically can be written as a program in many different languages, or carried out by hand with index cards. A digital system, such as a music streaming app, combines many algorithms, the programs that implement them, the hardware that runs them, the data they use and the people who design, use and are affected by them. A phrase such as "the TikTok algorithm" therefore usually refers to a whole system of many algorithms, user data and constant adjustment by engineers.
Every algorithm can be described as an input–process–output model. The input is the data the algorithm starts with. The process is the sequence of steps. The output is the result it produces. A navigation app, for example, takes a starting point, a destination and live traffic data as input, processes them by comparing possible routes, and outputs the quickest route with an estimated arrival time, as the input–process–output diagram shows.

Thinking in inputs and outputs is useful for analysing any algorithm in society. When an algorithm produces a harmful outcome, the cause may lie in the input (poor or biased data), in the process (a flawed rule or design choice) or in how the output is used (treated as final when it should be checked by a person).
Not every set of instructions is an algorithm. Computer scientists list four characteristics that a set of steps must have. Each one guards against a different way that instructions can fail when a machine, which cannot use common sense, follows them.
An unambiguous instruction has only one possible meaning. "Add a pinch of salt" is ambiguous, because different cooks will add different amounts. "Add 2 grams of salt" is unambiguous. A computer cannot ask what was meant, so every step must say exactly what to do, including what happens in unusual cases, such as two students having the same score.
A finite algorithm stops after a limited number of steps. Instructions that can run forever, such as "keep checking the inbox until a message arrives" with no time limit, never produce an output if the event never happens. A finite algorithm has a clear end condition: it finishes when the task is done or when it is clear the task cannot be done, for example when a search reaches the end of a list without finding the item.
An algorithm must state what data it accepts and what it produces. A grade calculator might accept marks between 0 and 100 and output a grade from 1 to 7. Defining inputs also means deciding what happens to invalid data, such as a mark of 150 or a blank entry. Clear outputs allow people to check whether the algorithm has done its job.
A feasible algorithm can actually be carried out with the resources available: the time, the computing power, the memory and the data. An instruction such as "check every possible password" is precise and finite, but for a long password it would take longer than the age of the universe, so it is not feasible in practice. Feasibility also depends on the data existing: an algorithm that needs each applicant's future income cannot be carried out.
Characteristic | Question to ask | Example of a failure |
|---|---|---|
Unambiguous | Could any step be read in two ways? | "Choose the best candidate" with no definition of "best" |
Finite | Is it certain the steps will end? | A loop that repeats "until the user is happy" |
Well-defined inputs and outputs | Is it clear what goes in and what comes out? | A form that accepts dates in any format, so 03/04 could be March or April |
Feasible | Can it be done with real time, data and computing power? | Comparing every possible arrangement of 60 school timetable slots |
Writing the algorithm version also makes the school's values visible, because someone must decide what counts as deserving. Making instructions unambiguous forces people to turn values such as "deserving" or "risky" into measurable rules, and many algorithmic dilemmas begin at this step.
Almost every algorithm, from a recipe to a search engine, is built from four components: instructions carried out in a sequence, variables that store data, conditionals that make decisions and loops that repeat steps.
An instruction is a single step that tells the computer to do one thing, such as add two numbers, display a message or store a value. Instructions are carried out in sequence: one after another, in the order written. Changing the order usually changes the result. In a bank transfer, checking that the account has enough money must come before the money leaves it.
A variable is a named storage place for a value that can change while the algorithm runs. A fitness app might use a variable called steps that starts at 0 and increases each time the phone's sensor detects a step. Variables let an algorithm remember results along the way, such as a running total, the highest score so far or the position reached in a list.
A conditional is a decision point: the algorithm checks whether a condition is true and chooses what to do next. Conditionals are usually written as IF... THEN... ELSE. An online shop might use "IF the order total is at least 50 euros THEN delivery is free ELSE add a 4-euro charge". Conditionals give algorithms the ability to treat different cases differently, which is also how they can treat different people differently.
A loop repeats a set of instructions, either a fixed number of times or until a condition is met. A loop lets a short algorithm process huge amounts of data: the same few lines can check one email or a billion emails for spam. Every loop needs an end condition, which links back to the characteristic of being finite.
The four components work together in even the simplest real algorithm. The flowchart counts how many students in a class scored 50 or more on a test: a variable (count) starts at zero, a loop goes through each score, a conditional checks each one, and instructions add 1 to the count when the condition is true.

Component | What it does | Everyday example | Digital example |
|---|---|---|---|
Instruction (in sequence) | Carries out one action, in order | "Preheat the oven, then put in the tray" | Check the password, then open the account |
Variable | Stores a value that can change | The running score in a board game | The number of likes on a post |
Conditional | Chooses between paths | "If it rains, take an umbrella" | If a payment looks unusual, ask for a code |
Loop | Repeats steps | "Stir until the sauce thickens" | Check each new email for spam |
The same algorithm can be written down in several forms. Each form suits a different audience: the public, a design team or a computer.
Natural language is ordinary human language, such as English, Spanish or Mandarin. It is the easiest form for most people to read, which is why public bodies use it to explain how their algorithms work. Its weakness is ambiguity: words such as "about", "recent" or "suitable" can be read in different ways. The counting algorithm in natural language reads: "Start a count at zero. Look at each test score in turn. If the score is 50 or more, add one to the count. When every score has been checked, report the count."
A flowchart shows an algorithm as a diagram of standard shapes joined by arrows. Ovals mark the start and end, parallelograms show input and output, rectangles show processes and diamonds show decisions, each with "Yes" and "No" paths. Flowcharts make the structure easy to see, especially where the path branches or loops back. They become cluttered for large algorithms, so they are mostly used to plan or explain one part of a system.
Pseudocode is a structured, step-by-step description that looks like a programming language but is written for people, not computers. It has no fixed rules, but it uses keywords such as IF, THEN, FOR EACH and OUTPUT and indents the lines that belong inside a loop or a decision. The counting algorithm in pseudocode is:
count ← 0
FOR EACH score IN scores
IF score ≥ 50 THEN
count ← count + 1
END IF
END FOR
OUTPUT countThe arrow (←) means "store this value in the variable". The indentation shows that the IF statement sits inside the loop, so it runs once for every score.
Source code is an algorithm written in a programming language: a formal language with exact rules of spelling and grammar (called syntax) that a computer can translate into the binary instructions its processor carries out. The same counting algorithm in Python, a widely taught language, is:
count = 0
for score in scores:
if score >= 50:
count = count + 1
print(count)Programming languages differ in purpose. Python is popular for data analysis and machine learning, JavaScript runs inside web browsers, Swift and Kotlin are used for phone apps, and Scratch lets beginners build programs from visual blocks. Before the processor can run source code, a compiler or interpreter translates it into machine code.
Representation | Main audience | Strengths | Limitations |
|---|---|---|---|
Natural language | The public, users, decision-makers | Easy to read; no training needed | Ambiguous; long for complex logic |
Flowchart | Designers, learners, teams | Shows branches and loops visually | Cluttered for large algorithms |
Pseudocode | Designers and programmers | Precise yet language-neutral | No fixed standard; cannot be run |
Code in a programming language | Computers and programmers | Exact; can be run and tested | Hard for non-specialists to read |
Through the concept of expression, the choice of representation is also a choice about who can understand an algorithm. Code is precise but readable only by specialists; natural language is readable by everyone but loses precision. When governments or companies explain an algorithm only in vague natural language, or only by releasing code, many of the people affected cannot judge it for themselves.
YouTubeMany different algorithms can solve the same problem. The effectiveness of an algorithm is often judged by its efficiency: how much time and how many resources it uses to reach a correct output. An efficient algorithm reaches the answer in fewer steps or uses less memory, energy or data.
Efficiency is about growth. For ten items, almost any method is quick. For ten billion items, which is normal for a search engine or a social media platform, the difference between methods decides whether an answer arrives in a fraction of a second or not at all. Computer scientists describe this with time complexity: a way of stating how the number of steps grows as the input grows, without measuring seconds on a particular machine.
If doubling the data doubles the steps, the algorithm grows in step with the data (linear growth). If doubling the data adds only one extra step, the algorithm grows very slowly (logarithmic growth). If doubling the data multiplies the steps by four, it grows much faster than the data (quadratic growth), and it soon becomes impractical for very large data sets.
A searching algorithm finds an item in a collection. The simplest is a linear search, which checks each item in turn from the start until it finds the target or reaches the end. It works on any list, sorted or not. In the worst case, when the item is last or missing, it checks every item.
A binary search works only on a sorted list, but it is far faster. It checks the middle item first. If the middle item is too small, the target must be in the upper half, so the whole lower half is discarded; if it is too big, the upper half is discarded. Each check halves the part of the list still to be searched.
low ← 1
high ← length of list
WHILE low ≤ high
middle ← (low + high) ÷ 2, rounded down
IF list[middle] = target THEN
OUTPUT "found at position", middle
STOP
ELSE IF list[middle] < target THEN
low ← middle + 1
ELSE
high ← middle − 1
END IF
END WHILE
OUTPUT "not found"The gap grows quickly with the size of the list. A binary search of a sorted list of one million items needs at most 20 comparisons, because halving one million 20 times leaves a single item. A linear search of the same list may need one million. The graph shows how the worst-case number of comparisons grows for each method.
A binary search depends on the list being sorted, and sorting also takes work. A sorting algorithm puts items into order, such as alphabetical, numerical or by date. Simple methods such as bubble sort, which repeatedly swaps neighbouring items that are in the wrong order (5, 1, 4, 2 becomes 1, 4, 2, 5 after one pass), are easy to understand but slow for large lists, because the number of comparisons grows roughly with the square of the number of items. Faster methods such as merge sort split the list into small parts, sort them and merge them back together.
The choice between methods depends on the situation. A list searched once is quicker to check with a linear search; a list searched millions of times, such as a phone's contact list or a search engine's index, is worth sorting once so that every later search is fast. Judging efficiency always means asking how often the algorithm runs and on how much data.
Efficiency matters to people as well as to engineers. Faster algorithms use less electricity in data centres, make services usable on cheaper phones, and allow real-time decisions such as approving a card payment in under a second. Through the concept of change, efficiency gains explain why many tasks once done by clerks are now automated.
An efficient algorithm can still be a poor one. A credit-scoring algorithm that reaches a decision in milliseconds is efficient, but if it is inaccurate or unfair it is not effective. Speed can also remove the pauses in which people would notice and correct errors. Evaluating an algorithm in digital society therefore means weighing efficiency against accuracy, fairness, transparency and the cost of mistakes to the people affected.
Algorithms are used for a small number of basic tasks that combine to build complex systems. Most digital systems people use each day combine several of them: a music app searches its catalogue, filters out explicit songs for a child's account, classifies songs by genre, associates songs that similar listeners enjoy, prioritises a few for the home screen and counts every play to pay artists.
Sorting puts items into an order based on a rule: alphabetical, by price, by date, by distance. Sorting makes information usable (an inbox sorted by date) and makes other algorithms faster, as binary search shows. The rule chosen for sorting matters: an online shop that sorts by "featured" rather than by price chooses which products customers see first.
Searching finds items that match a request, from finding a word in a document (Ctrl+F) to a web search engine checking an index of hundreds of billions of pages in a fraction of a second. Searching algorithms underpin access to knowledge, linking them to the human knowledge context: what people can find shapes what they learn.
A filtering algorithm removes items that do not meet given criteria and keeps those that do. Filters can be chosen by users, such as showing only hotels under 100 euros with free cancellation, or applied by platforms, such as a content filter that blocks adult websites on a school network. Filtering shapes what people encounter, so it raises questions of power and expression: who sets the criteria, and what is removed without users knowing?
A prioritisation algorithm ranks items by importance or urgency so that the most important come first. Google's original PageRank algorithm, described by Sergey Brin and Larry Page in 1998, ranked web pages by treating links from other pages as votes, with votes from important pages counting more. In health care, the NHS 111 telephone service in England uses a set of clinical algorithms (NHS Pathways) to prioritise callers, deciding from their answers whether they need an ambulance, an urgent appointment or self-care advice.
A classification algorithm places each item into one of several categories. Email services classify each incoming message as spam or not spam; Google states that Gmail's filters block more than 99.9% of spam, phishing and malware. Banks classify card payments as normal or suspicious, and medical imaging software classifies scans as likely healthy or in need of review. Classifying and filtering often work together: an email is first classified as spam, then filtered into a separate folder.
An association algorithm finds relationships between items, such as products that are often bought together or videos watched by similar people. Amazon's "customers who bought this item also bought" feature, described by its engineers in 2003, links products by how often the same customers buy them. Association is the basis of the recommendation algorithm, which suggests content a user is likely to engage with.
TikTok's For You feed shows how far association can shape culture. TikTok has explained that the feed ranks videos using signals such as which videos a user watches to the end, likes, shares and comments on, along with information about the videos themselves. Because the feed learns from every swipe, it can make an unknown creator famous within days, which links to the concepts of expression and identity. It can also narrow what a user sees, as the system offers more of whatever held their attention before.
This narrowing is described as a filter bubble: a situation in which personalisation algorithms show people mainly content that matches their existing interests and views, so that they encounter fewer different perspectives. The effect is a feedback loop, in which the output (what is shown) shapes the next input (what the user clicks). Research on how strong filter bubbles are is mixed: some studies find that many users still meet a range of views, partly through friends and news sites, so the strength of the effect remains debated.
Counting algorithms keep a running total of items or events, as in the flowchart example. They sound simple but have large social effects: view and like counts influence what becomes popular, and streaming services count plays to pay rights holders. Scottish local council elections have used electronic counting since 2007, because the single transferable vote system involves many rounds of transferring votes that would be very slow by hand.
Use | What the algorithm does | Real-world example | Context and concept link |
|---|---|---|---|
Sorting | Orders items by a rule | Online shop results by price or "featured" | Economic; power over what is seen first |
Searching | Finds matching items | Web search engines | Human knowledge; access to information |
Filtering | Removes items that fail criteria | School network content filters | Social; expression and censorship |
Prioritising | Ranks by importance or urgency | PageRank; NHS 111 triage | Health; values and ethics of who goes first |
Classifying | Places items into categories | Gmail spam detection | Social; accuracy of labels |
Associating | Links related items | Amazon "also bought"; TikTok For You | Cultural; identity and filter bubbles |
Counting | Keeps a total | Streaming plays; electronic vote counts | Political and economic; trust in totals |
Algorithms only affect society once they are built into working software and put into use. Programming (coding) is the process of writing an algorithm in a programming language. Software development is the wider process of creating a complete application, from deciding what it should do to maintaining it after release. Implementation means putting the software into real use in an organisation, with real users and real data.
Stage of software development | What happens | Where algorithmic problems can start |
|---|---|---|
Requirements | Decide what problem the software solves and for whom | The problem is defined narrowly, for example "keep grades in line with past years" rather than "give each student a fair grade" |
Design | Choose the algorithms and data to use | Data that reflects past inequalities is chosen as an input |
Programming | Write the code | Errors (bugs) in the code |
Testing | Check the software on test cases | Testing on average cases but not on minority groups or unusual cases |
Implementation | Put it into use with real users | Staff trust the output without checking it |
Maintenance | Fix problems and update the software | Complaints are ignored, so errors continue |
The table shows why a technically correct algorithm can still harm people. Problems can enter at every stage, and many are human decisions about goals and data, not coding errors. Implementation is especially important: the same algorithm can be harmless when its output is advice checked by a professional and harmful when its output is treated as a final decision.
In traditional programming, people write the rules. In machine learning, people write a learning algorithm, give it large amounts of example data, and the learning algorithm produces the rules itself. The result is called a model: in effect, a new algorithm that was created by another algorithm rather than written line by line by a person. The comparison diagram sets the two approaches side by side.

A spam filter shows the difference. A traditional filter might follow rules written by programmers, such as "IF the subject contains 'WIN A PRIZE' THEN mark as spam". A machine learning filter is given millions of emails already labelled as spam or not spam, known as training data, and learns for itself which features predict spam. It can detect patterns no programmer thought to write down, but the rules it learns may be hard for anyone to state.
Many modern machine learning systems are artificial neural networks: layers of connected nodes, loosely inspired by neurons in the brain, that adjust numerical weights as they learn from examples. Large neural networks power image recognition, speech recognition, translation and chatbots, and they are studied in 3.6 Artificial intelligence. A large neural network can contain billions of weights, so the algorithm it produces cannot be read and understood in the way pseudocode can.
Algorithms can also create better algorithms directly. In 2023 Google DeepMind reported that its AlphaDev system, using machine learning, had discovered routines for sorting very short lists that were up to 70% faster than existing ones; they were added to a standard library used by C++ programmers worldwide. AI coding assistants such as GitHub Copilot, released in 2021, suggest lines and whole functions of code as programmers type, so a growing share of new software is partly written by algorithms.
The use of algorithms creates major opportunities: faster medical triage, fraud detection, translation, scientific discovery and access to information. It also creates dilemmas, situations in which values conflict and there is no option without costs. Four dilemmas are central: bias and fairness, accountability and transparency, black box algorithms, and the erosion of human judgement.
Algorithmic bias occurs when an algorithm produces outputs that systematically favour or disadvantage certain people or groups, often groups defined by race, gender, class, age or place. The algorithm usually has no rule that mentions these groups directly. Bias enters through other routes.
Source of bias | How it happens | Example |
|---|---|---|
Biased training or input data | Data records past discrimination, or some groups are missing from it (data bias) | A hiring model trained on a decade of past hires, most of them men |
Proxy variables | A neutral-looking input is closely linked to a protected group | Postcode standing in for ethnicity or income |
Design choices | The goal or the measure of success is defined narrowly | Optimising for "engagement" rewards outrage |
Use in a new setting | An algorithm built for one population is applied to another | A medical tool tested mainly on lighter skin used on darker skin |
Feedback loops | Outputs shape future data | More policing where crime was recorded leads to more recorded crime there |
The COMPAS risk-assessment tool, used by courts in several US states to estimate whether a defendant will reoffend, shows how bias and fairness conflict. In 2016 the news organisation ProPublica analysed scores for more than 7,000 people in Broward County, Florida. Black defendants who did not reoffend were almost twice as likely as white defendants who did not reoffend to have been labelled higher risk (45% compared with 23%). The company behind the tool replied that its scores were equally accurate for both groups, in the sense that a given score meant about the same chance of reoffending regardless of race.
Both claims were supported by the data. Researchers later showed mathematically that when two groups have different underlying rates of rearrest, no algorithm can meet both definitions of fairness at once. Algorithmic fairness is therefore not a single technical target: designers and societies have to choose which kind of fairness matters most in a given situation, which is a question of values and ethics, not only of mathematics.
YouTubeAlgorithmic accountability is the principle that the people and organisations who design, buy and use algorithms are answerable for their outcomes: they must explain decisions, allow challenges and correct harm. Algorithmic transparency means that information about how an algorithm works, what data it uses and how its outputs are used is open to the people affected and to those who scrutinise it, such as regulators, journalists and researchers.
Transparency supports accountability, because an algorithm cannot be challenged if nobody knows it exists or how it works. Transparency has levels: knowing that an algorithm is used at all, knowing which data it uses, knowing the logic of its rules, and being able to inspect the code or test it independently. Organisations often resist full transparency, arguing that algorithms are trade secrets or that publishing them would let people "game" the system, for example by writing fraudulent claims that avoid detection.
The Dutch childcare benefits scandal (the toeslagenaffaire) shows what happens when accountability fails. For years the Netherlands Tax and Customs Administration used a risk-classification model to select childcare benefit claims for fraud checks, and tens of thousands of parents were wrongly accused of fraud and told to repay large sums. Whether a claimant had Dutch nationality was one of the model's risk factors, and families with a migration background were disproportionately targeted. The government resigned over the scandal in January 2021, and in December 2021 the Dutch Data Protection Authority fined the tax administration 2.75 million euros for discriminatory and unlawful processing of nationality data.
Laws increasingly try to create accountability. Article 22 of the European Union's General Data Protection Regulation (GDPR) gives people the right, with some exceptions, not to be subject to decisions based solely on automated processing that significantly affect them. New York City's Local Law 144, in force since 2023, obliges employers using automated hiring tools to have them audited for bias each year and to tell candidates the tools are used.
A black box algorithm is one whose inner workings cannot be seen or understood by the people affected by it, and sometimes not even by its designers. Algorithms can be black boxes for two different reasons. Some are kept secret on purpose: the code is protected as commercial property, as COMPAS was. Others are opaque by nature: a deep neural network with millions of weights produces outputs that nobody can trace back to simple reasons, even with full access to the code.
Black boxes matter because people expect reasons for decisions that affect them. A driver whose ride-hailing account is deactivated by algorithmic management may ask "why?" and receive no meaningful answer, and without reasons, mistakes are hard to spot and decisions hard to appeal. Researchers in explainable AI try to open the black box, for example by showing which inputs most influenced a particular decision, though these explanations are approximations.
When algorithms make or shape decisions, the role of human judgement changes. Judgement means weighing the details of a particular case, using experience, common sense and empathy, and noticing when the rules do not fit. Algorithms apply the same rules consistently to every case, which can reduce individual prejudice and inconsistency. They can also push human judgement out in two ways.
The first is automation bias: the tendency of people to trust the output of an automated system over their own judgement or contrary evidence, even when the system is wrong. A caseworker who has 200 files and an algorithm that flags 20 as "high risk" will often accept the flags rather than question them. The second is the loss of skill and authority over time: when decisions are routinely delegated, staff may lose the experience or the permission needed to overrule the system.
Australia's Robodebt scheme (2016–2019) shows the erosion of judgement at a national scale. The government's welfare agency used an automated process that averaged a person's yearly income, from tax office data, across fortnights and compared it with the income they had reported when claiming benefits. Where the figures did not match, the system issued debt notices, and the burden fell on recipients to prove they did not owe money. People with irregular incomes, such as casual workers, were wrongly told they owed thousands of dollars. A court ruled in 2019 that debts based on income averaging alone were unlawful, and a Royal Commission reported in 2023 that the scheme had been neither fair nor legal.
The UK Post Office Horizon scandal followed a similar pattern: from 1999 to 2015 more than 900 sub-postmasters were prosecuted, many because of shortfalls recorded by accounting software that the High Court later (2019) found to contain bugs. Through the concept of power, both cases show how an institution's trust in an automated system can leave individuals with few resources unable to be heard.
The dilemmas do not mean that algorithms should be avoided. Human decision-makers are also biased, inconsistent and often unaccountable: studies of judges, recruiters and doctors find that decisions can vary with factors such as time of day or a candidate's name. A well-designed, audited algorithm can be fairer and more consistent than the human process it replaces. The more useful question is how algorithms and people should share decisions, and with what safeguards.
Perspective | Claim | Counter-claim |
|---|---|---|
Public bodies and companies using algorithms | Algorithms make decisions faster, cheaper and more consistent than staff can | Savings can be wiped out by the cost of errors, legal challenges and lost public trust |
People judged by algorithms | Decisions about their lives should be explained and open to appeal | Detailed explanations can be complex and may help some people cheat the system |
Developers | Algorithms can be tested and improved in ways human judgement cannot | Testing finds only the problems developers think to look for |
Regulators and civil society | Transparency and audits are needed for high-stakes uses | Regulation can slow useful innovation and favour large firms that can afford compliance |
Algorithms appear in every context of the course. The table gives one real-world example for each context, with the concept that most helps to analyse it.
Context | Real-world example | Use of algorithm | Concept lens |
|---|---|---|---|
4.1 Cultural | Spotify and TikTok recommendations | Associating, prioritising | Identity: tastes shaped by what is recommended |
4.2 Economic | Ride-hailing apps assigning drivers and setting surge prices | Prioritising, algorithmic management | Power: workers managed by an app |
4.3 Environmental | Navigation apps choosing fuel-efficient routes | Searching for optimal routes | Systems: traffic shifting to smaller roads |
4.4 Health | NHS 111 triage (NHS Pathways) | Prioritising by urgency | Values and ethics: who is seen first |
4.5 Human knowledge | Search engine ranking (PageRank) | Searching, prioritising | Power: which sources are visible |
4.6 Political | News feed ranking on social media | Associating, filtering | Expression: filter bubbles and polarisation |
4.7 Social | The 2020 grading algorithm in England | Classifying, sorting | Values and ethics: fairness to individuals |
In 2020 an algorithm was used to award A-level and GCSE grades to students in England after the COVID-19 pandemic cancelled the summer examinations. It is one of the clearest real-world examples of an algorithm making high-stakes decisions about people, and it shows every dilemma in the topic: bias, fairness, transparency, accountability and the place of human judgement.
A-levels are the main qualifications that 18-year-olds in England take before university, and university offers usually depend on achieving particular grades. On 18 March 2020 the government announced that the summer examinations would not take place. The regulator for qualifications in England, Ofqual, was told by the Secretary of State for Education to keep the distribution of grades similar to previous years, so that 2020 grades would carry the same value as those of other years.
Schools were asked for two things for every student in every subject: a centre assessment grade (CAG), the grade teachers believed the student would most likely have achieved, and a rank order of all students in that subject from strongest to weakest, with no ties. Teachers' grades alone were thought too generous to use: across all A-level entries, CAGs would have given 37.7% of grades at A* or A, compared with 25.2% in 2019, as the chart of top grades shows.

Ofqual's standardisation model, often called the Direct Centre Performance model, worked mainly at the level of each school or college (the "centre") and each subject, not each student. Its inputs were the centre's results in that subject over the previous three years (2017–2019), the prior attainment of the 2020 students (their earlier GCSE results), the teacher rank order and the CAGs.

The process had two main steps, shown in the model diagram:
Predict the grade distribution. Using the centre's past results, adjusted for how the 2020 students had done at GCSE compared with earlier year groups, the model predicted what share of students at that centre should get each grade in 2020.
Fit students to the distribution. The predicted grades were handed out in the order of the teachers' ranking. If the model said a centre's class of 20 should have two A* grades, the two highest-ranked students received A*, whatever grades their teachers had predicted.
A further rule dealt with small groups, because statistics based on a handful of students are unreliable. Where five or fewer students took a subject at a centre, their teachers' grades were used; between about six and fifteen students, the result was a blend of the teacher grade and the model; for larger groups, the model alone decided. These rules were set out in a long technical report published on results day, 13 August 2020.
Compared with teachers' grades, 58.7% of A-level grades stayed the same, 35.6% were lowered by one grade, 3.3% by two grades and 0.2% by three grades, while just over 2% were raised. Nationally, the share of A* and A grades rose only slightly, to 27.6%, close to past years, as the regulator intended. The chart of grade changes shows that almost every adjustment was downwards.

Behind the national figures, the effects fell unevenly. Students at large schools and colleges with a history of lower results could not receive grades their school had rarely achieved before, however strong they were individually: if a centre had not had an A* in a subject in recent years, its best student in 2020 was unlikely to receive one. Students in small classes, more common in independent (fee-paying) schools and in minority subjects, were more often given their teachers' grades, which tended to be higher. Analysis of Ofqual's results data found that the share of A* and A grades at independent schools rose by 4.7 percentage points compared with 2019, more than double the rise at state comprehensive schools.
Scotland had already experienced a similar controversy. Its qualifications authority, the SQA, had moderated teachers' estimates using schools' past results, and about 125,000 results were lowered. The pass rate at Higher level for students from the most deprived areas was reduced by 15.2 percentage points from teachers' estimates, compared with 6.9 points for the most affluent. On 11 August the Scottish government reversed the decision and restored teachers' estimates.
Students who missed university offers protested outside the Department for Education in London, chanting against "the algorithm". Head teachers publicised cases of high-achieving students in disadvantaged schools who had been downgraded. The legal campaign group Foxglove prepared a legal challenge on behalf of a student, arguing that the model discriminated and breached data protection law. An appeals process was announced, changed and then suspended within days.
On 17 August 2020 Ofqual and the government reversed the decision: students would receive their teachers' grade or the calculated grade, whichever was higher. GCSE results three days later were awarded on the same basis. Ofqual's chief regulator resigned on 25 August, and the Prime Minister later described the problem as a "mutant algorithm". Universities had already filled many places using the calculated grades, so the cap on student numbers was lifted and some students were asked to defer their places to 2021.
Stakeholder | Impacts and implications |
|---|---|
High-achieving students at historically lower-performing schools | Downgraded because of their school's past results; lost university offers, then had grades restored but sometimes not their places |
Students in small classes and minority subjects | More likely to keep their teachers' grades; seen by others as unfairly advantaged |
Teachers | Asked to rank students they knew well; their professional judgement was first overruled, then used in full |
Universities | Faced uncertainty and more students meeting offers than expected after the reversal, especially in high-demand courses such as medicine |
Ofqual and the government | Loss of public trust; leadership resignations; the term "algorithm" became a political symbol of unfairness |
Through the concept of values and ethics, the case is a conflict between two kinds of fairness. Fairness between year groups meant that 2020 grades should not be easier to get than 2019 grades. Fairness to individuals meant that each student should be judged on their own work. The algorithm was designed to achieve the first, and it did so at the national level, but it sacrificed the second. A student was judged partly by the past performance of other students at the same school, something entirely outside their control.
Through the concept of power, the case shows who designed, who was judged and who could object. The model was designed by a regulator following a minister's direction, and little detail was shared before results day. The Royal Statistical Society offered to help but did not join Ofqual's advisory group, because members would have had to sign a confidentiality agreement. Students, the people most affected, had no way to see or test the model before it decided their futures, and the first appeals process was confused. Power shifted only when protests, media coverage and legal threats created political pressure.
Through the concept of systems, the algorithm was one element in a larger system that included schools, universities, admissions services and the labour market. A design choice at one point, using centre history to limit grade inflation, had consequences elsewhere: universities could not plan their numbers, and the reversal moved the problem from students to institutions. This is an example of an unintended consequence spreading through interdependent parts of a system.
The algorithm achieved the narrow goal it was designed for: national grade distributions close to previous years. It failed the wider test of being accepted as fair by the people it judged. The main cause lay in how the problem was defined. An algorithm built to answer "what grades should this school get?" was used to answer "what grade does this student deserve?", and no algorithm can answer the second question from the first set of data.
There is a reasonable counter-claim. Teachers' grades alone were also flawed: they were much higher than any previous year, they varied between schools in how generous they were, and research before 2020 had found that teacher predictions can be less accurate for some groups of students. Every option in 2020 was imperfect. A stronger approach would have combined the model with meaningful human review, tested the model's effects on different groups openly before results day, and offered a clear, accessible appeals process. The case suggests that algorithms making high-stakes decisions about individuals are accepted only when they are transparent, can be challenged, and judge people on information about themselves.
Paper 2 questions are based on short sources and reward answers that use them precisely, alongside course knowledge.
I can define an algorithm and distinguish it from a program and a digital system.
I can explain the four characteristics of an algorithm and test a set of instructions against them.
I can identify instructions, sequence, variables, conditionals and loops in a simple algorithm.
I can describe an algorithm in natural language, as a flowchart and in pseudocode, and state what simple pseudocode outputs.
I can distinguish between pseudocode, source code and a programming language.
I can explain what algorithmic efficiency means and why it matters as data grows.
I can trace a binary search step by step and compare it with a linear search.
I can outline sorting, searching, filtering, prioritising, classifying, associating and counting, with a real-world example of each.
I can describe the stages of software development and explain where problems in an algorithm can start.
I can explain how machine learning creates new algorithms from data, with an example.
I can explain the main sources of algorithmic bias and why different definitions of fairness can conflict.
I can distinguish algorithmic accountability from algorithmic transparency and explain why black box algorithms are hard to challenge.
I can explain automation bias and the erosion of human judgement using a real-world example.
I can analyse the 2020 grading algorithm in England through at least two concepts and evaluate it.