In 1843 Ada Lovelace wrote a table of operations to make a machine compute the Bernoulli numbers — with a loop. The machine was never built, so it never ran. Here it runs: the same cycle, the same working variables, computing exact fractions 180 years late.
source L. F. Menabrea, Sketch of the Analytical Engine, with Notes (esp. Note G) by Ada Augusta, Countess of Lovelace, 1843 — original at archive.org/details/TO01056056. Rendered, not quoted.
Babbage designed the Analytical Engine — a general computer of gears. Ada translated Menabrea's account and added seven Notes longer than the paper. Note G gives a step-by-step table of operations to compute the Bernoulli numbers — the first published algorithm with a cycle (a loop that repeats with a counter).
She saw further than the numbers: the Engine "might act upon other things besides number" — the science of operations. That is software.
The Bernoulli numbers B₀,B₁,B₂,… obey one relation, for every m ≥ 1:
Σk=0…m C(m+1, k) · Bk = 0
Solve it for the newest one: Bm = −1/(m+1) · Σk<m C(m+1,k)·Bk. Note G walks exactly this sum in working variables and loops the counter — the loop is the program.
Ada numbered them B₁,B₃,B₅,B₇ (odd index) — those are our B₂,B₄,B₆,B₈. Same numbers, older labels.
Each row is one turn of Ada's loop: multiply C(m+1,k) by the already-known Bk, add it into the running variable. After the last turn, scale by −1/(m+1). Exact fractions, computed with big integers.
| k | C(m+1,k) | Bk | term | running Σ |
|---|
The full table B₂…B₁₂, recomputed live:
Earlier "programs" were recipes a human followed. Note G is different in two ways that make it software:
1 · the loop. The operation table repeats with a counter — the Engine, not a person, decides how many times. 2 · the variables. It works on symbols in numbered stores (V₁,V₂,…), reusing and overwriting them — memory, not arithmetic-in-the-head.
A construction (Euclid) and an algebra (Boole) are static. A program unfolds in time. That is the new thing.
Euclid's triangle just is; Boole's law holds outside time. Note G is the first thing on the spine that happens — a sequence of steps with a state that changes.
Once a process can be written down as data (a table of operations), the next question writes itself: can one machine read any such table and carry it out? Ada wrote a program; the next sphere, Turing, writes the machine that runs every program. The program is the premise of the universal machine.
Recomputes B₂…B₁₂ and checks them against the known Bernoulli numbers. Then break one step of the loop and watch it drift.
Skip one term in the cycle and the fractions come out wrong — the audit compares to the true values and turns red. Big-integer exact, not rounded.
"Note G ran on the Analytical Engine." Cut. The Engine was never completed — the algorithm was never executed in Ada's lifetime. It ran, provably, for the first time on later machines; here it runs in your browser.
"Ada's numbering matches ours." Cut. Her B₁,B₃,B₅,B₇ are our B₂,B₄,B₆,B₈ — offset by the odd/even convention. The engine uses modern indices and says so.
"The published table was flawless." Kept, corrected. The printed Note G table carried a known slip in the operation sequence (a variable mix-up) — an errata, not a hoax. The recurrence itself is exact and is what runs here.
The strongest case against, stated fairly:
So the honest claim is precise: not "she invented programming," but "she published the first program and saw, before anyone, that a computer manipulates symbols, not just sums." The engine here proves the algorithm is correct; the authorship debate it leaves open, on the record.