You are on page 1of 6

Ada and the First Computer

The collaboration between Ada, countess of Lovelace, and
computer pioneer Charles Babbage resulted in a landmark publication
that described how to program the world’s first computer

by Eugene Eric Kim and Betty Alexandra Toole

P eople called Augusta Ada King’s father “mad and bad” for his wild ways, but he
was better known as Lord Byron, the poet. Ada inherited her famous father’s
way with words and his zest for life. She was a beautiful, flirtatious woman who
hobnobbed with England’s elite and who died at the youthful age of 36, the same age at
which her father died. And like Byron, Ada is best known for something she wrote.
In 1843 she published an influential set of notes that described Charles Babbage’s An-
alytical Engine, the first automatic, general-purpose computing machine ever designed.
Although the Analytical Engine was never built—largely because Babbage could not
raise the funds for its construction—Ada’s notes included a program for using it to com-
pute a series of figures called Bernoulli numbers [see box on page 78].
Ada’s notes established her importance in computer science, but her fascinating life
and lineage—and her role as a female pioneer in a field in which women have always
been notoriously underrepresented—have lately turned her into an icon. In addition to
numerous biographies, she has inspired plays and novels written by the likes of such lu-
minaries as Tom Stoppard and Arthur C. Clarke. Conceiving Ada, a movie loosely
based on her life, was released by Fox Lorber in February. And whereas many women
have helped to advance computer science, only Ada has had a computer language
named after her; it is used largely for military and aerospace applications.
Not surprisingly, Ada’s contributions to computer science have been both embellished
and diminished, and her true legacy has elicited controversy among historians in the
field. Many people, for instance, incorrectly claim that Ada was the first computer pro-
grammer. (Babbage, not Ada, wrote the first programs for his Analytical Engine, al-
though most were never published.) Others unfairly challenge Ada’s authorship of the
program included in the notes and even of the notes themselves.
As with most things, the truth lies somewhere in the middle. Babbage characterized
Ada’s contributions best when he referred to her as his “interpretress.” He did discuss
the notes with Ada and reviewed early drafts, but there can be no question that she her-
self was the author. And whereas Babbage’s groundbreaking work formed the basis of
Ada’s notes and her thinking, her lucid writing revealed unique insight into the
significance and the many possibilities of the Analytical Engine.

A Young Mathematician

A ugusta Ada Byron was born on December 10, 1815, in London; she was the daughter
of Lord Byron and his wife of 11 months, mathematician Annabella Milbanke. By
the time Ada was born, Annabella already had reservations about her marriage to By-
ron. Rumors, most likely started by Annabella’s cousin, Caroline Lamb, were circulat-
ing that Byron had had an affair with his half-sister, giving Annabella the excuse to sep-
arate from him. Byron left England in April 1816, never to see his daughter again.
Lady Byron raised Ada to be a mathematician and a scientist and discouraged her liter-
ary leanings, in part to distance her from her father. Ada received an excellent education:
she was tutored in mathematics by Mary Somerville, a prominent scientist best known for

76 Scientific American May 1999

Copyright 1999 Scientific American, Inc.

E. Chalôn around 1838. Ada later extended his proposals. the designer of the world’s first computer. BACKGROUND COURTESY OF SCIENCE MUSEUM LIBRARY. Inc. The background depicts pro- gramming ideas sketched by Babbage. . several years after she first met Charles Babbage. LONDON ADA LOVELACE sat for this portrait by A. ALL RIGHTS RESERVED. REPRODUCED BY KIND PERMISSION OF THE BRITISH POST OFFICE. Scientific American May 1999 77 Copyright 1999 Scientific American. PORTRAIT COURTESY OF THE BRITISH MUSEUM. The inset shows a stamp re- leased in 1991 by the British postal service to commemorate the 200th anniversary of Babbage’s birth. STAMP: © THE POST OFFICE—A BRITISH STATUTORY CORPORATION.

While mathematics tended a party where she met Babbage. The Analytical En- the numerator and the denominator are equal to 4! (4 × 3 × 2 × 1). cards for programming data input (an cause each numerator contains the factor (2x –2). Ada simplified this expression to: 0= – 1 (2x –1) +B 2x 2 (2x +1) 1 2! + B2 (2x) (2x –1) (2x –2) 4! + A ccording to Babbage’s designs. Babbage.” 78 Scientific American May 1999 Ada and the First Computer Copyright 1999 Scientific American. –1⁄30. B2. who took notes at the meeting and. had already start- ed thinking about bigger and better Bernoulli Numbers things. and the frac- gine would perform addition. 1×1 which wove patterns automatically by 0=(– )+ B1 2 3 using such cards).A. however. Devised to solve general compu- (2x) (2x–1) (2x –2) (2x –3) (2x –4) B3 + tational problems. George Peacock ematics and economics. she followed the development of Ada’s mathematical education was algebra. –1⁄30 and 5⁄66. February 1993]. Menabrea (Italy’s future prime minis- nominator and multiplied that value by the previously stored value. He called it the Analyt- nomial expansion of the expression: ical Engine and spent the remaining 38 ∑ x = n years of his life refining the plans for it. and by logician and under De Morgan’s tutelage. the fraction next to B2 becomes 1. bage. . Babbage showed Ada though it was efficient. flourished in continental Europe in the a 41-year-old widower who was as well Babbage devised the Difference En- first half of the 19th century. after the meeting. To calculate Bn from this expression. . They are defined as the constant Bn in the poly- he was designing. B4 and so on all equal 0. The engine’s output would take the form of a printed page So B1 = 1⁄6. B3 and so on.K. subtrac- tions next to B3. and B. 17-year-old Ada at. start by letting x = 1. were repeated until the value of the fraction was completely calculated. Nevertheless. consist- (2x) (2x –1) … (2x –2n +2) … + Bn ing of a “store” (memory). B5 and so on. the few published articles on the engine of noble lineage. Al- and their college friend Charles Bab. to use modern ical Engine to a group of mathemati- computer programming parlance. women—remained poor. It factor (2x –4). among other uses. Italy. because each numerator contains the tion. She mathematician named Luigi Federico then divided the second factor of the numerator by the second factor of the de. at which with some additional notes from Bab- point it was multiplied by the appropriate Bernoulli number. so you can eas. Ada be. The first five Bernoulli numbers are 1⁄6. Ada used a second loop. It could perform only mathematics during Ada’s youth. be. . This leaves: idea borrowed from the Jacquard loom. She started by dividing the first factor Among those attending was a young of the numerator by the first factor of the denominator and storing that value. These steps ter). which is 0 when x = 2. the Analytical Engine would have none of the restrictions of the Difference En- gine. Simon Laplace.T. Notice that the fraction Babbage intended to rely on punched next to B1 becomes 1 and that the fractions next to B2. The substituted expression is: would be able to execute or repeat a set 0 = (– 1 × 3 ) + (B1 × 2) + B2 of instructions based on certain condi- 2 5 tions (“if x. published a paper in French enti- tled “Sketch of the Analytical Engine. in modern computer science known as ily see that B2 = –1⁄30. and discussing it with Babbage. he began outlining to Ada a new machine T he Bernoulli numbers are found in the polynomial expansion of some trigonometric functions that were once employed for constructing naviga- tional tables. an early calculating machine [see addition and subtraction and solve a se- the state of mathematical education for “Redeeming Charles Babbage’s Mechan. ries of polynomial equations (such as 0 = a + bx + cx 2 + dx 3 . Bernoulli number.” by Doron D. For the next several mathematician Augustus De Morgan. B3 and so on all equal 0. conditional branching. it would possess an 6! architecture remarkably similar to that of today’s modern computers. it was limited bage were helping to rejuvenate British his partially completed Difference En. or CPU) and a punched-card reader (input device). outrageous ideas as for his work in math. For various reasons. which is 0 when x = 1.E. a central concept You already know the value of B1 from the previous substitution. the indices Ada used in her program were all odd numbers: In 1840 Babbage made his first and B1. B3. Bn x ex– 1 n≥0 n! Working with Babbage For her program. mathematician and physicist Pierre. 1⁄42. if you let x = 2. came well schooled in the principles of years. Computing each Bernoulli only public presentation on the Analyt- number one at a time constituted the outer loop of the program. ). computationally. then y”). 1833. Mathe. logic and calculus. To compute the fractional value next to each cians and engineers in Turin. A few weeks “mechanical” steps of calculation. British known for his political activism and his gine as a machine that would generate mathematics was floundering. Now. a “mill” (2n)! (central processing unit. but gine. because both or punched cards. Swade. one that would be sig- nificantly more advanced than the Dif- ference Engine. As their friendship deepened. reading unusual at the time. multiplication and division. Inc. even for someone On June 5. —E. the Difference Engine closely. Scientific American.her translations of the works of French young people—and especially young ical Computer. She was captivated. as opposed to B1. mathematical tables. automating the maticians De Morgan.

the fourth Bernoulli number). or. 9 gine. not 3. B3 One flaw in Ada’s program is that she does not use a variable and B5. braical formulae.” publishing the first paper to discuss the ical Engines rather than on their under. Babbage had remained which combined are more than twice as compute any algebraic formula proper. takes V12 and adds it to V13 . Each row represents a single operation. V10 is used to store the number of iterations left to per. be.A. REPRINTED FROM SCIENTIFIC MEMOIRS. n (which in this case is 4. Ada’s Scheme for Computing the Bernoulli Numbers A da’s program for computing B7. values. 2. Operations 13 through 21 calculate the next value and The values of these variables are 1. An ly expressed (or programmed) on the of her work in early 1843. cause Ada is calculating B7. (The superscripts in the and stores that value in V10. When V10 equals 1. Operation 7 subtracts 1 from n and assigns it to V10 because the first iteration is complete. III. and on hearing long as Menabrea’s original article. and the program is finished computing the Bernoulli in Ada’s program in Operation 21. he encour. Operation 11 When the program begins. to keep track of each iteration while calculating the fractional form. . it was to be the only such paper outlined the purpose of the various com. where the third factor of the number. they store the value in V12. V2. EDITED BY RICHARD TAYLOR. Ada—who had since married William programming of a computer at great lying mechanical operations. the earl of Lovelace.) plete. VOL. Inc. as she does with V10 when she computes the product of tion. which was calculated the variables. at the second itera. and B. At the first iteration. earlier and stored in V21. there are six variables in use: V1. Also. another form of analytical notation. V10 is equal to n –1. V21. denominator should be 4. the loop the fractions by the previous Bernoulli numbers. is shown. the fourth Bernoulli num- ber. Menabrea King. wrote. collaboration that resulted in Ada’s nings of both the Difference and Analyt. multiply it by B5. Operations 8.T. important theme was the significance of punched cards. the countess of Lovelace—read Mena.E. and the remaining columns represent the values of each of and 10 calculate 2n/2 and multiply it by B1. and become length. 1843 Menabrea focused his attention pri. The first six columns demonstrate the vari- ous operations that would be performed by the Analytical En- The first six operations calculate ( 1⁄2) × (2n–1) / (2n + 1) and store the value in V13 . and operation 12 subtracts 2 from n V3. the Analytical Engine’s ability to be pro- Ada and the First Computer Scientific American May 1999 79 Copyright 1999 Scientific American. V22 and V23 [see shaded boxes]. With that suggestion began a major marily on the mathematical underpin. note a bug stops.K. —E. a good friend of Ada’s. B1. and so on. V10 is equal to n –2. recognized that it would be able to into English. She in- ponents of the Analytical Engine and brea’s paper and began translating it cluded seven notes in all (A through G). in existence for the next century. to express it better. “are merely a translation of alge. “The cards.” Menabrea aged her to annotate the translation. because the second iteration is com- chart indicate the number of times the variable has been used.

for between Ada and Babbage that have ences. but a portion (above) consisting of part of the mill tance of the engine’s ability to branch to Babbage had written (CPU) and the printing devices was assembled shortly be- different instructions based on certain for the Engine. in reali. In addition. letters between 80 Scientific American May 1999 Ada and the First Computer Copyright 1999 Scientific American. 21 years later in his autobiography. as Menabrea had stated and regret not having earlier explored the Bernoulli numbers program. however.the British government’s lack of sup- ability to reuse the necessary data & formulae. this is clear from her depth of un- a rigorous notation for expressing the tent.” wrote Ada. . “It and face-to-face. is the introduction into it of the computing Bernoulli principle which Jacquard devised for numbers. . Babbage’s notebooks and autobi. impractical. Pray do not alter it. two things are clear. in de. racy of her descriptions. LONDON leaves. cards. riving Bernoulli num- lowed any desired pattern—or equa. It was far more the Analytical Engine. Ada often as. mony and of musical composition were could have answered many questions Ada wrote. in one of adaptations. lor’s Scientific Memoirs.” she asserted.BABBAGE’S ANALYTICAL ENGINE was never com- emphasized the computational impor. most were written by Ada. Babbage tried to insert into tation. Bab. know regarding Ada’s Jacquard loom for weaving patterned cloth (right). Ada’s program for de- forming calculations—because they al. both through letters with De Morgan two years before but originate anything. the printer. plex than any program pleted. Alan M.” Over a century later of his machine and to confirm the accu. Sadly. which were published in Richard Tay. The engine would have been pro- conditions.” Babbage responded. description of the punched-card mecha. matician Jakob Ber- the most complicated patterns in the noulli wrote about his fabrication of brocaded stuffs. so rich a vein of the noblest metal. by means of punched cards. . first SCIENCE MUSEUM LIBRARY. ble to compute and what was. the engine might compose my Notes. If.” the engine.furious and sent him an angry letter. prose. an idea borrowed from the between what was theoretically possi.out by human head & hands first. “I want to put in something susceptible of such expression and about her path of understanding. “The Analytical En- A da compiled her notes between Feb. Ada’s own notebook is lost. fore his death in 1871. Analytical Engine’s con- Ada went on to elaborate greatly on ditional branching ca- Menabrea’s descriptions and to exam. intelligence. Ars conjectandi (The the Jacquard-loom weaves flowers and Art of Conjecture). ers of the engine. We numbers in a classic say most aptly that the Analytical En. Of the letters They eventually resolved their differ- tial to compose music: “Supposing.grammed using the Jacquard punched fied in her publication. and Babbage’s preface was pub- instance. she resisted any changes to her derstanding regarding the process of formula on the punched cards. Babbage at the very least pro- Objection. Ada also wrote about respondence between Ada and Bab. From this letter. and she drew the distinction All that historians grammed using punched cards. a programming and from her improve- bage had adopted a tabular format for month before the final proofs went to ments on Babbage’s programming no- expressing programs. pability and used two ine the gritty details of programming loops.” cussed her progress often with Babbage (Ada had studied Bernoulli numbers gine has no pretensions whatever to during this period. Pas- ming the Analytical Engine. .Bernoulli numbers. about Bernoulli’s Numbers. In August 1843. for example. . including a All this was impossible for you to know sages from the Life of a Philosopher.vided the formulas for calculating The remainder of Ada’s notes were tant to return your admirable & philo. Babbage to explain the inner workings ry of the formula for generating them.her notes a preface complaining about the benefits of the Analytical Engine’s bage. a fact he confirmed devoted to the mechanics of program. then there had to be was open to suggestions regarding con. . sophic Note A. Ada debunked the notion that the engine was “thinking” in the ways that humans think. ography.” was certainly capable of writing the the punched cards merely expressed an Ada sought Babbage’s opinions and program herself given the proper for- algebraic formula.mula. . book about probabili- gine weaves algebraical patterns just as ty.) der it to perform. lished separately and anonymously. she wrote of its poten. Ada was scribing the symbolic processing pow. she ambitious and com. On ed Bernoulli numbers was Ada’s idea.” Cards were a particularly clever published in 1713. and Ada’s notes themselves. which Ada modi. “I am very reluc. solution for weaving cloth—or for per.First. that the fundamental relations survived. Swiss mathe- regulating. work comes from cor- ty. She in his article and Ada had reaffirmed. Inc. Additionally. without having been worked Finally. Second. by intuition and the more I read your We cannot know for certain the ex- nism and of the notation for writing notes the more surprised I am at them tent to which Babbage helped Ada on programs. “The distinctive characteristic of Ada ends her notes the Analytical Engine. port for his Analytical Engine. bers demonstrated the tion—to be generated automatically. Although she relied on apparently needed to refresh her memo- can do whatever we know how to or. . it In a letter to Babbage dated July 1843. dubbing it “Lady Lovelace’s reading a draft of Note A. Give ruary and September 1843 and dis. For example. as an example of how an im- elaborate and scientific pieces of music Babbage and the Notes plicit function may be worked out by of any degree of complexity or extent. . of pitched sounds in the science of har. including a program that comput- mous in a landmark lecture on artificial tonished Babbage with her insights. Turing made her sentiment fa. with her program for “.

Dobb’s Journal write this program cannot be overstat. particular has become a figure whose were limited to the mathematical for. & all matical incompetence. “The evidence of the tenu. cult to credit about one who succeeded life and work still stir the imagination mula and that Ada created the program in gaining a contemporary and posthu. of many computer scientists today. Also. EUGENE ERIC KIM and BETTY ALEX- been made out with extreme care. You will admire the one of Menabrea’s statements. The importance of Ada’s choosing to as “A. where she Because of her earlier tutelage. & most suc. One of Stein’s assertions Ada’s health. Anthony Hyman.” a math. functional substitution (proving What we now know about designing an equation by substituting a and programming computers may not function with its identity). S herself. if there were not so much of it. which was poor on and versity Press. lege in San Rafael.” have worked incessantly. Stein quotes letters be. perhaps Ada’s most outspo. and failed tween Ada and her tutors that to realize the importance of conditional CORBIS-BETTMANN show that Ada had difficulty with branching. Toole re- none of them approached the complex.L. Ada’s stand than about concepts she had al.” mathematical statement. off throughout her life. He programs for the Analytical Engine in others. Cambridge Univer- sity Press. Ada even Ada Lovelace while working on their under- lously attended to. Inc. Ada. While she was working on the mous reputation as a mathematical tal- program. And Ada in indicate that Babbage’s contributions subject of mathematics would be diffi. derstand functional substitution is ceived both her B. tively obscure until 1953.” when it should have work and of Ada’s paper. ing that her tutors were helping her for perback version. the Enchantress of such as conditional branching. He is the author of CGI Developer’s Guide and of an upcoming ed. The level of mathemati- tion of Menabrea. It is specialized in history of science and the inte- gration of technology into education. Princeton Uni- Legacy in 1985. Howard Aiken. all day. that al- the author of Ada.D. the First Computer and of the abridged. pa- of the Analytical Engine’s key features. a history of computers that Menabrea. but it The Authors Table & Diagram extremely. England at the time and that Ada was Byron’s Daughter and Her Description of gram would nicely demonstrate some learning via correspondence.A. who also overlooked the errors. when Ber- First. Ada. she was buried next Stein’s conclusion is based pri. Mena. Calif. to “when the cos n = ∞. with Ada’s work. cessor of Babbage. Berkeley. limiting her ability to prac- writing the Bernoulli numbers tice mathematics. them made their conceptual break- er translation would have been throughs independently. and Ed. He was not familiar Second. from the ity of the Bernoulli numbers program. holds a bachelor’s degree in history and sci- his notebook in 1836 and 1837. to her father.” but Ada the Harvard University professor who translated the statement literally designed and built the Mark I in 1944. Toole is a consultant and an adjunct profes- sor of computer science at Dominican Col- Bernoulli numbers in his article. more serious. in which she translated mentioned Ada’s work and called her a a French typo into an impossible “prophet. Stein be directly traceable to Babbage and writes. but all of read “le cas de n = ∞.” miswrote her initials on her final note graduate and graduate theses. declined further Ada and the First Computer Scientific American May 1999 81 Copyright 1999 Scientific American. eventually became aware of Babbage’s de n = ∞.L. pages of translation and annotations in San Mateo. but Stein’s charge that Ada did not un. but they can claim precedence for Babbage and Ada at the time seem to ousness with which she grasped the many of these concepts. ence from Harvard University.L. Ada wrote to Babbage. Babbage had written several small were peer-reviewed by Babbage and book on the history of free software.” Her 65 Kim is technical editor at Dr. however. Dubbey. probably of uterine can- since been expressed by others. M. any discussion of Ada’s work shows that despite the fact that Ada would not be complete without men. program tied in nicely with her transla. who wrote Ada: A Life and a stood it when she began writing them. cer. Recogniz.” The prop. 1982. Ada indeed mistakenly translated cessfully. Bowden compiled Faster than cal error in Ada’s translation of Thought. because Menabrea had alluded to the them about matters she did not under. she most likely under. was that Ada was an incompetent math. she points out a mathemati. . At her request. free. 1978. ready grasped. She died on Novem- program herself. ematician who was not capable of after 1843.” instead of “A. because it is a vital con. the Enchantress of Num- properties. Ada was more likely to write to Numbers: Prophet of the Computer Age. however. It is possible that Ada recog. gebra was cutting-edge mathematics in bers: A Selection from the Letters of Lord nized that a Bernoulli numbers pro. They have cannot be fairly attributed to mathe. tram V. Many modern computer pioneers brea’s original paper read “le cos. an idea that has ber 27. Charles Babbage: Pioneer of the Com- ken critic. “in the case of n = ∞. University of California. puter. J. respectively. liked to consider himself a direct suc- ematical impossibility.A. Her work remained rela- marily on two pieces of evidence. It was not the ANDRA TOOLE both became interested in the indices most minutely & scrupu. “I ent. on her notes. Calif. She is at least familiar with the numbers’ crucial to remember. cal sophistication in her late letters Further Reading Finally. may have had trouble with functional The Mathematical Work of Charles tioning Dorothy Stein of the University substitution before she began working Babbage. of London. 1852. Ada was cept for computer programmers. only mistake in her article.