What Is an Algorithm?
An algorithm is a set of clearly defined instructions designed to solve a problem or complete a particular task. It describes a sequence of steps that can be followed to produce a result.
Although algorithms are fundamental to computer science, the underlying concept is much older than modern computers.
Consider following a recipe. You start with a list of ingredients, follow instructions in a particular order and eventually produce a finished dish. An algorithm works according to a similar principle: it takes an input, processes it according to defined rules and produces an output.
In computer science, algorithms are typically characterised by precise instructions that can be executed systematically. For a conventional problem-solving algorithm, the process is also expected to terminate after a finite number of steps.
Importantly, an algorithm does not have to be particularly complex. A simple procedure for sorting numbers from smallest to largest is just as much an algorithm as a sophisticated method used to analyse large datasets.
The difference lies in what the algorithm is designed to accomplish, not whether it appears intelligent.
How Do Algorithms Actually Work?
To understand how algorithms function, imagine an online shop offering free delivery on orders worth £50 or more. Its checkout system might follow a simple rule: if the total order value reaches £50, delivery is free. Otherwise, a delivery charge applies.
This is an example of a rule-based algorithm. The system receives information, evaluates a predefined condition and generates the corresponding result. More sophisticated algorithms may involve thousands of instructions, mathematical calculations and different decision-making paths.
A navigation application, for instance, can use algorithms to identify possible routes between two locations. Depending on the system, it may consider factors such as distance, estimated journey time and available traffic information. Algorithms also make it possible to sort enormous quantities of information efficiently. Search engines use algorithmic methods to retrieve and rank results, while streaming services use them to recommend content.
However, these results depend on more than the instructions themselves. The quality of the input data, the assumptions incorporated into the system and the objectives chosen by its developers can all influence the outcome.
An algorithm designed to identify the shortest route may produce a different recommendation from one designed to minimise travel time. Neither result is necessarily incorrect. The algorithms are simply optimising different objectives.
Are Algorithms the Same as Artificial Intelligence?
Algorithms and artificial intelligence are closely connected, but they are not interchangeable concepts.
Every AI system relies on computational processes involving algorithms. However, not every algorithm constitutes artificial intelligence. Traditional algorithms commonly operate according to instructions explicitly defined by programmers. Their behaviour is determined by the rules and logic incorporated into the software. Artificial intelligence systems can go further by using techniques that allow them to infer patterns or relationships from data.
A particularly important example is machine learning. Instead of explicitly programming every rule for recognising suspicious financial transactions, developers can train a machine learning model using examples of previous transactions. During training, learning algorithms adjust the model’s parameters to identify patterns that may help classify new transactions.
Once trained, the model can generate predictions when presented with unfamiliar data. This distinction is important, although it is not absolute. Some AI systems use explicitly represented rules, and many modern applications combine traditional programming with machine learning.
The OECD’s definition of an AI system reflects this broader understanding by focusing on systems that infer how to generate outputs such as predictions, recommendations, content or decisions. In other words, an algorithm describes a computational procedure, while artificial intelligence refers to a broader category of systems and capabilities.
Understanding this distinction helps explain why a simple calculator, a recommendation system and a generative AI chatbot may all involve algorithms without functioning in the same way.
Why Algorithms Matter for Law and Society
Algorithms are not inherently objective simply because they operate mathematically. Their outputs can reflect choices about which information matters, how different factors are weighted and what the system is intended to optimise. This becomes particularly relevant when algorithmic systems influence decisions about individuals.
Imagine a bank using an automated system to assess creditworthiness. The system might evaluate financial information and generate a risk score. Depending on how that score is used, it could influence whether someone receives a loan.
Questions then arise about transparency, fairness and accountability. Within the European Union, the General Data Protection Regulation (GDPR) establishes safeguards concerning certain forms of automated individual decision-making. Under Article 22 GDPR, individuals are protected against decisions based solely on automated processing, including profiling, where those decisions produce legal effects or similarly significant consequences. The provision also establishes exceptions and associated safeguards.
Crucially, these protections are not limited to systems labelled as artificial intelligence. What matters is the nature of the processing and the decision involved. For lawyers, regulators and businesses, understanding algorithms is therefore essential to evaluating how digital systems operate and where legal responsibilities may arise.
Final Thoughts
Algorithms are neither mysterious digital minds nor inherently neutral decision-makers. They are methods for processing information and solving problems according to defined procedures.
Their growing importance raises a question that extends beyond computer science: who determines the objectives these systems pursue, and who is responsible when their outcomes affect people’s lives?
Understanding algorithms is a starting point for answering that question.
As automated systems become increasingly integrated into professional and everyday decision-making, technological literacy is becoming an important part of legal literacy.