Notes on Algorithms: The First Computer Program
Babbage’s Vision: Store, Mill, and Cards
Charles Babbage conceived the Analytical Engine in 1837, after abandoning his Difference Engine. The architecture was revolutionary, anticipating modern computers by over a century.
The Store contained 1000 columns, each holding 40 decimal digits—approximately 167 kilobits of memory. Variables through could be manipulated and recalled. The Mill performed arithmetic: addition, subtraction, multiplication, and division, with later designs including square roots. Data transferred between Store and Mill as needed.
Control came through punched cards—a concept borrowed from Joseph Marie Jacquard’s loom, invented in 1801. Jacquard’s cards contained holes that controlled warp threads, weaving intricate patterns automatically. Similarly, the Analytical Engine used operation cards to specify instructions, variable cards to designate operands, and number cards to supply constants. Chains of cards formed programs.
Most remarkably, the Engine supported conditional branching. Cards could skip forward or backward based on whether the Mill’s result was positive, negative, or zero. This enabled loops and if-then logic, making the design Turing-complete—capable of universal computation.
The Engine was never built. Victorian technology could not achieve the required precision and complexity. Babbage spent decades on it; the government withdrew funding. Partial assemblies exist, and in 1991 the Science Museum in London successfully constructed Difference Engine No. 2, proving Babbage’s designs were sound. But the Analytical Engine remains unbuilt, existing only in blueprints and imagination.
The modern equivalent is the von Neumann architecture, conceived in 1945: separate memory and CPU, stored program, sequential execution. This parallels Babbage’s 1837 conception closely. Punched cards persisted in computing through IBM mainframes into the 1970s, a legacy of Jacquard and Babbage.
Note G: The First Computer Program
In 1842, Luigi Menabrea, an Italian mathematician, published a paper describing the Analytical Engine in French. I translated it to English in 1843 and added extensive notes labeled A through G. These notes were three times longer than the original paper.
Note G contains what is now recognized as the first computer program: an algorithm to compute Bernoulli numbers using the Analytical Engine.
Bernoulli numbers form the sequence , , , , and so on. They appear in power series expansions, the Riemann zeta function, and the Euler-Maclaurin formula. They are computed via a recursive formula involving binomial coefficients.
My algorithm calculates using 21 operations. I used variables through and auxiliary variables through , tracking each step. The structure includes initialization—setting and from number cards. A loop iterates from to 6, calculating the binomial coefficient , multiplying by previous , and accumulating the sum. Conditional operations skip unnecessary computations if certain columns hold zero, improving efficiency. Finally, the result is printed.
This was the first published algorithm intended for machine execution, predating Turing’s formalization of computation by 93 years. While Turing machines are abstract, my program was concrete, with operational details specified.
I introduced notation resembling modern flowcharts: columns labeled, operations sequenced, arrows indicating data flow. This anticipated contemporary programming documentation by over a century.
Importantly, I caught an error in Babbage’s original design. His proposed mechanism for handling negative results was incorrect. I identified the flaw and suggested a fix, demonstrating deep understanding beyond mere transcription or explanation.
Beyond Calculation: Symbolic Imagination
My vision extended far beyond arithmetic. In Note A, I wrote:
“The Analytical Engine might act upon other things besides number… Supposing, for instance, that the fundamental relations of pitched sounds in the science of harmony and of musical composition were susceptible of such expression and adaptations, the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent.”
This was prescient. Modern computers do exactly this—compose music, generate art, manipulate symbols of all kinds.
Variables need not represent numbers. They can symbolize anything: in algebra, notes in music (C-E-G for a chord), logical propositions (), graph structures. Operations are defined formally: group theory operations, Boolean algebra, graph algorithms. Anything formalizable is computable.
I called this “poetical science”—the synthesis of imagination and logic. Poetry is creative; science is rigorous. Computation requires both. An algorithm is an imaginative structure expressed with rigor. I saw this in 1843 when others viewed the Engine merely as a glorified calculator.
Yet I also recognized limitations. I wrote: “The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform.”
This is the Lovelace objection: machines cannot create; they only execute instructions. The modern debate continues. Does GPT-3 “create” novel text, or does it recombine patterns from training data? Did AlphaGo “invent” new Go strategies, or did it discover them through gradient descent? My objection remains philosophically relevant.
My mathematical background was unusual for a woman in the 1840s. Augustus De Morgan tutored me in logic and algebra. Mary Somerville, a friend of my mother’s, taught me astronomy and mathematics. I self-studied advanced topics like calculus and differential equations to understand the Analytical Engine’s operation. My mother feared I would inherit my father Lord Byron’s poetic “madness,” so she emphasized mathematics as a stabilizing influence. Instead, I united poetry and mathematics, embodying both.
Poetical Science Vindicated
For over a century, my contributions were forgotten. Babbage overshadowed me, and Victorian gender bias dismissed a woman’s technical work. In 1953, B.V. Bowden republished Note G in Faster Than Thought, finally recognizing the first program. Prior mentions were minimal.
Modern recognition came with the Ada programming language, created by the U.S. Department of Defense in 1979. Designed for embedded systems with real-time constraints, type safety, and concurrency, it was named in my honor. The British Computer Society awards the annual Lovelace Medal for contributions to computing. Ada Lovelace Day, celebrated on the second Tuesday of October, honors women in STEM internationally.
The Analytical Engine inspired spiritual successors. Alan Turing’s 1936 formalization introduced the Turing machine: an abstract device with tape, head, and state, capable of universal computation. The Church-Turing thesis holds that Babbage’s Engine, though mechanical, was Turing-complete.
ENIAC, completed in 1945, was the first electronic programmable computer, using vacuum tubes and decimal arithmetic. Early programming used patch cables. The von Neumann architecture, storing programs in memory alongside data, parallels Babbage’s design and underpins modern CPUs.
My prescience lay in recognizing that software is separate from hardware. Programs are punched cards; the machine is the Engine. This abstraction layer enables general-purpose computation. I understood universality: anything formalizable is computable, with limitations only in our ability to formalize. I imagined creative applications—composition, symbolic reasoning, artificial intelligence—all realized in the 21st century.
A counterfactual question arises: had the Analytical Engine been built, would computing history have advanced decades earlier? Probably not. Victorian technology was insufficient for practical large-scale computation. Punched cards were too slow; mechanical components too unreliable. The electronic revolution of the 1940s was necessary for computing to become transformative. But the conceptual foundations were established in 1843, waiting for technology to catch up.
I translated Menabrea’s paper and appended notes longer than the original, containing the first algorithm, the first debugging, the first vision of symbolic computation, and the first philosophical objection to machine creativity. I called it poetical science—imagination constrained by rigor, creativity expressed through logic. Modern computing vindicates this synthesis. Every program written today echoes the vision I articulated 180 years ago: that machines weave algebraic patterns as the Jacquard loom weaves flowers and leaves, and that the only limit is what we can imagine and formalize.
Source Notes
9 notes from 2 channels
Source Notes
9 notes from 2 channels