In Note G, Ada Lovelace says a result of Babbage’s engine chooses between two courses. Read either of two ways (the second with a backing card Babbage described in 1837), that makes his machine general. Her program runs both ways, and as printed.
Published manuscript · v1.2
01 / THE ONE PLACE A RESULT CHOOSES
Could Babbage’s engine make a decision? Could a result it had just worked out change what it did next? In the Sketch Books and drawings read here, up to April 1842, no sign of it was found. No result of the mill, the part of the engine that does the arithmetic, chooses which cards act next. The published accounts change that. Menabrea’s account of the engine, in 1842, states it as a principle. In 1843, in Note G, one of the notes to her translation of it, Ada Lovelace works an example: Operation 7 brings out zero or a number greater than zero, and “the engine follows the one or the other of the two courses”. How the engine would actually do it is not described until Babbage’s autobiography of 1864.
Menabrea and Lovelace, the control passages read ↗
Sketch of the Analytical Engine, with Lovelace’s Notes (Fourmilab) ↗
02 / TWO READINGS OF ONE SENTENCE
Note G is clear that a test chooses between two courses. What the two courses are is a matter of reading. Lovelace’s program repeats one group of operations, 13 to 23. The question is what stops the repetition. Under Reading A, it goes on until a column of the store called V₁₀ comes to zero. The result ends the loop. In the engine’s terms, it is a backing, turning the cards back to run a group again, that a result makes effective. Under Reading B, the repetition is counted, as Lovelace’s Σ(+1)ⁿ⁻² suggests. The test only steps forward, when a Number is finished. The text supports both. The archive reading judges Reading A the closer fit.
03 / LOVELACE’S TABLE, AS PRINTED
Note G comes with a table: 25 operations that compute B₇, a Bernoulli number in her numbering, whose value is −1/30. The table was transcribed from the original camera image of the plate in the Natural History Museum’s copy. The Wikisource transcription turned out to be wrong in several cells. Run as printed, with the repetition of Operations 13 to 23 done under Reading A, the table gives −95/126. Two cells could not be read with certainty, and only one printed copy of the plate has been read.
04 / THREE CHANGES OF THREE KINDS
Three changes turn −95/126 into −1/30. They are not three errors by Lovelace. Each is a different kind of change. Operation 4 divides the wrong way round. That is an error in the printed table, and it has been reported before. Operation 21 must take B₅ from V₂₃ the second time round, as the text says. This machine cannot advance a variable card, the card that names which column an operation uses, so six cards not in the table do it. That is an adaptation. Operation 24 adds where B₇ is minus the sum, and the table leaves signs aside. That is a convention. With all three, n = 3, 4 and 5 give 1/42, −1/30 and 5/66.
05 / READING B FITS THE SMALLEST CASES
Both readings give the right Number for n = 1 to 5. The difference is inside the run. Under Reading B, the tests at Operations 7 and 12 are the forward courses the text describes for n = 1 and n = 2. V₁₀ ends at zero every time. Under Reading A there is no way to step forward. So for n = 1 and 2 the deck runs operations the engine would skip, and V₁₀ ends at −2 and −1. That makes Reading B the more faithful for the two smallest cases. It does not settle which reading is right.
06 / READING A: ONE CARD IS ENOUGH
Now the bigger question: is the test Note G describes enough to make the engine a general machine? The yardstick is the counter machine, a very simple model of a computer that only adds to, subtracts from and tests a few counters. Minsky showed that two counters are enough to compute every partial computable function, with the inputs suitably coded. Under Reading A, add one card to Babbage’s arrangement of 30 May 1838: a backing made effective while a column holds a number greater than zero. It is then proved in Lean, a language in which a computer checks every step of a proof, that every counter machine translates into a deck that halts, by passing its last card, exactly when the machine halts. The deck uses nothing else, and every older deck runs as before. So, given Minsky’s theorem, which is cited, this machine is general with only the test Note G describes.
07 / READING B: WITH THE BACKING OF 1837
Under Reading B the test only steps forward. With every backing counted, the limits of the counted arrangements still hold. That is argued, not proved. But Babbage’s Sketch Book of December 1837 has a backing card that “always orders the backing”. A step forward past that card is a loop that a result ends. With it, every counter machine runs again. So the conclusion holds under either reading. What differs is the older card it needs.
08 / WHAT ROJAS ALREADY SHOWED
That the Analytical Engine is general, given a conditional backing, is not new. Rojas argued it in 2024, after Bromley (2000). He used a test for zero that backs by amounts punched on cards, and built on it, in prose, indirect addressing and a Turing machine with a finite tape. That result is his. What this note adds is narrower. It takes the primitive from one passage of Note G and reads it two ways, proves both translations in Lean, and runs Lovelace’s program on the same machine.
09 / HOW IT WAS CHECKED
Each theorem is in Lean 4, using only its core library. The proofs are checked on every change and use only the standard axioms. Some operations, like Lovelace’s first, write several columns at once. It is proved that such an operation is equal to one that writes the first column and copies it. The Lean model and the Rust machine, a second version of the engine written in the Rust programming language, were run on the same decks and compared. The decks: random decks with each of the new cards; one counter machine (add), on two inputs, under each reading; and Lovelace’s program as printed, corrected and under Reading B, on exact fractions. All 3,720 runs agreed. The random decks found one real bug, an overflow in the Rust fractions, now fixed. Two independent reviews (commits 15d045d and 5cba933) found no error in the mathematics or in the numbers. They did find a reading stated as fact, and other places where the prose said more than the work. All were corrected.
Every deck in this note runs in the browser under every arrangement. Choose a reading and a Number and run Lovelace’s program yourself.
WHAT THIS DOES NOT SHOW
- Which reading of Note G is right. Both are worked out; the text supports both, Reading B fits the two smallest cases better, and the archive reading judges Reading A the closer fit overall.
- That the engine was built, or designed in 1843, to do this. The texts state the conditional course as a principle with one worked case; the mechanism is first described in Babbage’s Passages from the Life of a Philosopher (1864).
- That Lovelace’s program is correct for every n. It is run for n = 1 to 5, and the adaptation of Operation 21 works only up to n = 5; nothing is proved about the program itself.
- That the Lean model and the Rust machine agree on every deck. They agree on the 3,720 runs compared, Lovelace’s program among them; that is a test, not a proof. The general theorems are over whole numbers.
- The plate was read from one printed copy; two cells are uncertain. The general result is Rojas’s, and his source, Bromley (2000), could not be read. Nothing here is claimed as first.
When a sentence can be read two ways, build both, and say what each needs.
If a program survives only as a printed table and a few sentences, how much of the machine it ran on can be recovered from the program?
Open here: a proof that Lovelace’s program, corrected, computes every Bernoulli number it is given; advancing variable cards without the adaptation; a formal proof that a forward course without the unconditional backing leaves the machine bounded; and whether a person reading the plate and the text agrees with the readings this all rests on.
Thematic notebook / Published record
Closing thought
Note G is explicit that a result chooses between two courses. Read as a cycle a result ends, one card makes the engine general; read as a step forward, it does with the unconditional backing of 1837. Both are proved in Lean, given Minsky’s theorem. Lovelace’s table gives −95/126 as printed and −1/30 with three changes, one an error, one an adaptation to this machine, one a convention; under the second reading her test variable ends at zero for every case tried.




![Scientific Memoirs vol. 3 (1843), Note G, p 728: “Card 23 has the office of Cards 11 and 7 to perform, since if n were = 3, the 21st and 22nd operations would complete the computa-[tion of B₅]”. “11” is as printed.](/media/notebook/babbage-note-g/1843-p728-card-23.jpg)







