On this page
Ada Lovelace is often called the first computer programmer, a label that is both partly right and easy to misunderstand. She never used a working computer, because the machine she wrote about was never built. What she left is a set of notes, published in 1843, that you can still read today. This post explains what is in them, works through the central idea with a small example you can trace by hand, and draws out what a student can take from how she worked.
Who was Ada Lovelace?
The MacTutor biography from the University of St Andrews gives her dates as 10 December 1815 to 27 November 1852. She was the daughter of the poet Lord Byron and Anne Isabella Milbanke, and was taught mathematics by a series of tutors. On 5 June 1833 she met Charles Babbage at a party, and two weeks later she saw his Difference Engine on display. From 1834 Mary Somerville advised her on mathematics, and in 1841 she began advanced study with Augustus De Morgan.
In 1842 the Italian engineer Luigi Menabrea published a paper in French on Babbage's planned Analytical Engine. Lovelace translated it. MacTutor quotes Babbage's later account: when he asked why she had not written an original paper, she said the thought had not occurred to her, and he suggested she add notes. The translation and notes appeared in 1843 in Richard Taylor's Scientific Memoirs, signed only "AAL". Babbage later wrote that her notes extended to about three times the length of the original memoir.
What was the Analytical Engine?
The Science Museum explains that Babbage's earlier Difference Engine grew out of the problem of errors in printed mathematical tables. The Analytical Engine was more ambitious: it was designed "to evaluate any mathematical formula", was to be programmed with punched cards, the technique the Jacquard loom used to control woven patterns, and had a separate "store" for numbers and "mill" for arithmetic. Only part of the machine, as a trial piece, was completed before Babbage's death in 1871.
What did Lovelace's notes actually say?
You can read the full text, Menabrea's paper plus Notes A to G, in the transcription hosted by Fourmilab. Three ideas stand out.
A machine for patterns, not only numbers. She wrote that "the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." She also suggested that if the rules of musical harmony could be expressed in its notation, "the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent."
Repetition as a tool. She defined a "cycle" as "any set of operations which is repeated more than once", whether twice or an indefinite number of times. That is the idea you now call a loop.
A full worked plan. In Note G she set out, step by step, how the engine could compute the Bernoulli numbers, which appear in formulas for sums of powers. The Computer History Museum describes this as "the first published description of a stepwise sequence of operations for solving certain mathematical problems".
She was also careful about limits. In Note G she wrote that the engine "has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform." Alan Turing returned to this point a century later, as our post on Alan Turing and computing describes.
Worked example: tracing a cycle by hand
Lovelace's Bernoulli plan is long, but its core move is simple: a fixed group of operations repeated with changing values. Here is a small cycle that adds the squares 1 + 4 + 9 + 16 + 25.
Start: n = 1, total = 0. Cycle: square n, add it to total, increase n by 1. Stop when n passes 5.
n = 1: total = 0 + 1 = 1
n = 2: total = 1 + 4 = 5
n = 3: total = 5 + 9 = 14
n = 4: total = 14 + 16 = 30
n = 5: total = 30 + 25 = 55
Check with the formula n(n + 1)(2n + 1) / 6 for n = 5: 5 x 6 x 11 / 6 = 55. The trace and the formula agree.
Common mistakes when tracing
Off-by-one stopping. Stopping when n reaches 5, instead of after using 5, gives 30.
Updating in the wrong order. If you increase n before squaring, you add 4, 9, 16, 25, 36 and get 90.
Not writing the state down. Keep a table of every variable after each pass. Lovelace's notes include large tables doing exactly this for the engine's columns.
What can a student learn from how Lovelace worked?
Explain the general idea, then show one full case. Her notes move between broad claims about what the engine could do and a complete, checkable example.
Be precise about limits. Her "no pretensions" passage is as useful as her bold claims, because it says exactly what the machine could not do.
Ask how a method generalises. She saw that a machine built for numbers could, in principle, work on any symbols with rules.
If loops and recursion still feel abstract, Fermi's AI tutor works out what you already know and builds a plan for the session, so you start from the step you are missing.
Practice routine: trace two more cycles on paper this week, the sum of cubes up to 4 (answer 100) and the first eight Fibonacci numbers, keeping a full table of variables after each pass.
Next step: read Note G's short "no pretensions" paragraph in the Fourmilab text and write two sentences on whether it applies to today's AI.



