---
title: Algorithm
description: 'A specified procedure that transforms inputs into outputs or solves a defined class of problems through a finite set of steps and stated stopping behavior.'
canonical_url: 'https://darkfactory.dev/glossary/algorithm'
markdown_url: 'https://darkfactory.dev/glossary/algorithm.md'
collection: glossary
date_published: '2026-08-03T00:00:00-04:00'
date_modified: '2026-08-26T00:00:00-04:00'
---

# Algorithm


## Definition

An algorithm is a specified procedure for transforming inputs into outputs or solving a defined class of problems. Its instructions, valid inputs, expected result, and stopping behavior must be clear enough that the procedure can be followed or implemented.

An algorithm does not have to be deterministic. A randomized search or sampling algorithm can use chance and return different results across runs while still following a precise procedure. Correctness therefore means meeting the algorithm's stated guarantee, which may be exact, approximate, probabilistic, or conditional.

## Where the word came from

"Algorithm" descends from the Latinized name of the ninth-century mathematician Muhammad ibn Musa al-Khwarizmi. His work helped transmit methods for calculating with Hindu-Arabic numerals. The word later broadened from arithmetic procedures to the general computing sense used today. Al-Khwarizmi did not coin the modern computer-science definition; his name is the source of the word.

## Distinguish it from nearby terms

- A **program** is an implementation written for a particular execution environment. Many programs implement several algorithms.
- A **model** is a learned or encoded artifact. Algorithms train, search, optimize, evaluate, or operate models.
- A **heuristic** is a practical rule that may find a useful answer without the guarantee associated with an exact algorithm. Heuristics can still be specified as algorithms when their limits are stated.

## Operational significance

Calling a system "algorithmic" says little about its behavior. Reviewers need the objective, input representation, constraints, randomness, error conditions, complexity, and stopping rule. In AI systems, the training algorithm, inference algorithm, and product policy may each make different decisions.

## Check your understanding

For a ranking service, identify the candidate inputs, scoring procedure, tie handling, randomness, stopping condition, and output contract. If those cannot be stated, "the algorithm" is hiding several unresolved design choices.

## Related terms

- [Machine learning (ML)](https://darkfactory.dev/glossary/machine-learning)
- [AI model](https://darkfactory.dev/glossary/ai-model)

## Evidence and further reading

- [NIST AI Resource Center Glossary](https://airc.nist.gov/glossary/)
- [Google Machine Learning Glossary](https://developers.google.com/machine-learning/glossary/)
- [How Algorithm Got Its Name](https://science.nasa.gov/earth/earth-observatory/how-algorithm-got-its-name-91544/)
