A set of instructions is an algorithm when it provides a finite, unambiguous sequence of feasible steps that takes defined input, if required, and produces a defined output to solve a problem or perform a task. This topic is part of the syllabus shared by SL and HL students.
An algorithm must be precise enough to be followed consistently. Its instructions are arranged in a logical order, and each step tells the user or digital system what operation to perform. Algorithms may include variables, conditionals and loops, but these components are not required in every algorithm.
| Characteristic | What it means |
|---|---|
| Unambiguous | Each instruction has one clear interpretation. |
| Finite | The process terminates after a limited number of steps. |
| Defined input | Any data required before execution is identified. Some algorithms need no external input. |
| Defined output | The expected result is specified. |
| Feasible | Every step can realistically be completed using the available resources. |
| Ordered | The steps follow a sequence that produces the intended result. |
For example, “sort these examination scores from lowest to highest” identifies a task, but it is not itself an algorithm. An algorithm would specify repeatable steps: compare adjacent scores, swap them when the left score is greater, repeat the comparisons, and stop when no swaps are needed.
A common misconception is that an algorithm must be computer code. It does not. An algorithm can be represented using natural language, a flow chart or programming code. Code implements an algorithm in a form that a computer can execute.
In an IB Digital Society exam, a Define question requires the precise meaning of algorithm. For an Explain question, connect the definition to characteristics such as finiteness and unambiguity, then develop the point by showing why vague or non-terminating instructions fail to qualify. Avoid merely stating that an algorithm is “a list of steps,” because that definition is too broad.