{"record":{"id":"N-BABBAGE","slug":"babbage-reordered-a-program-to-save-ten-turns-of-the-hand","kind":"notebook","title":"In August 1837, Babbage chose a program’s order to avoid losing ten turns of the hand.","dek":"Two of the earliest programs for the Analytical Engine, run on the store and the mill as Babbage set them out, a day apart. 122 of the 123 things he wrote agree with what the operations do, and his own remark under the table explains the order of the first. The transcription is an AI agent’s.","abstract":"A note about running the two programs on BAB/L/001, the first sheet of Charles Babbage’s notations of calculations for the Analytical Engine in the Science Museum: No. 1 of 4 August 1837, which eliminates x between two equations, and No. 2 of 5 August, which finds x and y. Both tables were transcribed cell for cell from the Museum’s scans by an AI agent, and a program runs each operation on a model of the engine that has no rules but those the sheet shows, holding every value as algebra in Babbage’s own letters. Of 123 statements on the sheet, the store cells, the mill’s entries, the formulas and their accents, the compositions, the results and the counts of operations and variables, 122 agree. The sheet depends on the mill keeping a table of multiples of the multiplicand between operations, as Babbage’s own remark explains, and its accents name numbers, not columns. The one disagreement is operation 12 of No. 2: a subtraction whose result Babbage writes as −c − ax.","created":"2026-11-25","version":"1.1","status":"OPEN","publication":"published","authors":["Chris Hay"],"lineage":"BAB/L/001 → SCANS → TRANSCRIPTION → THE ENGINE AS THE SHEET SHOWS IT → EVERY CELL CHECKED","concepts":["source-authority","verification","programming-languages"],"related":["N-BABBAGE-ENGINE","N-BABBAGE-CONTROL","N-NINE-CHAPTERS","N-TURING-ACE"],"media":[],"share":{"x":"Two of the earliest programs for Babbage’s Analytical Engine, 4–5 August 1837, run as written: 122 of 123 statements agree. His remark explains the order: another would have destroyed the mill’s table of multiples, “causing the loss of about ten turns of the hand”.","xReply":"The sheet, cell by cell, and both programs to step through in the browser →"},"body":[{"kind":"observation","label":"01 / TWO PROGRAMS ON ONE SHEET","text":"On 4 August 1837, Charles Babbage wrote out a program for his Analytical Engine. Its first operation multiplies b′ by a, and leaves the places where both numbers were kept empty. Its second operation multiplies b′ again.\n\nHow can it use a number that is no longer there?\n\nThe answer is in a remark Babbage wrote under the table, and it is the remark of a programmer. To find it, we ran his program exactly as he wrote it.\n\nThe sheet is BAB/L/001, the first of a series the Science Museum’s catalogue describes as 27 sets of “notations of calculations” for the engine. It holds two programs, No. 1 of 4 August and No. 2 of the next day. Both work on the same pair of equations, ax + by + c = 0 and a′x + b′y + c′ = 0. The first eliminates x between them; the second finds x and y.\n\nEach program is a table, one row per operation. A row says what the mill, the engine’s arithmetic unit, makes, and what happens in the store: the columns of figure wheels, v1 to v9, that each hold one number.\n\nRaúl Rojas described this sheet in 2023 as the first computer program, reading its two tables as one program of 4 August. Here both tables were transcribed from the Museum’s scans by an AI agent, cell for cell, and run.","references":[{"label":"BAB/L/001, Science Museum Group (catalogue and scans)","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000065"},{"label":"R. Rojas, “The first computer program”, 2023","url":"https://arxiv.org/abs/2303.13740"}]},{"kind":"observation","label":"02 / RUN AS WRITTEN","text":"The run is simple to describe. Take each row’s operation and columns from the sheet, and do the operation. Then check everything the row writes: each store cell, the mill’s entry, the formula on the right, and the accents on its variables. At the end, check the page’s “Composition”, the values of x and y it states, and its counts of operations and variables.\n\nThe values are held as algebra, in Babbage’s own letters, not as numbers. So a check that passes holds for every value of a, b, c, a′, b′ and c′, not just for numbers chosen to test it.\n\nThe model engine has no rule but those this sheet shows, and one choice nothing here depends on. A number taken from a column leaves it at zero. Its complement may be laid in another column as it is taken. A transfer from column to column complements again. Rojas described the same rules in 2017, from the same series of sheets, and Bromley (1982) described destructive reading, a number cleared from its column when it is read.\n\nOf 123 statements, 122 agree: all 42 of No. 1, and 80 of the 81 of No. 2.\n\nThe x and y the run finds solve the equations (taking operation 12 as written; see 06). The counts on the cover for No. 2, “great 7, small 6, total 13” and “6 variables, 3 working, 9 occupied”, are what the run counts."},{"kind":"observation","label":"03 / TEN TURNS OF THE HAND","text":"Back to the puzzle. Operation 1 of No. 1 multiplies b′ by a and leaves both their columns at zero. Operation 2 multiplies b′ by c, though b′ is no longer in the store.\n\nBabbage’s remark gives the reason. The mill makes a table of multiples of the multiplicand, and keeps it. So he ordered the products to use each table twice: b′ for operations 1 and 2 and, as the run shows, b for 3 and 4.\n\nHe had thought of another order, which would have saved variables. He rejected it because it “would have caused the table of b′ made in the third operation to be destroyed and it must have been recomputed in the operation for b′c thus causing the loss of about ten turns of the hand.” (The operation numbers in the remark are read as those of the order he rejected.)\n\nSo the run keeps a table standing until another operation comes between. With that one rule, every operand of both programs is to hand.\n\nThe ten turns are Babbage’s figure. How long a table took to make is not on this sheet."},{"kind":"observation","label":"04 / THE NEXT DAY","text":"No. 1 finds x, but it leaves the store spent. a, b and c have each been taken to the mill and left at zero.\n\nThe next day, No. 2 finds y as well, and y needs a, b and c again. So as each is taken in operations 1 to 3, its complement is laid in another column at the same time: Ca in v8, Cc in v5, Cb in v9. On the back of the sheet Babbage defined the sign: “C … before any number signifies the Complement of that number as Ca means complement of a”.\n\nAfter x is found, operations 8 to 10 move them back, with nothing for the mill to do. Then the second half finds y.\n\nKeeping them costs three transfers and two more working variables. With the three operations that find y, No. 2 takes 13 operations and 9 variables, where No. 1 took 7 and 7, as the cover counts them."},{"kind":"observation","label":"05 / ACCENTS NAME NUMBERS","text":"The accents are easy to overlook. Babbage writes v₁′ for the first new number v1 is given, and v₁″ for the second.\n\nThe right-hand columns and compositions of the two programs name variables with accents 53 times. Every one is the number the run finds there.\n\nThey name numbers, not columns. Operation 8 of No. 2 is written v₁″ = v₁ = a. The a that comes back from v8 is still v₁, the number v1 started with, though for seven operations it was somewhere else, as its complement.","references":[{"label":"The notation","url":"https://github.com/chrishayuk/analytical-engine/blob/f01dd61/docs/notation.md"},{"label":"Every rule of the engine, with what it rests on","url":"https://github.com/chrishayuk/analytical-engine/blob/f01dd61/README.md#the-machine"}]},{"kind":"observation","label":"06 / OPERATION 12","text":"One row does not agree.\n\nNo. 2 finds y from the first equation as (−c − ax)/b. Operation 11 makes ax. Operation 12 is marked as a subtraction; its mill column reads −c − ax, and its formula −v₃″ − v₅″.\n\nBut subtracting one of c and ax from the other gives c − ax or ax − c, not −c − ax.\n\nTaken as Babbage wrote it, every cell after it agrees, y included. So does his composition of y, expanded through −cb′a + cba′ − c′ba + cb′a to (a′c − ac′)/(b′a − ba′). The algebra is right. What the row asks of the mill, to take both numbers negatively, no other row asks.\n\nRun strictly, with the machine’s own value carried on instead of the sheet’s, y comes out wrong. It is the only page of the series that does. Rojas prints the formula without comment."},{"kind":"connection","text":"The same program runs in the browser, compiled to WebAssembly: the mill and the columns of the store, stepped one operation at a time, the sheet laid out as Babbage laid it out with every cell checked, and the transcription in an editor that runs as you type.","links":[{"href":"/demos/babbage?page=L001-2","label":"Both programs, run in the browser — interactive study"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/f01dd61/sources/notes/L001.md","label":"What was hard to read on the sheet, and the pencil not run"},{"href":"https://github.com/chrishayuk/analytical-engine/blob/f01dd61/docs/literature.md","label":"Where this reading and Rojas’s agree and differ"},{"href":"https://github.com/chrishayuk/analytical-engine/tree/f01dd61/tutorial","label":"A tutorial in nine chapters, every page tested"},{"href":"https://github.com/chrishayuk/analytical-engine","label":"Source, language server and editor extension"}]},{"kind":"refusal","title":"WHAT THIS DOES NOT SHOW","lines":["One sheet of 27. The rules here are those read off BAB/L/001. The rest of Series L has since been run (at f01dd61, 2624 of 2673 statements on 35 pages agree) and needed rules 12 to 32, each dated where it first appears and set against Babbage’s history sheets; one of them (L/015) qualifies the table rule: the table is made of the factor the next multiplication uses again.","That another operation destroys the mill’s table comes from the remark; no row of this sheet tests it. That a transfer complements: the sheet shows only Ca going out and a coming back. Rojas explains it so (2017, 2023), and Babbage’s Sketch Book states it on 25 July 1836 (an AI agent’s reading).","The “about ten turns of the hand” is quoted and not checked: how long a table took to make is not on this sheet.","The transcription was made by an AI coding agent from the Museum’s scans, in one session. The scans are linked, and what was hard to read on the sheet is listed in the repository’s notes on it.","Rojas 2017 and 2023 and Bromley 1982 have been read, Bromley 1990 searched, and a short search made; Bromley 2000 and Rojas 2021 were found and not read. Destructive reading and a mill that multiplies from a table of multiples are already in Bromley (1982) and Rojas (2017, 2023). That the cover dates No. 2 a day later, and the sign of operation 12, were not found in what was read. Nothing here is claimed as new."],"principle":"A program that writes down every cell can be run again. Where it agrees, the machine was understood; where it does not, that is the place to look."},{"kind":"question","text":"Do the other 26 sets run as written, and when does the engine they need change?","status":"OPEN","detail":"Answered in part since: every sheet with images, L/001 to L/027 (L/003 has none), has been run, and at f01dd61 2624 of 2673 statements on 35 pages agree; 14 pages have statements that do not, and one, this sheet’s back run strictly, ends with a wrong answer. Each rule a sheet needs beyond BAB/L/001 is dated where it first appears. What the disagreements are — slips, readings, or rules not yet found — is open; see the repository’s Status section."}],"sources":[{"title":"C. Babbage, “Notations of Calculation”, No. 1 (4 August 1837) and No. 2 (5 August 1837), BAB/L/001, the Babbage Papers, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000065","note":"Three images: the cover, the opened sheet with both tables, and the back with the definition of the complement. Read at full resolution from the Museum’s image service."},{"title":"Notations of calculations for the Analytical Engine, BAB/L, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000020/notations-of-calculations-for-the-analytical-engine","note":"“27 sets of notations consisting of 36 sheets”, 1836–1840; the dated sheets run from 4 August 1837 to 9 August 1841. The catalogue’s titles are Allan Bromley’s."},{"title":"R. Rojas, “The first computer program”, arXiv:2303.13740, 2023; Communications of the ACM, 2024","url":"https://arxiv.org/abs/2303.13740","note":"A reading of BAB/L/001. Read in its arXiv version."},{"title":"R. Rojas, “Die Computerprogramme von C. Babbage”, Informatik-Spektrum 40(3), 2017","url":"https://www.mi.fu-berlin.de/inf/groups/ag-ki/publications/Computerprogramme-Babbage/Computer-Programme-von-Babbage.pdf","note":"The programs of Series L, listed by date, and the rules of the engine they show: destructive reading, complements, separate operation and variable cards."},{"title":"chrishayuk/analytical-engine, commit f01dd61","url":"https://github.com/chrishayuk/analytical-engine/tree/f01dd61","note":"The transcription, the engine, the checks, a tutorial, a language server, the editor extension and the playground."},{"title":"Reconstruction, 25 November 2026","note":"The transcription and the run. Every result in this note can be rerun on the interactive study or with cargo test in the repository."}],"published":"2026-11-30","revised":"2026-12-03"},"hash":"1d1024f91842fbf40bab080f867c39f9d06f9c9e5581607a36683914f9c01c0d","algorithm":"sha256","provenance":{"id":"N-BABBAGE","version":"1.1","recordHash":"1d1024f91842fbf40bab080f867c39f9d06f9c9e5581607a36683914f9c01c0d","revision":{"kind":"clarification","summary":"A readability revision with no change of result: the note opens with the puzzle the sheet poses, an operation that uses a number already taken from the store, and answers it with Babbage’s remark; shorter paragraphs, the mill and store explained on first use; the repeated statement about review of the transcription removed, the transcription still attributed to an AI agent and the hard-to-read cells pointed to; the 1.0 search title, collection card and conclusion restored after a later commit had reverted them","previous":"1.0"},"sources":[{"title":"C. Babbage, “Notations of Calculation”, No. 1 (4 August 1837) and No. 2 (5 August 1837), BAB/L/001, the Babbage Papers, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000065","note":"Three images: the cover, the opened sheet with both tables, and the back with the definition of the complement. Read at full resolution from the Museum’s image service."},{"title":"Notations of calculations for the Analytical Engine, BAB/L, Science Museum Group","url":"https://collection.sciencemuseumgroup.org.uk/documents/aa110000020/notations-of-calculations-for-the-analytical-engine","note":"“27 sets of notations consisting of 36 sheets”, 1836–1840; the dated sheets run from 4 August 1837 to 9 August 1841. The catalogue’s titles are Allan Bromley’s."},{"title":"R. Rojas, “The first computer program”, arXiv:2303.13740, 2023; Communications of the ACM, 2024","url":"https://arxiv.org/abs/2303.13740","note":"A reading of BAB/L/001. Read in its arXiv version."},{"title":"R. Rojas, “Die Computerprogramme von C. Babbage”, Informatik-Spektrum 40(3), 2017","url":"https://www.mi.fu-berlin.de/inf/groups/ag-ki/publications/Computerprogramme-Babbage/Computer-Programme-von-Babbage.pdf","note":"The programs of Series L, listed by date, and the rules of the engine they show: destructive reading, complements, separate operation and variable cards."},{"title":"chrishayuk/analytical-engine, commit f01dd61","url":"https://github.com/chrishayuk/analytical-engine/tree/f01dd61","note":"The transcription, the engine, the checks, a tutorial, a language server, the editor extension and the playground."},{"title":"Reconstruction, 25 November 2026","note":"The transcription and the run. Every result in this note can be rerun on the interactive study or with cargo test in the repository."}]}}