◷ Computing history

Ada Lovelace and Note G: the first program in history

Who Ada Lovelace was, how her Notes on the Analytical Engine came about, and why Note G on the Bernoulli numbers is regarded as a genuine program.

Ada Lovelace's name appears in almost every account of the origins of computing. She is often presented hastily as "the first programmer". Her story is more interesting than a label, and it is worth looking closely at what she actually wrote in 1843 and why that text is still quoted.

Who she was

Augusta Ada Byron was born in 1815, the daughter of the poet Lord Byron and Annabella Milbanke. Her parents separated when she was a baby, and Ada never knew her father. Her mother, who had a solid mathematical education, wanted her daughter to receive a rigorous training in mathematics and science, unusual for a girl at the time.

In 1833, at seventeen, Ada met Charles Babbage at one of the London gatherings where the mathematician showed off the working fragment of his Difference Engine. This led to a friendship and a correspondence that lasted for years. After her marriage to William King, who became Earl of Lovelace, she became known as Ada Lovelace.

How the Notes came about

In 1840 Babbage gave a presentation of his Analytical Engine in Turin. In the audience was a young military engineer, Luigi Federico Menabrea, who would later become Prime Minister of the Kingdom of Italy. Menabrea wrote an account in French, published in Geneva in 1842.

Ada translated the article into English. At Babbage's suggestion she added a series of explanatory notes, labelled with the letters A to G. The result, published in 1843 in a collection of scientific memoirs and signed only with the initials A.A.L., was far longer than the original article. The notes were not an appendix: they were the heart of the work.

What Note G contains

The last note describes in detail how the Analytical Engine could have calculated the Bernoulli numbers, a sequence of rational numbers that appears in many problems of mathematical analysis. Calculating them by hand is laborious, so they made a good test case.

Note G does not simply say that the machine could do it. It presents a table that specifies, step by step:

  • which operation the mill performs at each step;
  • which variables in the store it takes the operands from;
  • which variables it writes the result to;
  • how the values of the variables change during the calculation.

The procedure also contains a repetition: a group of operations is carried out several times with different values. Today we would call it a loop.

Why we call it a program

To give the idea, here is the outline of that kind of procedure in modern pseudocode, describing variables, operations and repetition:

for n from 1 to N:
    compute the terms from the previous values
    accumulate the result in a variable
    store B(n) in the store

This is not Ada's text, which used a tabular notation of her own, but it captures the structure: data in memory, elementary operations in sequence, a loop that reuses earlier results. That is why Note G is considered the first published program for a computer, even though that computer was never built. Incidentally, scholars have spotted a small error in the table, a swap between two variables: it may also be the first documented bug in a program.

The most important insight

The most quoted passage of the Notes, however, is not about the Bernoulli numbers. Ada observed that the Analytical Engine could operate not only on numbers but on anything whose mutual relations could be expressed in symbols. She gave the example of music: if the relationships between sounds could be formalised, the machine could compose pieces of any degree of complexity.

This is a remarkable conceptual leap. It means understanding that such a machine is not a very powerful calculator but a general manipulator of symbols. That is exactly what computers do when they handle text, images or sounds as sequences of numbers.

Lady Lovelace's objection

In the same Notes, Ada also wrote that the machine had no pretensions to originate anything: it could only do whatever we knew how to order it to perform. More than a century later, in 1950, Alan Turing devoted a section of his famous paper on machine intelligence to this sentence, calling it "Lady Lovelace's objection". The debate over what it means for a machine to be original is still open.

The debate over her role

Historians have long debated how much of the Notes reflects Ada's own ideas and how much her dialogue with Babbage, who supplied material and corrections. The correspondence between the two shows a close collaboration. The fact remains that the Notes are hers, that they contain insights not found in Babbage's published writings, and that their clarity of exposition is remarkable.

Ada Lovelace died in 1852, at thirty-six. In 1980 the United States Department of Defense gave her name to a programming language, Ada, still used in systems where reliability is critical.

In short

  • In 1843 Ada Lovelace translated Menabrea's article on the Analytical Engine, adding notes longer than the original text.
  • Note G describes step by step, with variables and repetition, the calculation of the Bernoulli numbers: it is regarded as the first published program.
  • Ada realised that the machine could manipulate symbols of every kind, not just numbers.
  • Her remark on the machine's limits was discussed by Turing in 1950 as "Lady Lovelace's objection".
MM
Marco Marzaduri

Marco Marzaduri works in cybersecurity, digital forensics and web development. With degrees in computer science and psychology, he combines technical analysis with an understanding of the human factor.

Read also