| Invention Name | Ada Lovelace’s Published Analytical Engine Algorithm, commonly identified with Note G |
|---|---|
| Short Definition | A published table and explanation showing how Babbage’s proposed Analytical Engine could carry out an ordered calculation of Bernoulli numbers. |
| Approximate Date or Period | 1843 Confirmed publication date |
| Geography | London, England, with the publication history also linked to Babbage’s 1840 presentations in Turin and Luigi Menabrea’s 1842 French paper |
| Author or Source Culture | Ada Lovelace, working from Menabrea’s account of Charles Babbage’s Analytical Engine and in close collaboration with Babbage |
| Category | Computing history; algorithms; programmable machines; mathematics |
| Importance | One of the earliest published, detailed demonstrations of how a programmable general-purpose calculating machine could execute an ordered mathematical procedure |
| Evidence Status | Published evidence survives Attribution terminology debated |
| Main Problem Solved | Expressing a multi-stage Bernoulli-number calculation as operations, stored quantities, repeated instruction groups, and machine-directed data movement |
| Development Path | Babbage’s Analytical Engine designs and earlier operation traces → Menabrea’s 1842 description → Lovelace’s 1843 translation and Notes A–G → later interpretation as an early program |
| Technical Basis | Operation cards, variable columns, arithmetic operations, stored intermediate values, and repeated cycles |
| Central Historical Debate | Whether Lovelace should be called the “first computer programmer,” rather than more narrowly the author of a landmark published machine procedure |
Ada Lovelace is often introduced with a compact claim: she wrote the first computer program. The surviving record is more precise and more interesting. In 1843 she published an English translation of Luigi Federico Menabrea’s description of Charles Babbage’s proposed Analytical Engine, followed by seven extensive notes of her own. The final note, Note G, included a table describing how the Engine could calculate Bernoulli numbers through a sequence of machine operations.
That table deserves its place in computing history, but several different claims are often compressed into one. Lovelace did not invent algorithms. She did not design the Analytical Engine. Babbage had written machine-operation schemes before her publication. The Engine was never completed and Note G was never executed on the machine for which it was written. Even so, Lovelace helped turn Babbage’s mechanical architecture into a published account of how a general-purpose calculating machine could be instructed step by step.
The strongest historical case for Lovelace rests on that distinction: what was published in 1843, how the procedure was expressed, how she interpreted programmable machinery, and how her contribution differed from Babbage’s.
The 1843 Publication Was Not Simply Lovelace’s Translation
The document that made Lovelace famous began with someone else’s paper. In 1840, Charles Babbage traveled to Turin and presented the principles of his Analytical Engine to a group of scientists and engineers. Luigi Federico Menabrea, then a young Italian engineer and later prime minister of Italy, prepared a French account based on those discussions. It appeared in the Bibliothèque Universelle de Genève in 1842.
Lovelace translated Menabrea’s paper into English the following year. At Babbage’s suggestion, she also attached explanatory notes identified by the letters A through G. These additions grew far beyond the role of ordinary translator’s comments. Babbage later wrote that the notes were about three times the length of Menabrea’s original memoir.
The resulting 1843 publication therefore had several intellectual layers. Babbage supplied the machine and its evolving system of operation. Menabrea supplied the first published account. Lovelace translated that account, expanded its technical explanation, discussed how the Engine could be instructed, explored possible uses beyond ordinary numerical calculation, and ended with the elaborate Bernoulli-number example.
This layered authorship matters because describing the entire publication as either “Lovelace’s program” or “Babbage’s work” removes the collaboration visible in the surviving documents.
Babbage Was Writing Machine Procedures Before Note G
The Analytical Engine was already being treated as a programmable machine before the 1843 paper appeared. Science Museum Group records preserve numerous sheets of Babbage’s mathematical and mechanical notation. One archival series contains 27 sets of calculation notations made between 1836 and 1840, described as walk-throughs or traces of programs for the Analytical Engine. A larger series contains hundreds of notations concerned with arithmetic algorithms, sequence control, and changing versions of the Engine.
This evidence rules out a broad claim that Lovelace was the first person ever to devise an ordered calculation for Babbage’s machine. Babbage had done so earlier, although much of that work remained in manuscripts rather than circulating as a public description of programming.
The distinction between earliest surviving machine procedures and a published machine algorithm is therefore central to the question of priority. Lovelace’s historical position becomes clearer when publication is included in the claim.
Her 1843 material brought a detailed procedure into print, connected it directly to the operation of a proposed general-purpose machine, and explained what such sequences meant for the wider possibilities of automated calculation.
What Note G Actually Contains
Note G is much more than a formula for Bernoulli numbers. It follows quantities as they move through the Engine’s proposed variable columns, identifies arithmetic operations, records intermediate results, and specifies when groups of operations must be used again.
Babbage’s machine separated several functions that would later become familiar in computing. The store held numerical quantities. The mill performed arithmetic. Punched cards were intended to control operations and determine which variable columns supplied or received quantities.
Lovelace’s table translated a mathematical calculation into that machinery. Each row identifies an operation such as addition, subtraction, multiplication, or division. It also identifies the variable columns involved and the destination of the result. The accompanying text explains how the cards could be arranged so that the same machinery followed the required mathematical sequence.
It is this conversion from mathematics into machine-directed operations that makes Note G relevant to programming history.
Why Bernoulli Numbers Were Used
Bernoulli numbers form a mathematical sequence that appears in subjects including series expansions and the summation of powers. Lovelace did not select the example because Bernoulli numbers were themselves a new discovery. They had been studied long before the Analytical Engine.
The useful feature was procedural complexity. A later Bernoulli number could be derived through calculations involving earlier values and a sequence of intermediate expressions. That made the example suitable for demonstrating how the Engine could manage stored quantities, repeated operations, and changing intermediate results.
Note G states that the Bernoulli calculation was chosen as a comparatively complicated example of the Engine’s capabilities. The objective was therefore demonstrative as well as mathematical: show how a machine could organize a calculation whose successive stages depended on one another.
The Table Behaves Like a Machine Execution Trace
Calling the Note G diagram “code” without qualification can create the wrong mental image. It does not resemble a modern programming language. There are no text commands such as while, for, or return. The document instead records how an imagined mechanical computer would progress through operations and variable columns.
The V labels in the diagram identify variable columns in the Engine. A quantity may occupy a column, be sent to the mill for an arithmetic operation, and then be returned or placed elsewhere. Superscript-like markings track successive values associated with a variable column as the computation progresses.
This gives the document qualities familiar from later programming practice:
- an ordered sequence of operations;
- named locations holding values;
- distinction between input quantities and intermediate results;
- reuse of previously calculated values;
- repetition of groups of instructions;
- control decisions determined by the state of a calculation.
It is more historically accurate to understand the table as a detailed machine procedure or execution plan than as Victorian source code written in a modern language.
Operations 13–23 Show Why Note G Resembles Programming
The most revealing part of the Bernoulli procedure is its treatment of repetition. Lovelace did not merely list a long chain of unrelated arithmetic steps. She explicitly identified groups of operations that could recur.
In the explanatory text, a repeated group is called a cycle. Note G states that operations 13 through 23 must be repeated when the calculation advances to further terms. The published diagram even marks the point with the instruction that a repetition of operations thirteen to twenty-three follows.
This is close to what programmers now describe as loop-like control, although applying a modern language keyword directly to the document can hide the mechanical form Lovelace was describing.
The procedure also demonstrates an important property of programmable machines: a repeated calculation does not necessarily require a new physical instruction card for every individual arithmetic action. Lovelace explained that once the arrangement reached the appropriate form, 25 Operation-cards could suffice when n was greater than 2, even as the repeated procedure extended the calculation to later Bernoulli numbers.
That observation separates the number of mathematical operations performed from the number of physical instruction cards required. The cards could be reused through cycles rather than duplicated for every repetition.
Variable Columns Were Part of the Logic
The repetition was not only about arithmetic symbols. The Engine also had to know which quantities supplied each operation and where the result should go. Lovelace discusses the much larger number of Variable-cards needed to direct this movement.
Operations 13–23 could largely act on the same pattern of columns during each repetition, with particular quantities changing as the calculation progressed. This is an early example of thinking about computation as a relationship between operations, storage locations, changing state, and control sequence.
Those concepts should not be treated as proof that Note G was identical to a modern program. They explain why historians of computing see the document as closely related to programming practice.
There Is an Apparent Error in the Published Diagram
The surviving 1843 table also illustrates why historical machine procedures have to be examined line by line rather than repeated from later summaries.
In Operation 4, the table identifies the quantities being divided as the second value of V5 divided by the second value of V4. The same row’s result column, however, gives the mathematical expression (2n − 1) / (2n + 1). Operations 2 and 3 show that V4 holds 2n − 1 while V5 holds 2n + 1. The variable order shown for Operation 4 is therefore reversed relative to the result stated in the same row.
This internal inconsistency is sometimes described as a bug in the first computer program. That label goes further than the evidence permits. The discrepancy is real in the printed table, but the surviving publication by itself does not establish whether Lovelace introduced it, whether it entered while the table was copied, or whether it arose during typesetting.
The safer description is an apparent publication or transcription error in the operational table. It is also evidence that Note G was concrete enough to be checked operationally: the order of two machine variables mattered.
How Much of the Bernoulli Work Belonged to Babbage?
The Bernoulli example was collaborative, and Babbage’s own later account makes a simple sole-authorship story difficult to defend.
In his 1864 autobiography, Babbage recalled suggesting that Lovelace append notes to Menabrea’s translation. He stated that they discussed possible illustrations, while the selection of those illustrations was hers. He also credited her with the algebraic working of the problems in the notes, with one stated exception: he had offered to work on the Bernoulli-number problem himself.
Babbage then added a revealing detail. According to his account, Lovelace returned that work to him after finding a serious error in his process.
This does not mean that Note G should simply be reassigned to Babbage. Producing the mathematics behind an example, arranging it for the architecture of the Analytical Engine, explaining its cycles, deciding how variables would be managed, checking the procedure, and preparing the published presentation are different tasks.
Later scholarship examining Lovelace’s correspondence and the surviving mathematical material has therefore moved away from attempts to make the episode a choice between “Babbage did it” and “Lovelace did it alone.” Thomas J. Misa’s study of the Bernoulli material argues that both made identifiable contributions and that Lovelace did create an ordered sequence of instructions for the calculation.
Lovelace Was Not Merely a Nontechnical Editor
Another older interpretation treated Lovelace as intellectually dependent on Babbage and questioned whether she possessed enough mathematics to contribute substantially to the work. Surviving correspondence with her tutor Augustus De Morgan provides a more detailed picture.
Research by Christopher Hollings, Ursula Martin, and Adrian Rice examined Lovelace’s mathematical correspondence from 1840–1841 and found evidence of sustained work on advanced mathematics rather than a superficial acquaintance with the subject. Her knowledge had limits, as would be expected of someone still studying, but describing her contribution as decorative or purely literary does not fit the surviving record.
The strongest assessment therefore avoids both extremes. Lovelace was neither the inventor of Babbage’s computer nor an irrelevant publicist attached to his project.
“First Algorithm,” “First Program,” and “First Programmer” Are Different Claims
The common dispute becomes easier to resolve when the claims are separated.
| Claim | What the Evidence Supports |
|---|---|
| Lovelace invented the algorithm | No. Mathematical algorithms existed for many centuries before the nineteenth century. |
| Lovelace invented the Analytical Engine | No. Charles Babbage designed the machine and developed its architecture over many years. |
| Lovelace wrote the first procedure ever intended for the Engine | No. Babbage’s surviving notebooks contain earlier operation traces and program-like notations. |
| Note G contains a detailed machine-oriented algorithm | Yes. The published table maps a Bernoulli-number calculation onto operations and variable columns of the Analytical Engine. |
| Lovelace published the first algorithm for Babbage’s machine | This is a well-supported formulation. Her 1843 publication contains the best-known first published detailed algorithm for the Analytical Engine. |
| Lovelace was unquestionably the first computer programmer | Debated. The answer changes according to what counts as programming, whether unpublished Babbage procedures are included, and whether a never-built machine can have a programmer in the later occupational sense. |
The title “first programmer” is therefore useful shorthand only when its limits are understood. The History of Science Museum in Oxford describes the label as somewhat inaccurate, while Science Museum Group records show that Babbage had produced program traces before the 1843 publication.
A narrower statement carries less historical baggage: Lovelace’s 1843 Notes contain a landmark published procedure showing how the Analytical Engine could execute a complex calculation.
Her Broader Contribution Was Not Limited to Bernoulli Numbers
Focusing only on Note G can obscure another part of Lovelace’s work. She understood that the Analytical Engine’s importance did not depend on a particular sequence of numbers. What mattered was whether relationships could be expressed in a form the machine could manipulate.
This appears clearly in Note A. Lovelace argued that if objects other than ordinary quantities could be represented through suitable symbolic relationships, the Engine could operate on those representations. She even considered musical relationships as a hypothetical case.
The idea should not be exaggerated into a claim that Lovelace foresaw every feature of modern digital media. Her argument remained tied to Babbage’s proposed machine and to formal relations that could be expressed for mechanical processing.
Still, the reasoning moves beyond a narrow view of a calculator. Numbers inside the machine need not matter only as quantities. They could stand for something else when the rules governing that something could be formally encoded.
The Jacquard Loom Helped Explain the Idea
Babbage had taken inspiration from the punched-card control associated with the Jacquard weaving system. Lovelace developed the analogy in memorable language, writing that the Analytical Engine could weave “algebraical patterns” as a Jacquard loom produced textile patterns.
The comparison was technically useful. A Jacquard mechanism separated the pattern information from much of the loom’s fixed machinery. Changing the card sequence changed the pattern produced by the same mechanical system.
The Analytical Engine extended that principle into calculation. Operation and Variable cards were intended to control what operations occurred and which quantities participated in them. The analogy does not make the Jacquard loom a computer, but it helps explain the historical path from externally encoded machine control to Babbage’s programmable design.
Lovelace Also Drew a Boundary Around Machine Intelligence
Note G contains a passage that later became associated with debates about artificial intelligence. Lovelace argued that the Analytical Engine could carry out what humans knew how to order it to perform, while denying that the machine itself originated new analytical truths.
Her point was about the relationship between formal instructions and mechanical execution. The Engine could perform processes that were laborious for people, follow complex sequences, and potentially expose mathematical relationships through the act of formalizing them. Yet the source of the analytical rules remained human.
Alan Turing later discussed this position in his 1950 paper on machine intelligence, helping turn it into what became known as the “Lady Lovelace objection.” That later debate should not be projected backward as if Lovelace were writing about twenty-first-century machine learning. Her immediate subject was Babbage’s mechanical Engine and the limits of instructions supplied to it.
What Ada Lovelace Actually Did
Lovelace’s contribution can be described without assigning her achievements that belong to Babbage or to much older mathematics.
She translated Menabrea’s technical description of the Analytical Engine into English and expanded it with Notes A–G. She analyzed how the Engine’s cards, variables, operations, and cycles could work together. She helped present a complex Bernoulli-number procedure in machine-oriented form. She discussed repeated groups of operations in a way closely related to later ideas of iterative control. She distinguished between operation cards and the variable-directed movement of data. She also articulated a broader view in which programmable machinery could act on formally represented relationships rather than functioning only as a device for producing numerical tables.
She did this in collaboration with the man who designed the machine. Babbage had already prepared program-like traces, contributed directly to the Bernoulli work, and remained responsible for the Analytical Engine’s architecture. The publication does not support removing him from the programming history of his own machine.
Nor does the evidence reduce Lovelace to a translator. Her notes became the most developed published nineteenth-century explanation of what programming Babbage’s proposed machine could involve.
For that reason, the historically careful description is more informative than the familiar slogan. Ada Lovelace was an early theorist and practitioner of machine-directed computation whose 1843 Notes contained a landmark published algorithm for the Analytical Engine. Whether that makes her the single “first programmer” depends on a modern definition imposed on nineteenth-century work. What she actually produced survives on the page and can be assessed without relying on the title.
Sources and Verification
- Book, “Sketch of the analytical engine invented by Charles Babbage, Esq.” | Science Museum Group Collection — Museum catalogue record verifying the 1843 London publication, its creators, and the surviving historical object.
- Notations of Calculations for the Analytical Engine | Science Museum Group Collection — Archival record documenting Babbage’s program traces from 1836–1840, which predate Lovelace’s 1843 publication.
- Notations of the Analytical Engine | Science Museum Group Collection — Archival description of Babbage’s surviving algorithmic and sequence-control notation for the Engine.
- Sketch of the Analytical Engine Invented by Charles Babbage, Esq. | Project Gutenberg — Public-domain transcription of the 1843 Menabrea paper with Lovelace’s Notes, used to verify Note G, the Bernoulli table, cycles, card counts, symbolic-processing discussion, and the Operation 4 inconsistency.
- Passages from the Life of a Philosopher | Charles Babbage — Public-domain transcription of Babbage’s 1864 account describing his collaboration with Lovelace, her choice of illustrations, and their work on the Bernoulli example.
- Imagining AI – Babbage & Lovelace | History of Science Museum, University of Oxford — Museum interpretation of the Analytical Engine, Lovelace’s diagram, repeated operations, and the limits of the “first computer programme” label.
- The Lovelace–De Morgan Mathematical Correspondence: A Critical Re-appraisal | Historia Mathematica — Peer-reviewed study of Lovelace’s mathematical education and surviving correspondence with Augustus De Morgan.
- Charles Babbage, Ada Lovelace, and the Bernoulli Numbers | Thomas J. Misa — Historical analysis of the Babbage–Lovelace collaboration, Note G, Bernoulli-number work, and the problems involved in assigning the title “first computer programmer.”

