In which the reader is asked, quite simply, What is an Algorithm? — and finds the answer rather older, and rather stranger, than expected.
Being an account of cogs and looms and engines of brass; of Signor Pascal's calculating box and Mr. Babbage's unbuilt Engines; of a certain Lady Lovelace who saw further than most; and of sundry other contrivances got up by ingenious persons long before any machine was called a computer.
Wherein two short films are watched, in the company of a partner to be consulted not once but twice; wherein old Euclid's method is recalled, some two thousand years and more since first he wrote it down; and wherein, at the last, the curious Persian origin of a word now spoken a thousand times a day — one al-Khwarizmi's own — is at length discovered.
Question of the day: What is an algorithm?
You already use the word casually — "the algorithm" recommends your videos, "the algorithm" decides your feed. But what, precisely, is one?
By the end of today's session you'll have a real definition — and you'll know where the word itself came from.
Turn to the person next to you. Two minutes, no googling.
Together, try to answer: what is an algorithm? Give one example each, if you can.
Don't worry about being "right" — we'll come back to this twice more today, and compare notes.
Before the word, there were the machines. Crash Course Computer Science #1: Early Computing — from the abacus to Herman Hollerith's punch cards.
What surprised you?
Notice how many of these — the abacus, Pascal's calculator, the Jacquard loom, Babbage's engines — are not computers in our sense at all. They're physical machines for carrying out a fixed, repeatable procedure.
That procedure, independent of whatever metal or wood or silicon carries it out, is the thing we're actually interested in today.
Strip away the brass gears, the steam, the punch cards — what's left in each of those machines is the same abstract thing: a precise, repeatable sequence of steps that turns some input into some output.
That sequence of steps is an algorithm. The machine is just one possible body for it to live in.
An algorithm is a finite, well-defined sequence of steps that transforms a given input into a desired output.
Finite — it has to actually end, eventually.
Well-defined — each step is unambiguous; anyone, or anything, following it correctly gets the same result.
Input / output — it does something to something.
You run algorithms all the time without a computer in sight.
A recipe: fixed steps, specific ingredients (input), a finished dish (output).
Long division, tying your shoelaces, the instructions for assembling furniture — all algorithms, in the strict sense.
Computers didn't invent algorithms. They just got extremely good at running them fast.
Euclid described an algorithm for finding the greatest common divisor of two numbers around 300 BCE — still taught today, still called Euclid's algorithm.
Long division as you learned it in school is centuries old. Knitting patterns are algorithms. So is a court protocol, or a recipe passed down for generations.
The concept is ancient. Only the name is comparatively recent — and it has a surprisingly specific origin.
Back to your partner. Compare: how close was your first guess to the definition we just built together?
This time, try to name an algorithm from your own daily life that has nothing to do with computers.
"Algorithm" doesn't come from Greek, like most technical vocabulary in mathematics. It comes from a name.
Whose?
A short answer, in under three minutes — BBC Ideas: Why algorithms are called algorithms.
Muhammad ibn Musa al-Khwarizmi, a 9th-century Persian scholar working in Baghdad's House of Wisdom, wrote a treatise on systematic methods for solving equations.
His name, Latinized centuries later as "algorithmi," became attached to the step-by-step methods he described — and eventually to the general concept itself.
(His other book's title gave us a second word: al-jabr — "algebra.")
Rewind two centuries. Long before Babbage, long before steam, the same ancient appetite for mechanizing the mind was already stirring — in the Baroque.
In 1642, at nineteen, Blaise Pascal built the Pascaline to help his father with tax calculations — a gear-driven adding machine, among the first of its kind ever built and sold.
A generation later, Gottfried Wilhelm Leibniz — one of the last true polymaths, equally at home in philosophy, law, and mathematics — went further still, designing the Stepped Reckoner: a machine that could multiply and divide, not merely add and subtract.
Leibniz wanted more than a calculator. He dreamed of a calculus ratiocinator — a universal symbolic method by which any dispute, of any kind, could in principle be settled by calculation alone: "Let us calculate."
Cogs and steam would eventually belong to Babbage's century. But the dream — that reasoning itself might be mechanized — is, properly speaking, Baroque.
By the early 1800s, the Industrial Revolution had already proven something remarkable: steam and gearwork could replace human muscle at scale.
Joseph-Marie Jacquard's loom (1801) went one step further — it replaced not just labor, but a kind of decision-making. A chain of punched cards, read mechanically, told the loom exactly which threads to raise for every single pass of the shuttle.
Change the cards, change the pattern. The procedure — the algorithm — was now separate from the machine that executed it, encoded on something you could hold in your hands.
Babbage noticed. He planned to use these very same punched cards to feed instructions into his own Analytical Engine.
Charles Babbage (1791–1871) — mathematician, philosopher, mechanical engineer, and by most accounts a thoroughly restless Victorian gentleman.
His Difference Engine was a mechanical calculator, designed to compute polynomial values automatically — and to print the results, removing human error from mathematical tables.
His far more ambitious Analytical Engine was something else entirely: a general-purpose, programmable computer — a century before electronics made one practical. It had a "mill" (processor), a "store" (memory), and was to be fed instructions on Jacquard-style punched cards.
He never finished building it. But he had, in effect, designed a computer.
Augusta Ada King, Countess of Lovelace (1815–1852), daughter of Lord Byron, was trained rigorously in mathematics from childhood — and became Babbage's closest intellectual collaborator.
In 1843, translating an Italian paper on the Analytical Engine, she added her own notes — three times longer than the original text. Among them: a step-by-step method for the Engine to compute Bernoulli numbers.
That method is widely considered the first published algorithm written specifically for a machine — making Lovelace, by most accounts, the first computer programmer, over a century before there was a computer to run it on.
She also saw further than Babbage himself: the Engine, she wrote, might one day manipulate not just numbers, but music and symbols of any kind. Others called her the Enchantress of Numbers.
One more figure worth knowing, even briefly: George Boole (1815–1864), who in 1854 published The Laws of Thought — reducing logical reasoning itself to a kind of algebra, with only two values: true and false.
Boolean algebra sat unused for decades as a philosophical curiosity. In the 20th century it became the literal switching logic inside every digital circuit ever built.
Babbage's engine, Lovelace's program, Boole's logic — three separate threads in the 1800s, waiting nearly a hundred years for electronics to braid them together. We'll pick that thread up again later in this course.
Today: a definition, a history, a name.
Next week: Alan and his Enigma — the story of Alan Turing, his machine(s), and his test(s).
We'll meet the Turing machine that finally gave "algorithm" a single, rigorous, universal meaning — and ask what happens when the body running one never gets tired, never gets bored, and never stops.