An algorithm is a finite set of step-by-step instructions designed to accomplish a specific task or solve a specific problem. The concept predates computers by centuries: a recipe for bread, a method for long division, and a set of driving directions are all algorithms in the broadest sense. Today, the word usually surfaces in conversations about technology, where algorithms power everything from search engines to stock trading to the recommendations on your phone. But the core idea is deceptively simple, and understanding it makes the more complex, sometimes controversial applications much easier to grasp.
Algorithms You Already Follow
If you have ever sorted a hand of playing cards from lowest to highest, you executed an algorithm. You probably picked up each new card, compared it to the ones you already held, and slid it into the right spot. Computer scientists call that an insertion sort. The fact that you did it without thinking about it as “an algorithm” is the point: algorithms are just organized procedures for getting from a starting state to a desired outcome.
What makes an algorithm different from a vague suggestion like “figure it out” is that it has to be unambiguous. Each step must be clear enough that anyone, or any machine, following the instructions would produce the same result given the same input. A recipe that says “add salt to taste” is fuzzy; one that says “add half a teaspoon of salt” is algorithmic. That precision is what allows computers to execute algorithms billions of times per second without getting confused.
Algorithms also have to terminate. They need a defined stopping point. An instruction set that says “keep dividing by two forever” is not an algorithm because it never finishes. This requirement seems obvious, but it becomes surprisingly important when algorithms get complex, and it turns out that predicting whether a given program will ever stop is one of the deepest unsolved problems in computer science.
How Social Media Feeds Get Built
When people complain about “the algorithm,” they are usually talking about the software that decides what appears on their social media feed. These are recommendation algorithms, and they work by tracking your behavior, including what you click on, how long you linger, what you share, and what you skip, then using that data to predict what you are most likely to engage with next.
The algorithms running major platforms are designed to optimize specific metrics, and those metrics are typically chosen to maximize advertising revenue rather than to benefit users psychologically or socially.1PubMed Central. Social Drivers and Algorithmic Mechanisms on Digital Media That is why your feed can feel eerily tuned to your interests: the system is built to keep you scrolling, because more time on the platform means more ad impressions. Content that provokes strong emotional reactions, whether outrage, amusement, or curiosity, tends to generate more engagement, so the algorithm surfaces more of it.
This creates a feedback loop. You engage with a certain type of content, the algorithm shows you more of it, and your engagement deepens. Over time, what feels like a window onto the world becomes a mirror reflecting your existing preferences back at you. The algorithm is not trying to inform or mislead you; it is trying to hold your attention. The consequences, filter bubbles, polarization, rabbit holes of increasingly extreme content, are side effects of an optimization target that was never designed with those concerns in mind.
Algorithms on Wall Street
Financial markets are another domain where algorithms have become the dominant players. Algorithmic trading refers to any strategy where a computer automatically executes trades based on predefined rules: buy when a stock dips below a certain price, sell when it rises past a threshold, or exploit tiny price differences between exchanges faster than any human could. High-frequency trading, a subset of algorithmic trading, pushes this further by executing thousands of trades per second using ultra-fast connections and specialized hardware.2Transactions on Economics, Business and Management Research. Algorithms and High-Frequency Trading in Financial Markets
These systems have reshaped how markets function. Research on the introduction of high-frequency trading across European equity markets found that it significantly increased how closely different stocks moved together in both returns and liquidity. Roughly a third of that increased co-movement came from faster spreading of market-wide information, a genuine improvement in market efficiency. The remaining two-thirds, though, was attributed to the correlated strategies of the trading algorithms themselves, meaning the machines were partly creating the patterns they were responding to.3Journal of Financial Markets. High-frequency trading
The speed advantage is real but double-edged. Algorithmic trading increases market liquidity and reduces certain kinds of human error, but it also introduces systemic risks. Flash crashes, where prices plummet and recover within minutes for no fundamental reason, are almost always traced back to cascading algorithmic reactions. The algorithms are individually rational but collectively unpredictable, a recurring theme whenever simple rules interact at massive scale.
When Algorithms Make Biased Decisions
Algorithms increasingly make or influence decisions that matter to people’s lives: who gets a loan, who sees a job listing, who gets flagged by law enforcement, whose insurance claim gets approved. The promise is that automated decision-making removes human prejudice by following objective rules. The reality is more complicated, because algorithms learn from historical data, and historical data is full of human bias.
If a hiring algorithm is trained on a decade of hiring decisions at a company that overwhelmingly hired men for engineering roles, the algorithm will learn that maleness is a predictor of being hired. It is not “deciding” to be sexist; it is finding the statistical pattern in the data it was given. The result is the same, though: qualified women get filtered out. Research into the causes of bias in AI systems has highlighted that these problems extend across lending, criminal justice, healthcare, and other sensitive domains, with real consequences for individuals and communities.4INTERANTIONAL JOURNAL OF SCIENTIFIC RESEARCH IN ENGINEERING AND MANAGEMENT. Ethical Considerations in Artificial Intelligence: Addressing Bias and Fairness in Algorithmic Decision-Making
Recognizing this, regulators have started catching up. In both the United States and the European Union, proposed legislation would require developers of automated decision systems to assess their systems’ impacts on individuals and communities, going beyond purely technical evaluations to examine social, economic, and ethical effects.5PubMed Central. Obligations to assess: Recent trends in AI accountability regulations The EU’s AI Act, for instance, classifies AI systems by risk level and imposes stricter requirements on “high-risk” applications like those used in employment or law enforcement. Whether regulation can keep pace with deployment is an open question, but the direction is clear: the era of shipping algorithms without accountability is ending.
Algorithms Found in Nature
One of the more striking insights from the past few decades is that algorithms are not exclusively human inventions. Biological systems solve computational problems all the time, often with remarkable efficiency. Ant colonies find shortest paths to food sources through a decentralized process where individual ants lay pheromone trails and reinforce the fastest routes. Immune systems identify and respond to novel threats through a process that resembles a search algorithm. Researchers have argued that studying the convergence between biological processes and computational thinking can illuminate both fields, revealing shared mechanisms for coordination, network analysis, and tracking.6PubMed Central. Algorithms in nature: the convergence of systems biology and computational thinking
Perhaps the most famous example is the slime mold Physarum polycephalum, a single-celled organism with no brain, no nervous system, and no apparent capacity for “thought.” When researchers placed food sources at locations corresponding to cities around Tokyo and let the slime mold grow between them, it formed a network that closely resembled the actual Tokyo rail system, an efficient solution to a notoriously difficult optimization problem. The organism’s adaptive transport network has been formally modeled and used as a basis for path-finding in complicated road maps and mazes.7Physica A: Statistical Mechanics and its Applications. Physarum solver: A biologically inspired method of road-network navigation
These biological algorithms are not metaphors. They genuinely solve optimization problems, and engineers have borrowed from them to design real software. Ant colony optimization and genetic algorithms are established techniques in computer science, directly inspired by watching nature compute without a computer.
Why Humans Struggle to Think Like Computers
Given that algorithms are just step-by-step instructions, you might expect humans to be good at following them. We are not. Ask someone to alphabetize a long list of names and they will make errors that a computer never would: transposing letters, losing their place, getting distracted. The gap between human and machine execution is not about intelligence but about architecture.
Human mental representations are distributed and graded rather than discrete and exact. When you process information, you never fully abstract away from the specifics of the input, which means context always bleeds in. This is why you might sort a list differently depending on whether the names are of people you know or strangers, even when the task is purely alphabetical. That sensitivity to context is what gives human cognition its remarkable flexibility, allowing you to handle ambiguous situations, make creative leaps, and adapt to new problems on the fly. But it comes at the cost of poor performance on context-free computation, the kind of rigid, repetitive rule-following that algorithms demand.8PubMed. The difficulties of executing simple algorithms: why brains make mistakes computers don’t
This raises a deeper question about whether human thinking is algorithmic at all. The computational theory of mind, the idea that thought consists of executing mental algorithms, has been influential in cognitive science. But some researchers have pushed back, arguing that algorithmic processing is at best one rather specialized mode of thinking, not the foundation of all cognition.9Pragmatics & Cognition. Mental Algorithms Much of what we do, recognizing faces, understanding jokes, navigating social dynamics, does not feel like following a set of instructions, and attempts to reduce it to step-by-step procedures have had limited success. The brain is doing something, but whether that something is best described as “computing” remains a genuinely open philosophical question.
Problems That Break Algorithms
Not every problem has a good algorithmic solution, and recognizing this is one of the most important ideas in computer science. Some problems are so computationally demanding that no known algorithm can solve them efficiently as they grow larger. Scheduling problems are a classic example: figuring out the optimal way to assign jobs to machines, accounting for varying processing times and resource constraints, belongs to a class of problems considered intractable in the technical sense. For small instances you can brute-force a solution, but as the number of variables grows, the time required explodes. Researchers rely on heuristic algorithms, which are procedures designed to find good-enough solutions quickly rather than perfect solutions slowly, to handle real-world versions of these problems.10Computers & Industrial Engineering. Heuristic algorithms for solving a set of NP-hard single-machine scheduling problems with resource-dependent processing times
Then there are problems that are not just hard but provably unsolvable. The most famous is the halting problem: given an arbitrary program and an input, can you write an algorithm that determines whether the program will eventually stop or run forever? The answer, proven by Alan Turing in 1936, is no. No such algorithm can exist. More recent work has explored why this is the case from an information-theoretic perspective, linking the halting problem to the irreversible loss of information during computation. When a program erases intermediate data as it runs, the information needed to predict its final behavior disappears, making the outcome fundamentally unpredictable.11arXiv. Arithmetic logical Irreversibility and the Turing’s Halt Problem
These limits are not just academic curiosities. Every time a programmer writes a complex system, they are bumping up against the reality that you cannot always prove the system will behave correctly. Software testing, code review, and formal verification are all workarounds for the fact that a truly general-purpose “does this program work?” algorithm is mathematically impossible.
Divide and Conquer, and Other Algorithmic Strategies
When an algorithm does exist for a problem, the way it approaches the problem matters enormously for performance. One of the most powerful general strategies is divide and conquer: take a big problem, split it into smaller subproblems, solve each one, and combine the results. Merge sort works this way. You split a list in half, sort each half, and merge the two sorted halves together. The elegance is that the splitting keeps going recursively until you are comparing just two items, which is trivial.
A related technique is dynamic programming, which also breaks problems into subproblems but additionally stores the results of subproblems it has already solved so it never repeats work. This is critical for problems where the same subproblem appears many times over. Research has explored how to systematically transform dynamic programming algorithms into divide-and-conquer versions that run in parallel, taking advantage of modern multi-core processors. These transformed versions can have better memory access patterns and run significantly faster than traditional loop-based implementations.12ACM SIGPLAN Notices. Deriving divide-and-conquer dynamic programming algorithms using solver-aided transformations
Other common strategies include greedy algorithms, which make the locally optimal choice at each step and hope it leads to a globally good solution, and randomized algorithms, which introduce deliberate randomness to avoid worst-case scenarios. No single strategy works for every problem. Choosing the right approach, or recognizing when no efficient approach exists, is the core skill of algorithm design.
Is Everything an Algorithm?
The success of algorithmic thinking has led some thinkers to an ambitious claim: that the universe itself is fundamentally computational, that everything from physics to biology to consciousness can be understood as information processing. This idea, sometimes called pancomputationalism, is appealing in its simplicity. If everything is computation, then understanding algorithms gives you the key to understanding everything.
Philosophers have been skeptical. One analysis proposes two ways to interpret the claim: either the world literally is a computer, or the world can be described as a computer. The first version implies that physical reality depends on computation, which inverts the relationship most scientists assume and runs into serious logical problems. The second version is weaker but ultimately hollow, since describing anything as a computer does not tell you much about the thing itself; it tells you about the flexibility of computational language.13arXiv. Pancomputationalism: Theory or metaphor?
This matters for how you think about algorithms in daily life. When a tech company says “our algorithm decided X,” that framing can make the decision sound objective and inevitable, as if it were a law of nature rather than a set of choices made by engineers about what to optimize and what data to use. Algorithms are powerful tools, but they are tools built by people, reflecting the goals and limitations of their creators. Remembering that distinction is probably the most useful thing anyone can take away from understanding what an algorithm actually is.

