Back to the blog

What an algorithm really is

Beyond social media and artificial intelligence: what defines an algorithm and why algorithmic logic also appears in everyday life.

When we hear the word algorithm, we think about social media. We think about Instagram’s algorithm, YouTube recommendations, or artificial intelligence.

But that is only the most visible version of the concept.

An algorithm is not a content recommendation. It is something much more fundamental: a defined sequence of instructions that transforms an input into an output.

Understanding this helps us see technology more clearly. It also reveals something uncomfortable: our lives are full of processes that resemble algorithms even though they are not written in code.

They appear in our habits, decisions, and ways of reacting.

But let us take it one step at a time.

A word we use for almost everything

We talk about “the algorithm” when a video goes viral, a news story appears first in our feed, or a store seems to anticipate what we want to buy.

In those cases, the word usually represents a complex system made from many algorithms, models, rules, data sources, and product decisions. Saying “the YouTube algorithm” is a useful simplification, but it is not a technically precise description of one list of instructions.

The idea of an algorithm is much older than digital platforms. It appears whenever we need to solve a class of problems through a repeatable procedure.

What an algorithm needs

In simple terms, an algorithm receives an input, performs a series of steps, and produces an output.

For example, a sorting algorithm receives a collection of unordered numbers and returns those numbers in a defined order. A search algorithm receives a collection and a value, then reports where that value appears or whether it is absent.

For a procedure to count as an algorithm, we normally expect several properties:

  • Precise instructions: each step must say what to do without relying on arbitrary interpretation.
  • Effective steps: every operation must be concretely executable.
  • Defined inputs and results: the information received and the answer produced must be clear.
  • Finiteness: for every input within its scope, the procedure must finish after a finite number of steps.

The last condition needs a qualification. Some programs are designed to keep running, such as operating systems and servers. That does not make their entire endless execution an algorithm intended to produce one final answer. Those systems contain algorithms that solve particular tasks and do terminate.

A recipe helps, but it is not enough

Algorithms are often explained by comparing them to recipes. The analogy works because a recipe has ingredients, steps, and an expected result.

However, many human recipes include instructions such as “cook until ready” or “season to taste.” A person can interpret those phrases through experience and context. A machine needs much more explicit criteria.

An algorithm requires enough ambiguity to be removed for every step to be executed systematically.

Writing a good algorithm is therefore not only about knowing the result. It also requires describing a path that another person or machine can follow without guessing our intentions.

An algorithm is not the same as a program

An algorithm is the procedure. A program is a concrete implementation of that procedure in a particular language and on a particular platform.

The same sorting algorithm can be written in Python, JavaScript, or Java, or even followed manually using cards on a table. The implementation changes, but the idea for solving the problem remains.

The reverse is also true: a real program usually contains many algorithms. An application combines procedures for validating data, finding information, prioritizing tasks, displaying an interface, and responding to errors.

This distinction matters because it lets us evaluate two separate questions:

  • Is the method for solving the problem correct and efficient?
  • Does its concrete implementation follow that method and work properly in its environment?

Every algorithm makes decisions under rules

Some algorithms always execute the same sequence. Others take different paths depending on the data.

if the password is correct:
  allow access
otherwise:
  reject it

This minimal structure already contains a decision: observe a condition and apply a rule.

Modern systems may contain millions of parameters, use probabilities, and learn patterns from data. Their behavior can be difficult to anticipate, but they still execute formal processes over representations of information.

Complexity does not remove the rules. It makes the rules, states, and their interactions harder to see.

Algorithms also express priorities

An algorithm does not appear from nowhere. Someone defines which inputs matter, which outcome is desired, and what makes one answer better than another.

In a recommendation system, for example, optimizing viewing time is not the same as optimizing diversity, learning, well-being, or long-term satisfaction.

The procedure may be technically flawless while still pursuing an objective we do not share.

That is why, when an automated system influences people, asking “Does it work?” is not enough. We also need to ask:

  • What is it optimizing?
  • What information does it use?
  • Who selected that objective?
  • Which behaviors does it reward?
  • Which consequences are left outside the measurement?

Algorithms execute rules, but the objectives behind those rules contain human choices.

Algorithms we do not write in code

Everyday life also contains repeated sequences in the form of “if this happens, I do that.”

If I wake up and immediately reach for my phone, there is an input —waking up—, a learned rule, and an output —opening an application. If I always look for a distraction when a task becomes difficult, I am executing a pattern that grows increasingly automatic.

These are not formal algorithms in the mathematical sense. Humans operate through emotion, contradiction, context, and interpretation. But thinking about some habits as algorithmic processes can be useful.

It allows us to stop seeing a behavior as a fixed part of our identity and start observing its structure:

trigger → habitual response → result

If I can recognize the trigger, I may be able to change the response. If I change the rule I repeat, I may also change the result that appears over time.

Designing better rules

Many personal outcomes do not depend on one enormous decision. They emerge from small rules executed again and again.

“After lunch, I will walk for ten minutes” is more operational than “I want to move more.” “Before opening my email, I will complete my most important task” defines a sequence. “If I do not understand a concept, I will write one concrete question” turns confusion into an action.

These rules do not guarantee a perfect life. But they reduce the number of decisions we have to improvise when we are tired, distracted, or unmotivated.

In that sense, designing habits resembles designing algorithms: we make a logic explicit, observe its results, and adjust it when it fails to produce what we expected.

Understanding the word changes the conversation

An algorithm is not a mysterious force making decisions from somewhere invisible. It is a procedure designed to transform information according to rules and objectives.

It can be simple or extraordinarily complex. It can run on a computer, be explained on paper, or inspire a way of observing our habits.

The next time somebody says, “The algorithm did it,” it is worth going a little deeper.

Which data did it receive? Which instructions did it follow? Which result was it trying to optimize? Who chose those rules?

Understanding what an algorithm really is does more than help us program. It helps us recognize the processes shaping what we see, what we choose, and what we become through repetition.


This piece grew out of a script I prepared while experimenting with AI-assisted audiovisual content. You can watch the original video on YouTube.

Keep reading

View all articles