{"record":{"id":"N-BABBAGE-NOTE-G","slug":"two-readings-of-ada-lovelaces-note-g-both-make-babbages-engine-a-general-machine","kind":"notebook","title":"Two readings of Ada Lovelace’s Note G both make Babbage’s engine a general machine.","dek":"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.","abstract":"A note about the control of Babbage’s Analytical Engine as Menabrea’s account of 1842 and Lovelace’s Notes of 1843 describe it, and about her program for the Bernoulli numbers in Note G, run on a reconstruction of the engine’s control. Note G is explicit that a result, zero or greater than zero, chooses between two courses. That the test ends the repetition of Operations 13 to 23 is a reading (A); that the repetition is counted and the test only chooses a step forward is another (B). Proved in Lean: under Reading A, one card, a backing made effective by a result, is enough for every counter machine to run, halting by passing its last card exactly when the machine halts; under Reading B, a forward course is enough together with the unconditional backing card of Babbage’s Sketch Book of December 1837. With Minsky’s theorem, cited, the machine is general under either reading. Lovelace’s table, transcribed from a camera image of the plate, gives −95/126 as printed where B₇ is −1/30; with three changes of three different kinds it gives −1/30, and 1/42 and 5/66 for the neighbouring Numbers. Under Reading B the test variable V₁₀ ends at zero for every n tried, which Reading A does not manage for the two smallest. That the engine is general from a conditional backing is Rojas’s; what is added here is the tie to Note G, both readings, the proofs, and the program run.","created":"2026-11-27","version":"1.2","status":"OPEN","publication":"published","authors":["Chris Hay"],"lineage":"NOTE G → THE PLATE → TWO READINGS → MACHINE → LEAN → REVIEW","concepts":["source-authority","verification","programming-languages"],"related":["N-BABBAGE-CONTROL","N-BABBAGE","N-TURING-ACE"],"media":[],"body":[{"kind":"observation","label":"01 / THE ONE PLACE A RESULT CHOOSES","text":"Could Babbage’s engine make a decision? Could a result it had just worked out change what it did next?\n\nIn 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.\n\nThe 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”.\n\nHow the engine would actually do it is not described until Babbage’s autobiography of 1864.","references":[{"label":"Menabrea and Lovelace, the control passages read","url":"https://github.com/chrishayuk/analytical-engine/blob/a9a0b50/sources/notes/menabrea-lovelace-1843-control.md"},{"label":"Sketch of the Analytical Engine, with Lovelace’s Notes (Fourmilab)","url":"https://www.fourmilab.ch/babbage/sketch.html"}]},{"kind":"observation","label":"02 / TWO READINGS OF ONE SENTENCE","text":"Note G is clear that a test chooses between two courses. What the two courses are is a matter of reading.\n\nLovelace’s program repeats one group of operations, 13 to 23. The question is what stops the repetition.\n\nUnder 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.\n\nUnder Reading B, the repetition is counted, as Lovelace’s Σ(+1)ⁿ⁻² suggests. The test only steps forward, when a Number is finished.\n\nThe text supports both. The archive reading judges Reading A the closer fit."},{"kind":"observation","label":"03 / LOVELACE’S TABLE, AS PRINTED","text":"Note G comes with a table: 25 operations that compute B₇, a Bernoulli number in her numbering, whose value is −1/30.\n\nThe 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.\n\nRun as printed, with the repetition of Operations 13 to 23 done under Reading A, the table gives −95/126.\n\nTwo cells could not be read with certainty, and only one printed copy of the plate has been read."},{"kind":"observation","label":"04 / THREE CHANGES OF THREE KINDS","text":"Three changes turn −95/126 into −1/30. They are not three errors by Lovelace. Each is a different kind of change.\n\nOperation 4 divides the wrong way round. That is an error in the printed table, and it has been reported before.\n\nOperation 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.\n\nOperation 24 adds where B₇ is minus the sum, and the table leaves signs aside. That is a convention.\n\nWith all three, n = 3, 4 and 5 give 1/42, −1/30 and 5/66."},{"kind":"observation","label":"05 / READING B FITS THE SMALLEST CASES","text":"Both readings give the right Number for n = 1 to 5. The difference is inside the run.\n\nUnder 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.\n\nUnder 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.\n\nThat makes Reading B the more faithful for the two smallest cases. It does not settle which reading is right."},{"kind":"observation","label":"06 / READING A: ONE CARD IS ENOUGH","text":"Now the bigger question: is the test Note G describes enough to make the engine a general machine?\n\nThe 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.\n\nUnder 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.\n\nIt 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.\n\nSo, given Minsky’s theorem, which is cited, this machine is general with only the test Note G describes."},{"kind":"observation","label":"07 / READING B: WITH THE BACKING OF 1837","text":"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.\n\nBut Babbage’s Sketch Book of December 1837 has a backing card that “always orders the backing”.\n\nA step forward past that card is a loop that a result ends. With it, every counter machine runs again.\n\nSo the conclusion holds under either reading. What differs is the older card it needs."},{"kind":"observation","label":"08 / WHAT ROJAS ALREADY SHOWED","text":"That the Analytical Engine is general, given a conditional backing, is not new.\n\nRojas 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.\n\nWhat 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."},{"kind":"observation","label":"09 / HOW IT WAS CHECKED","text":"Each theorem is in Lean 4, using only its core library. The proofs are checked on every change and use only the standard axioms.\n\nSome 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.\n\nThe 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.\n\nThe random decks found one real bug, an overflow in the Rust fractions, now fixed.\n\nTwo 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."},{"kind":"connection","text":"Every deck in this note runs in the browser under every arrangement. Choose a reading and a Number and run Lovelace’s program yourself.","links":[{"href":"https://github.com/chrishayuk/analytical-engine/blob/a9a0b50/docs/published-control-1843.md","label":"The 1842–1843 configuration, both readings, and what follows"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/a9a0b50/sources/notes/note-g-table.md","label":"The Note G table, transcribed row by row"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/a9a0b50/formal/Babbage/Note43.lean","label":"The Lean proofs for both readings"},{"href":"https://commons.wikimedia.org/wiki/File:Diagram_for_the_computation_of_Bernoulli_numbers.jpg","label":"The plate of Note G (Wikimedia Commons)"},{"href":"/notebook/where-babbages-1836-count-comes-from-decides-what-his-engine-could-compute","label":"The earlier note: what the Sketch Books’ control could compute"}]},{"kind":"refusal","title":"WHAT THIS DOES NOT SHOW","lines":["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."],"principle":"When a sentence can be read two ways, build both, and say what each needs."},{"kind":"question","text":"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?","status":"OPEN","detail":"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."}],"sources":[{"title":"L. F. Menabrea, “Sketch of the Analytical Engine invented by Charles Babbage”, trans. and with notes by A. A. Lovelace, Scientific Memoirs 3 (1843), pp. 666–731","url":"https://www.fourmilab.ch/babbage/sketch.html","note":"“the mill will order other cards” (p. 687); Note G, the two courses (p. 728) and V₁₀ (pp. 730–731). Read in sources/notes/menabrea-lovelace-1843-control.md."},{"title":"A. A. Lovelace, Note G, “Diagram for the computation by the Engine of the Numbers of Bernoulli”, folding plate after p. 722, Scientific Memoirs 3 (1843)","url":"https://commons.wikimedia.org/wiki/File:Diagram_for_the_computation_of_Bernoulli_numbers.jpg","note":"Transcribed from the Natural History Museum copy on archive.org (scientificmemoir03memo), leaf 0754; sources/notes/note-g-table.md. Since 1.1 the crops in this note are from that copy’s original camera images (leaves 754, 760 and 762: the plate, pp 728 and 730); 1.0 showed the public-domain scan on Wikimedia Commons, not the copy transcribed."},{"title":"C. Babbage, Scribbling Book Vol. III, p. 162 (December 1837), the Babbage Papers, Science Museum Group","note":"The card that “always orders the backing”, which Reading B needs. Transcribed in sources/notes/codesign-L023.md §1.2."},{"title":"R. Rojas, “Unconventional universal computation in Babbage’s Analytical Engine”, arXiv:2408.03334, 2024","url":"https://arxiv.org/abs/2408.03334","note":"Universality from a conditional backing, after Bromley (2000). The general result is his."},{"title":"A. G. Bromley, “Babbage’s Analytical Engine plans 28 and 28a: the programmer’s interface”, IEEE Annals of the History of Computing 22(4), 2000","note":"Not read (paywalled); known only through Rojas (2024) and Wikipedia."},{"title":"M. L. Minsky, Computation: Finite and Infinite Machines, Prentice-Hall, 1967","note":"Two counters suffice. Cited, not formalised."},{"title":"Note G, “Error”, Wikipedia","url":"https://en.wikipedia.org/wiki/Note_G","note":"Secondary: reports the swapped division of Operation 4. Its figure for the uncorrected program, −25621/630, was not reproduced."},{"title":"chrishayuk/analytical-engine, commit a9a0b50","url":"https://github.com/chrishayuk/analytical-engine/tree/a9a0b50","note":"src/sketch.rs (the machine, configurations 1843 and 1843-B), control/note-g-*.txt, tests/note_g.rs, formal/Babbage/Note43.lean and Multi.lean, scripts/lean-diff.sh, docs/published-control-1843.md."}],"published":"2026-11-27","revised":"2026-12-02"},"hash":"a7bd7f18cd5bc0a99f0c46c12adbc4ac411a930e85be7a6e3f5afc046e3d0b97","algorithm":"sha256","provenance":{"id":"N-BABBAGE-NOTE-G","version":"1.2","recordHash":"a7bd7f18cd5bc0a99f0c46c12adbc4ac411a930e85be7a6e3f5afc046e3d0b97","revision":{"kind":"clarification","summary":"Rewritten for readability with no change of result: each act now opens with a question or observation and reads as a short narrative, with technical terms explained on first use; dates, quotations, theorem names and qualifications stay in the strips and sources. A repeated disclaimer about review of the readings is removed; the readings are still attributed to an AI agent","previous":"1.1"},"sources":[{"title":"L. F. Menabrea, “Sketch of the Analytical Engine invented by Charles Babbage”, trans. and with notes by A. A. Lovelace, Scientific Memoirs 3 (1843), pp. 666–731","url":"https://www.fourmilab.ch/babbage/sketch.html","note":"“the mill will order other cards” (p. 687); Note G, the two courses (p. 728) and V₁₀ (pp. 730–731). Read in sources/notes/menabrea-lovelace-1843-control.md."},{"title":"A. A. Lovelace, Note G, “Diagram for the computation by the Engine of the Numbers of Bernoulli”, folding plate after p. 722, Scientific Memoirs 3 (1843)","url":"https://commons.wikimedia.org/wiki/File:Diagram_for_the_computation_of_Bernoulli_numbers.jpg","note":"Transcribed from the Natural History Museum copy on archive.org (scientificmemoir03memo), leaf 0754; sources/notes/note-g-table.md. Since 1.1 the crops in this note are from that copy’s original camera images (leaves 754, 760 and 762: the plate, pp 728 and 730); 1.0 showed the public-domain scan on Wikimedia Commons, not the copy transcribed."},{"title":"C. Babbage, Scribbling Book Vol. III, p. 162 (December 1837), the Babbage Papers, Science Museum Group","note":"The card that “always orders the backing”, which Reading B needs. Transcribed in sources/notes/codesign-L023.md §1.2."},{"title":"R. Rojas, “Unconventional universal computation in Babbage’s Analytical Engine”, arXiv:2408.03334, 2024","url":"https://arxiv.org/abs/2408.03334","note":"Universality from a conditional backing, after Bromley (2000). The general result is his."},{"title":"A. G. Bromley, “Babbage’s Analytical Engine plans 28 and 28a: the programmer’s interface”, IEEE Annals of the History of Computing 22(4), 2000","note":"Not read (paywalled); known only through Rojas (2024) and Wikipedia."},{"title":"M. L. Minsky, Computation: Finite and Infinite Machines, Prentice-Hall, 1967","note":"Two counters suffice. Cited, not formalised."},{"title":"Note G, “Error”, Wikipedia","url":"https://en.wikipedia.org/wiki/Note_G","note":"Secondary: reports the swapped division of Operation 4. Its figure for the uncorrected program, −25621/630, was not reproduced."},{"title":"chrishayuk/analytical-engine, commit a9a0b50","url":"https://github.com/chrishayuk/analytical-engine/tree/a9a0b50","note":"src/sketch.rs (the machine, configurations 1843 and 1843-B), control/note-g-*.txt, tests/note_g.rs, formal/Babbage/Note43.lean and Multi.lean, scripts/lean-diff.sh, docs/published-control-1843.md."}]}}