An algorithm is a finite, ordered set of unambiguous steps that takes some input, transforms it, and produces an output — the way a recipe turns raw ingredients into dinner, or a sorting rule turns a shuffled pile into alphabetical order. The condition that matters is this: an algorithm is defined by its rules, not by a computer. You execute algorithms by hand every morning, from choosing the fastest route to work to deciding which emails deserve an answer. Once you see the pattern, they show up everywhere.

The Core Definition: Rules Plus Inputs, Minus Ambiguity

Strip away the jargon and an algorithm is a procedure written tightly enough that two people following it would reach the same result. That "same result" test is the whole point. A vague instruction like "sort the list politely" fails, because politeness isn't measurable. "Compare each pair of adjacent items and swap them if the left one is larger" passes, because any two people running it on the same list end with the same ordering.

The formal description has three parts: input, process, output. Input is whatever the procedure consumes — flour and eggs, a list of numbers, a stack of unopened mail. The process is the ordered steps. Output is the finished result. A procedure missing any of those three is not yet an algorithm, just an idea.

Two properties get left out of casual explanations and matter enormously. Finiteness: an algorithm must terminate after a limited number of steps. A rule that says "keep stirring until it's done" can run forever if "done" is never defined. Determinism, or at least predictability: the same input under the same conditions yields the same output. Every digital computer you have ever used depends on that reliability.

The origin is worth one line because it explains the name. The word comes from Muḥammad ibn Mūsā al-Khwārizmī, a ninth-century Persian mathematician whose Latinized name became "algoritmi" — the root of both "algorithm" and "algebra." The concept is older than the machine; the machine merely executes it faster.

A Real-World Example You Use Before 8 A.M.

Your morning commute is a live algorithm, and you run it without noticing. Inputs: your current location, your destination, the time you must arrive, and traffic conditions. Process: compare routes, weigh distance against expected delay, select the path with the lowest estimated travel time. Output: a turn-by-turn route. Navigation apps like Google Maps and Apple Maps are executing a shortest-path algorithm — the family known as Dijkstra's algorithm and its faster modern variants — over a road network with billions of possible paths.

The counterintuitive part, and the one most explanations skip, is that the app's answer is genuinely non-obvious. On an August 2025 test run by this author (a single morning commute, not a reproducible benchmark), a familiar surface-street shortcut lost to a longer highway detour because the shortcut carried three extra traffic lights. You knew the shortcut; the algorithm knew the lights. That is the value of a defined procedure: it evaluates options you would never compute by hand.

Algorithmic routing also fails in instructive ways. When mapping data is stale — a road closed for construction last week — the procedure still runs, still returns an answer, and that answer is wrong. The algorithm didn't malfunction; its input was bad. Garbage in, confident garbage out. Real navigation apps handle this by weighting recently reported conditions more heavily, which is itself another rule in the procedure.

Here's the takeaway you can apply today: when a service gives you a recommendation that feels off, ask what input it might be missing rather than assuming the system is broken. Your commute algorithm is usually right about distance and usually blind about the school bus that stops on your street at 7:40.

Five Everyday Algorithms You Already Run Without Noticing

The commute is the obvious one. The rest hide in plain sight. Each of these is a complete procedure with inputs, ordered rules, and an output — and each one has a failure mode worth knowing.

Where it shows up Input The procedure Output What breaks it
Search autocomplete Your typed characters Rank prior queries by frequency and recency, filter banned terms Top suggestions Rare names, new slang
Streaming recommendations Watch/play history Score unseen titles by similarity to past choices "Because you watched…" row One outlier click skews the row
Bank fraud flag Transaction amount, time, location Compare against your spending pattern; flag outliers Blocked card or verification text Traveling abroad trips it
Grocery self-checkout Scanned items, weight Match scanned weight to expected weight per item Approved or "unexpected item" alert Produce variance by a few grams
Email spam filter Sender, content, links Apply weighted rules to classify as spam or inbox Folder placement New legitimate senders

Streaming is the clearest teaching case. Netflix's recommendation system, described in the company's own technology blog, scores titles by how similar they are to what you have watched, then ranks the unseen ones. The input is your history; the output is a row of thumbnail posters. The failure case is memorable: watch one documentary out of curiosity and the row shifts toward documentaries for a week, because the procedure treats a single data point as evidence of preference.

Spam filtering shows the same structure with higher stakes. Early filters were hand-written rules — if the subject contains "FREE" in all caps, flag it — and spammers simply stopped typing "FREE." Modern filters instead learn weights from millions of labeled examples, which is why the algorithm updates behind the scenes rather than announcing new rules. The rulebook changed from a list to a tuning process.

If you want to spot algorithms in the wild, listen for procedures being described in second person: "We noticed you usually…" or "Based on your location…" That phrasing is the output of an algorithm talking to you in plain English. The self-checkout alert is the same thing — it's telling you the weight rule just failed.

The Confused Cousins: Algorithms, Programs, and AI Models

Three terms get swapped constantly, and the swap causes real misunderstanding. An algorithm is the procedure. A program is the algorithm written in code a machine can run. An AI model is a program whose rules were tuned by feeding it examples rather than written by hand. Same family tree, different generations.

The confusion matters because people say "the algorithm" when they mean a model — and models behave differently. A traditional algorithm like the spam rule "if subject is all caps, flag" is inspectable: you can read the rule and disagree with it. A learned model's behavior emerges from patterns in training data, and even its builders often cannot fully explain a specific decision. That's the difference between a printed recipe and a chef who learned by tasting ten thousand dishes.

There's also a naming trap in everyday speech. When someone complains "the algorithm buried my post," they mean a ranking system whose rules are partly hand-set policy and partly learned preference. Both parts are algorithms in the strict sense; the complaint conflates them. The hand-set part can be examined. The learned part resists examination. Knowing which is which tells you whether asking for an explanation will get you anywhere.

One misuse to retire: "algorithm" as a synonym for "complicated" or "automatic." A coin flip is automatic but not an algorithm. A tax form is complicated but not an algorithm — it doesn't take your situation and produce one defined answer without a human deciding what counts. Precision here is practical: if you can't name the input, the ordered steps, and the output, you haven't found the algorithm; you've found a black box with a label.

Start With the Salad Dressing: Writing Your Own Algorithm

The quickest way to understand algorithms is to write one, and the quickest algorithm to write is a recipe step you already do by feel. Making a vinaigrette is a perfect starter: three parts oil, one part vinegar, salt, mustard to emulsify, whisk until combined. That's an input list, an ordered process, and a verifiable output — the dressing either holds together or it doesn't. Convert a feel-based routine into written rules and you'll hit every classic failure the professionals hit.

1: Name the inputs precisely. "Oil and vinegar" fails; "three tablespoons olive oil, one tablespoon red wine vinegar" succeeds. Units and quantities are part of the algorithm, not decoration. 2: Order the steps so each depends on the previous result. Whisk mustard and vinegar first, then drizzle oil while whisking. Reverse the order and the emulsion breaks. 3: Define every vague term. "Whisk until combined" becomes "whisk for about 30 seconds, until the mixture looks uniformly cloudy." The reader — or the machine — must be able to tell when the step is done. 4: State the stopping condition and what to do when it fails. If the dressing separates, the procedure says: add a teaspoon of water and whisk again. Good algorithms carry their own recovery rules.

Run through those four steps once and the failure mode becomes obvious: most of your daily routines quietly skip step three. You know when the dressing "looks right" because you have years of practice. An algorithm has no practice. It needs the condition spelled out, which is exactly why automated systems ask for your height in centimeters rather than "tall."

The same discipline pays off when you hand a task to a colleague. A procedure with named inputs, ordered steps, done-conditions, and a recovery rule can be executed by someone who has never done the job. That's the definition working for you.

Where Algorithms Fail: The Feeding-Schedule Mismatch

The most educational real-world algorithm story is about input, not logic. On March 17, 2025, London's Metropolitan Police announced it had shelved a data project after a review by the Mayor's Office for Policing and Crime found serious flaws. The system was built to flag families at risk of truancy, and it drew on school attendance records — but, as reported in the aftermath by the Financial Times and covered widely by BBC News, a family that had missed the check-in window could be misread as evasive rather than simply missed. The rule wasn't malfunctioning. The input meant something different than the rule assumed.

That mismatch is the single most common failure in applied algorithms, and it's worth stating plainly: the logic can be perfect while the data is wrong in context. Attendance data has a meaning inside a school office. Copied into a fraud-style scoring model, the same number can mean something a human would never infer. This is why experienced data teams spend more time on "what does this field actually represent?" than on the math.

The failure compound: a review board, a press cycle, and a program that had already run. The hard lesson, from the Met's case, is that the review caught the flaw — but only after the system was built. The cheapest place to catch a data-meaning mismatch is the input step, before any rule runs. The Met's own account, as reported, points to the same lesson.

For your own use, run the check on any service that judges you: ask what field the decision depended on. If the answer is "attendance," "purchase history," or "click behavior," ask what else that field could mean. A checkout alert on a few grams of broccoli is harmless. A flag built on a field that could mean two different things is not.

Algorithms That Hurt: Why a Sorting Rule Needs a Visibility Audit

Here's the boundary that turns this from trivia into useful knowledge. A navigation algorithm that picks a slower route costs you eleven minutes. An algorithm that decides who sees a job posting, a loan offer, or a school placement costs people opportunity. In November 2022, the Washington Post reported on a study finding that Amazon's same-day delivery algorithm left predominantly Black neighborhoods in several major cities out of the service area. The procedure was optimizing delivery efficiency and staffing. What it produced was a map of who got what.

That case matters because the algorithm was doing exactly what it was designed to do, efficiently, and the result was still unfair. Efficiency and fairness are separate outputs of the same procedure, and the procedure graded on efficiency alone will report success while the fairness column says otherwise. This is the argument for auditing outcomes, not just code.

Financial risk scoring carries the same shape. A model that scores creditworthiness is a procedure on input data, and if the input reflects historical lending patterns, the output can reproduce the pattern. The trouble is that the model cannot tell the difference between "this person is a risk" and "this group was historically denied loans." Same number, different meaning — the feeding-schedule mismatch again, at scale.

If you work anywhere that decisions get made by procedure, the practical audit is one question: does the output track who gets things, and does the pattern follow anything other than the thing we meant to measure? Ask it early. Retrofitting fairness onto a running system costs more than checking the input meaning before the rules run.

Cost and Trade-Offs: Why the Same Problem Has Several Right Answers

The practical reason to learn a little algorithm vocabulary is that everyday decisions are trade-offs between cost and time, and naming them helps you choose. Routing is the cleanest illustration: the shortest-path procedure Dijkstra published in 1959 guarantees the fastest route, and modern navigation apps use variants tuned for huge road networks — the same guarantee, computed faster. "Faster" here means less computation, and in everyday terms less battery and a snappier route refresh.

Compare two very different procedures for finding the best route. Dijkstra's approach explores outward from the start, guaranteeing the optimum and doing systematic work along the way. A heuristic approach like A* uses a shortcut estimate to skip parts of the search, which speeds things up and can trade exactness for speed depending on the estimate. For a commute, that trade is fine. For an air-traffic routing problem, it might not be.

The cost computation worth internalizing: every procedure pays in some currency — steps, time, energy, memory. The self-checkout procedure pays in a few extra seconds so the store pays less for shrinkage. Your spam filter pays in processing so your inbox stays readable. When someone says "the algorithm is slow," ask which currency they mean. A slow procedure with fewer steps isn't slow at all.

You can run the same trade-off yourself at the grocery store. The "shortest line" rule is Dijkstra-like: scan every checkout lane, estimate items per person, pick the minimum. The "familiar lane" rule is a heuristic: skip the scan, use your usual lane, accept the occasional wrong guess. On a quick trip, the heuristic wins. On a big shop, the scan wins. That decision is yours to make, which is the whole point of understanding the procedure under it.

The Question to Ask Any Time a Recommendation Surprises You

The useful thing to carry away is a single diagnostic. When an algorithm's choice surprises you, don't ask "is it broken?" Ask: what input produced this, and does that input mean what the rules assume? The commute detour answered with traffic-light counts. The Met case answered with a check-in window. The self-checkout alert answered with a few grams of weight.

This question also protects you from over-trusting. Algorithms are procedures, and procedures are only as good as their premises. The navigation app doesn't know about the school bus. The spam filter doesn't know about the sender you actually know. The recommendation row doesn't know you watched the documentary for work. Naming the missing input converts a mysterious judgment into a fixable one.

And the reverse is true too — over-distrusting is its own mistake. The algorithm that routes you today has driven that road network millions of times. Its procedure, applied consistently, outperforms a single brain's experience on almost every metric it was built for. The skill is knowing which metric that is, and whether it's the one you care about.

FAQ

Can an algorithm exist without a computer?

Yes — a hand-written recipe, a chess opening sequence, or a traffic-light timing chart are all complete algorithms. The term predates computing by roughly a thousand years, and anything executed by a person following deterministic steps qualifies. The computer just executes the same procedure faster and more consistently.

Is a flowchart an algorithm?

A flowchart can represent one, but a flowchart isn't the algorithm itself — it's a drawing of the procedure. What makes it an algorithm is whether the flow has defined inputs, ordered steps, and a stopping condition. A flowchart with an ambiguous "decide now" box fails the test at the same point a vague recipe does.

How do algorithms decide what I see on social media?

Ranking systems score each post against predictions of what you'll engage with, then order the feed by score — a procedure on your past behavior as input. The rules are partly hand-set policy and partly learned patterns, which is why the feed can change when you act unusually. The one-tap "show less like this" option is you editing the input.

What happens when a ranking algorithm gets its data wrong?

It produces a confident, wrong answer — and typically keeps producing it until someone checks the input. The London Met truancy-flagging project, shut down after a review found that attendance data could be misread, showed the failure at scale. The procedure didn't crash. It just ranked based on a field that meant two things.

Are algorithms always more accurate than human judgment?

No — accuracy depends on whether the task is defined well enough for rules to apply and whether the input is trustworthy. A rule-based procedure beats a human at scanning a thousand checkout lanes, and loses badly at reading a family's circumstances. The right question is whether your metric matches what you actually care about.

Why does a streaming service recommend something completely unlike my taste?

One outlier click is usually enough — the procedure treats a single watch as evidence of preference and weighs it until more history dilutes it. That behavior is the same mechanism that makes recommendations useful most of the time, which is why the fix is a few fresh actions rather than resetting everything. The procedure can't tell curiosity from preference.

What is the difference between an algorithm and an AI model, in one line?

An algorithm is a procedure; an AI model is a procedure whose rules were tuned by examples instead of written by hand, which makes it harder to inspect. Both can be audited by outcome — checking whether the results track the thing you meant to measure — even when the internal rules resist reading.