What is an algorithm?
An algorithm is a definite procedure for performing a task or solving a class of problems.
It begins with some input, follows a finite set of rules and produces an output.
A recipe, a method of long division and a procedure for finding a name in an ordered list can all be algorithms.
An algorithm is not a particular answer. It is a method for reaching answers.
What makes a procedure an algorithm?
A useful algorithm has several features:
- Clear steps — each operation is stated precisely enough to be followed
- Defined inputs — it is known what information the procedure receives
- Defined outputs — it is known what result the procedure should produce
- Termination — it finishes for the cases it claims to handle
- Generality — it works for a class of cases, not only one memorized example
“Find the best answer somehow” is not an algorithm. The work hidden inside “somehow” still needs to be described.
Is an algorithm the same as a program?
No.
An algorithm describes the method. A program expresses that method in instructions a computer can execute.
The same algorithm may be written in different programming languages or carried out by a person with paper and pencil.
A program also contains practical details beyond the central method: how input is read, errors are handled, memory is managed and results are shown.
How does an algorithm use smaller steps?
A difficult task becomes manageable when divided into simpler operations.
To arrange books alphabetically, one procedure might:
- Compare two titles.
- Put the earlier title first.
- Repeat the comparison across the shelf.
- Continue until no title needs to move.
Each comparison is simple. Their repeated organization produces the larger result.
This is a central idea of computation: complex behaviour can be composed from small, precise operations.
Can two algorithms solve the same problem?
Yes.
Imagine finding a name in a telephone directory.
One method begins at the first page and checks every name. Another opens near the middle, decides whether the name must be earlier or later, and repeatedly halves the remaining pages.
Both can find the name. The second usually needs far fewer steps because it uses the order already present in the directory.
Choosing an algorithm therefore affects how much time, memory and energy the solution requires.
What is efficiency?
Efficiency describes the resources an algorithm needs as the problem grows.
An approach that works quickly for ten items may become unusable for ten million. The important question is not only how long one example takes, but how the required work grows with the size of the input.
Sometimes speed matters most. Sometimes memory, energy, accuracy or simplicity matters more.
There is rarely one best algorithm without a purpose and a situation.
What is correctness?
An algorithm is correct when it produces the promised result for every valid input covered by its claim.
A few successful examples are not enough. A method may work for ordinary values and fail for zero, an empty list or an unusually large number.
Correctness can be supported by:
- Careful reasoning about every step
- Proof for clearly defined procedures
- Tests using normal and difficult cases
- Comparison with an independent method
Testing reveals errors. Reasoning explains why the method should continue to work beyond the examples tested.
Can an algorithm be biased?
Yes.
An algorithm follows the distinctions, goals and data built into it.
A hiring procedure may appear neutral while using past decisions that reflect unfair treatment. A recommendation system may optimize attention even when attention is gained through anger or fear.
The steps can be executed exactly and the outcome can still be harmful.
We should therefore ask not only whether an algorithm works, but:
- What is it trying to achieve?
- Which information does it use or ignore?
- Who bears the cost of an error?
- Can its result be examined and challenged?
Precision does not remove judgement. It places judgement into the design.
Does an algorithm understand its task?
Not necessarily.
A route-finding algorithm can discover a short path without knowing what travel feels like. A chess algorithm can choose a strong move without wanting to win.
An algorithm describes a relation between inputs, operations and outputs. Understanding and consciousness are separate questions.
We often use human words such as “choose”, “see” or “learn” to describe its operation. These words may describe the function correctly without implying an inner experience.
Are all problems algorithmic?
No.
Some questions are vague because the desired answer has not been defined. Others depend upon values that cannot be reduced to one agreed measure.
There are also precisely stated computational problems for which no algorithm can always produce the answer, and others whose known solutions require impractical amounts of time.
A computer is powerful, but computation has limits.
Recognizing that a problem is poorly defined, unknowable from the available information or beyond practical computation is itself important.
How do algorithms relate to intelligence?
Algorithms provide repeatable methods. Intelligence includes recognizing which method fits the situation, adapting when it fails and sometimes inventing a better one.
An intelligent system may use many algorithms for perception, memory, learning, inference and decision.
The algorithms organize the work. Intelligence appears in how effectively the whole system understands and responds.
So what is an algorithm, finally?
An algorithm is a precise, repeatable path from input to output.
Its quality depends upon correctness, efficiency and suitability for the real purpose. It can make reasoning reliable and scalable, but it cannot decide by itself which goals are worth pursuing.
A procedure tells us how to move. Wisdom is still needed to decide where to go.


