Specialty Digest

DISCOVER IDEAS THAT SHAPE OUR WORLD

Algorithm

nounComputer Sciencealso algorithms, algorithmic, computer algorithm

In one line

An algorithm is a computable set of steps that turns an input into a desired result, such as a sorted list or a route.

In simple terms

An algorithm is a set of steps that turns an input into a result. The US standards body NIST puts it plainly: a computable set of steps that achieves what you wanted.

The usual comparison is a recipe, and it holds up. Fixed ingredients go in, defined steps follow, and the same dish comes out.

How it works

Every algorithm has an input, a sequence of operations and an output. The steps have to be precise enough that anyone, or any machine, following them mechanically reaches the same answer.

Two algorithms can solve the same problem at wildly different cost. Sorting a million records one way takes seconds and another way hours, which is why computer scientists measure how the work grows as the input grows.

Some algorithms are deterministic and return the same output every time. Others are randomized or probabilistic, using chance on purpose to run faster or to escape dead ends.

The word is old. It comes from the name of the Persian mathematician al-Khwarizmi, who worked around 825 AD.

Legal definitions are wider than technical ones, and they differ by country. Cornell Law School describes an algorithm as any process, rule or method followed in calculation, data processing, data mining, pattern recognition or automated reasoning, which sweeps in systems an engineer might not call algorithms at all.

Why it matters

Almost everything a computer does rests on an algorithm somewhere: ranking search results, routing a delivery van, compressing a photograph.

Algorithms now make decisions about people. Cornell Law School points to criminal risk assessment, predictive policing and facial recognition as the areas drawing the most legal concern.

Because the steps are written down, they can in principle be inspected and tested. That is the argument behind transparency and audit rules in several countries.

Where you’ll see it

  • Search ranking and social media feeds.
  • Navigation apps picking one route out of thousands.
  • Bank fraud checks and credit scoring.
  • Hospital triage and staff scheduling tools.

Example

To find a name in a sorted list, a binary search algorithm checks the middle entry, throws away the half that cannot contain the name, and repeats. A list of a million names narrows to one in about twenty steps.

Often confused with

A program is an algorithm written in a particular language and run on a machine. The algorithm is the method. The program is one way of carrying it out.

Key facts

  • The NIST Dictionary of Algorithms and Data Structures defines an algorithm as a computable set of steps to achieve a desired result.1
  • The word comes from the name of the Persian mathematician al-Khwarizmi, who worked around 825 AD.1
  • Algorithms are classified by behavior, including deterministic, nondeterministic, randomized and probabilistic types.1
  • Cornell Law School defines an algorithm broadly as a process, set of rules or methodology used in calculation, data processing, data mining, pattern recognition or automated reasoning.2
  • Legal attention focuses on algorithms used in criminal risk assessment, predictive policing and facial recognition.2

Related concepts

In the news

Quick checkWhat is the difference between an algorithm and a program?Show answer

An algorithm is the method, a defined sequence of steps. A program is one implementation of that method, written in a specific language for a specific machine.

Sources

  1. NIST, Dictionary of Algorithms and Data Structures. algorithm. Undated (accessed 18 September 2026)
  2. Cornell Law School, Legal Information Institute. Algorithm, Wex legal dictionary. Undated (accessed 18 September 2026)

Editorially reviewed by Specialty Digest Editorial TeamLast reviewed September 21, 2026Researched and drafted with AI assistanceReport an issue