The basics

What is an algorithm?

In short

An algorithm is a set of step-by-step instructions that a computer follows to solve a problem or complete a task.

Algorithms can be simple, such as sorting a list alphabetically, or complex, such as deciding which posts to show you in a social feed. In machine learning, an algorithm is the method used to learn from data.

Mini course

3 short lessons, about 2 minutes in total

  1. A recipe for a computer
  2. Algorithms that learn
  3. Why it matters for business

Lesson 1

A recipe for a computer

An algorithm is a precise list of steps that turns an input into an output, like a recipe. Sorting a list by price, finding the shortest route on a map and calculating VAT are all algorithms. They are written by people and do exactly what they say, every time.

Input
Step-by-step rules
Output
An algorithm turns input into output through fixed steps. In machine learning, an algorithm learns the steps from data instead

Tap a box to open that concept

Everything a computer does runs on algorithms.

Lesson 2

Algorithms that learn

In machine learning, people write an algorithm for learning, not for the task itself. That learning algorithm studies examples and produces a model, which holds rules no person wrote down. This is how a spam filter learns what spam looks like without anyone listing every trick.

When people say 'the algorithm' on social media, they mean a learned model that ranks what you see.

Lesson 3

Why it matters for business

Written algorithms are predictable and easy to explain, which suits rules like pricing, VAT and approvals. Learned models handle messy, changing patterns better, such as language, images and behavior. Many good systems combine both: fixed rules for what must always hold, and AI for judgment.

  1. Customers find youHow customers and AI tools find the companySEOGEOGoogle AI Overviews
  2. AI in daily workTools staff and customers useChatbotAI copilotVoice AI
  3. Building blocksHow AI connects to data and systemsRAG (retrieval-augmented generation)AI agentMCP (Model Context Protocol)
  4. AI modelsThe models that understand and createAlgorithmLarge language model (LLM)Generative AIMachine learning
  5. DataCompany data, gathered and cleanedData warehouseETLData quality
  6. InfrastructureCloud, networks and systems underneathCloud computingDatabaseAPI key
Trust and rulesSecurity, law and control in every layerGDPR and AIEU AI ActAI guardrails
Where Algorithm sits in a company's AI setup

Knowing which is which helps you decide where to trust automation and where to check it.

An everyday example

A recipe is an algorithm for a meal: follow the steps in order and you get the dish.

How companies use it

Companies rely on algorithms to set delivery routes, plan staff schedules, rank search results and calculate prices.

Frequently asked questions

Is an algorithm the same as AI?

An algorithm is not the same as AI. All AI uses algorithms, but most algorithms are ordinary instructions with no learning involved.

Can algorithms be unfair?

Algorithms can be unfair if their rules or data favor some groups over others. That is why they should be checked.

Who writes algorithms?

Programmers write them, or in machine learning they are partly shaped by the data.

In depth: Algorithm

The full picture, about 4 minutes of reading

A recipe a computer can follow

An algorithm is a list of steps that turns something you put in into something you get out. A recipe is the classic example: take these ingredients, do these things in this order, and you get a cake. Computers need the same thing, only far more precise, because a computer cannot guess what you meant. Every step has to be spelled out, including what to do when something is missing or unusual.

Algorithms are everywhere in ordinary business software. Sorting customers by name, adding VAT to a price, checking that an email address has an @ sign, finding the shortest route between two addresses: each of these is an algorithm. Most of them are so simple and reliable that nobody thinks about them. Everything a computer does, from showing a web page to running an AI model, comes down to algorithms carrying out steps.

Two kinds: written rules and learned models

It helps to separate two kinds of algorithm, because they behave very differently.

The first kind is written by people. A programmer decides the rules: if the order is over a certain amount, ask for approval. If the invoice is late, send a reminder. These algorithms do exactly what they say, every time. You can read them, test them and explain any result.

The second kind is learned. In machine learning, the part of AI where computers learn from examples, programmers do not write the rules for the task itself. They write a learning algorithm that studies thousands of examples and produces a model, a bundle of patterns stored as numbers. A spam filter works this way. Nobody listed every trick spammers use. The filter learned what spam tends to look like from many marked emails.

When people complain about "the algorithm" on social media, they mean the second kind: a learned model that decides which posts you see.

How a learned model differs in practice

A written rule handles exactly the cases its author thought of. Give it something new and it either fails or does something silly. A learned model is better with messy, varied input, such as free text, photos or behavior, because it has seen many variations. That is why AI can sort customer emails that are worded in a hundred different ways.

The price of that flexibility is predictability. A learned model can give a different answer to two inputs that look almost the same to a person. It can be very confident and still wrong. And it is hard to point to one line and say "this is why it decided that", because the decision is spread across millions of numbers.

So the two kinds have opposite strengths. Written rules are clear but rigid. Learned models are flexible but harder to explain and control.

Where algorithms go wrong

Written algorithms go wrong when the rule itself is wrong or out of date. A pricing rule that forgot a new product category, or a discount that stacks in a way nobody planned, will repeat the same error on every order until someone notices. Because they run fast and without tiring, a small mistake can spread widely.

Learned models go wrong in quieter ways. They copy patterns from their training data, including unfair ones. If past decisions favored some groups, a model trained on those decisions will tend to do the same, which is called bias. They can also drift: a model trained on last year's customer behavior may slowly get worse as habits change.

In both cases, the fix starts with the same habit: check the outputs against reality, regularly, and keep a person able to overrule them where the stakes are high.

Choosing the right kind for the job

A good test is to ask whether you could write the rule down on one page. If you can, and it must hold every time, a written algorithm is usually best. VAT, approval limits, payment terms, invoice numbering and access rights belong here. Being exact and explainable matters more than being clever.

If the task needs judgment that is hard to put into words, such as "is this email a complaint?", "does this photo show a scratch?" or "which customers are likely to leave?", a learned model is usually the better fit.

Many good systems combine both. A learned model reads an incoming order and suggests what it is, and written rules then check the amount, the customer's credit limit and whether approval is needed. The AI handles the messy part, and the rules make sure the things that must always hold still hold.

What it means for a small business

A small business does not need to write algorithms to benefit from them, but it helps to know which kind is behind each tool it uses. When a system is built on written rules, you can ask the supplier exactly what the rules are and expect the same result every time. When it is built on a learned model, ask how it was tested, what data it learned from and how you can correct it when it is wrong.

When you plan automation, sort your tasks the same way. Put fixed business rules into ordinary software or settings. Use AI only for the steps that need reading, sorting or judging. And wherever a decision affects a customer, an employee or money in a significant way, make sure a person can see why it was made and change it.

Curious what this could mean for your company? Book a call.

Book a call