The Engine Men
One day in London, the sculptor Francis Chantrey mentioned that he had built a room-sized brick oven for drying the molds of a large bronze statue. Most visitors would have nodded politely and asked after the statue. Charles Babbage asked whether he might get in. With his friend Henry Kater, an army captain and physicist, Babbage stepped through the iron folding doors and had them shut behind him. The stone paving in the far corner glowed a dull red, and the thermometer stood at 265 degrees Fahrenheit, well past the boiling point of water. The two men stood sweating for five or six minutes "without very great discomfort," and came out unharmed. Recalling the outing years later, Babbage had only one small regret: his pulse had quickened, and "I ought to have counted but did not count the number of inspirations per minute."
That was Babbage all over. Born in London on 26 December 1791, the son of a wealthy banker, he went through seventy-nine years wanting to count, time and pry open everything within reach. Handed a new toy as a small boy, he invariably asked, "Mamma, what is inside of it?", and broke the toy open if the answer seemed vague. As an adult, he climbed down into the active crater of Mount Vesuvius in 1828 to watch molten lava up close, designed cow-catchers for locomotives, lighthouse signals and colored theater lights, cracked ciphers, and in 1857 published a statistical table of 464 broken plate-glass windows, recording that fourteen had been smashed by "drunken men, women or boys."
So nobody blinked when a story began circulating about Babbage and Alfred, Lord Tennyson. In 1842 Tennyson published "The Vision of Sin," in which a tavern cynic sings, "Every minute dies a man, / Every minute one is born" (later altered by Tennyson to "Every moment"). According to the tale, Babbage wrote to warn the poet that equal births and deaths would leave world population at a standstill, and proposed for the next edition, "Every moment dies a man, / Every moment 1 1/16 is born," adding that the true figure was too long for the meter, "but I believe the figure 1 1/16 will be sufficiently accurate for poetry." It is a glorious letter, and it is almost a pity Babbage never wrote it. The joke first appeared in an 1863 magazine piece by George Otto Trevelyan about an unnamed enthusiast for sanitary statistics, was attached to Babbage in Harper's Magazine in 1890 as a yarn that deserved to be true even if it wasn't, and acquired the "sufficiently accurate for poetry" flourish in the twentieth century. Still, it says everything about Babbage, who really had written an 1826 book on life-insurance tables, that for more than a century hardly anyone thought to check.
At Cambridge, which he entered in 1810, Babbage was already restless and hard to please. Finding his tutors still wedded to British calculus notation long after Europe had moved on (a hangover from the Newton and Leibniz quarrel that we explore elsewhere), he joined two fellow undergraduates in 1812, John Herschel and George Peacock, to drag the curriculum onto the Continent. He skipped the final honors exam rather than finish second to Herschel, and later held Cambridge's Lucasian chair of mathematics from 1828 to 1839 without once delivering a lecture. Learned bodies fared no better with him: the Council of the Royal Society, he wrote, was "a collection of men who elect each other to office and then dine together at the expense of this society to praise each other over wine and give each other medals."
What turned this prickly polymath into the prophet of modern computing was bad paperwork. In the early nineteenth century, anyone navigating a ship, surveying a railway, pricing an annuity or tracking a planet relied on thick printed books of trigonometric and logarithm tables, the labor-saving tables we met with John Napier. Every line in them had been worked out, copied and set in lead type by hand, by clerks whose job title, long before the word meant a machine, was "computer." Clerks grew tired, copyists swapped digits, and typesetters turned a 3 into an 8. Babbage estimated that table errors had cost the British government two or three million pounds and run ships aground. Dozing over a book of logarithms at Cambridge around 1812, he had already daydreamed about calculating tables by machinery. Then in 1821, proofreading hand-calculated astronomical tables aloud with Herschel and finding error after error, Babbage lost his temper and cried, "I wish to God these calculations had been executed by steam." Herschel thought a moment and said it was quite possible.
At first glance it is hard to see how brass gearwheels could compute logarithms or sines, since even plain multiplication is awkward to build out of cogs. Babbage knew, however, about a French project from the 1790s. Asked to produce vast new tables for the French land registry, the engineer Gaspard de Prony had opened Adam Smith's chapter on pin-making and decided to "manufacture logarithms as easily as one manufactures pins." At the top of his hierarchy sat a few leading mathematicians who chose the formulas; in the middle sat seven or eight algebraists who turned those formulas into starting values; and at the bottom sat sixty to ninety workers who knew nothing beyond addition and subtraction (according to a story historians repeat with fond caution, many were unemployed Parisian hairdressers whose aristocratic clients had lately lost either the taste for powdered wigs or their heads). Babbage saw the next step: if the bottom tier was doing nothing but routine addition, you could replace the hairdressers with brass.
The mathematical trick behind this is called the method of finite differences, and it is a small piece of arithmetic magic. Suppose you want a table of squares without ever multiplying. Write down the first five squares: 1, 4, 9, 16, 25. Subtract each from the next to get the first differences: 3, 5, 7, 9. Subtract each of those from the next to get the second differences: 2, 2, 2. Every one of them is 2, and one more subtraction gives nothing but zeros.
Now run the cascade backward using only addition. To find 6 squared after 25, add that constant 2 to the last first-difference, 9, giving 11, and add 11 to 25 to get 36. Do it again: 11 plus 2 is 13, and 36 plus 13 is 49, which is 7 squared; then 13 plus 2 is 15, and 49 plus 15 is 64, which is 8 squared. You can march into the thousands without once multiplying. Cubes (1, 8, 27, 64) hit a constant 6 on the third round of subtractions, and any sixth-degree polynomial hits a constant on the sixth round, meaning its seventh differences vanish. Because smooth curves like logarithms and sines can be closely matched over short stretches by polynomials, a machine that merely adds neighboring columns can tabulate almost anything a navigator needs. Asked to state his machine's principle in two words, Babbage remarked dryly that four would do ("the method of differences"), or six characters:
By June 1822 Babbage had a small model cranking out values of n2 + n + 41 at sixty answers every five minutes. Backed by the Royal Society, the Treasury granted him £1,500 in 1823 to build a full Difference Engine: twenty-five thousand parts weighing four tons, stacking ten-toothed decimal wheels to twenty digits across six orders of differences, and stamping answers straight into soft metal printing plates so no typesetter could muddle them. Babbage thought it might take three years.
Instead it ate twenty years and everybody's patience. In 1827 Babbage lost his father, his wife Georgiana and two of his children within months (inheriting about £100,000 from his father's estate and settling at 1 Dorset Street in Marylebone, where he built workshops behind the house). Meanwhile, cutting twenty-five thousand precision parts pushed Regency engineering to its limit. Babbage's master toolmaker, Joseph Clement, had to invent new lathes and jigs simply to shape the gears, lifting British machine-tool accuracy for a generation while sending bills that made Treasury clerks turn pale.
In 1832 Clement assembled a jewel-like working section of roughly two thousand parts, one-seventh of the calculating mechanism. Babbage displayed it in his drawing room beside a clockwork silver dancing girl he had bought at auction, noting ruefully that most guests preferred the dancer. The next year he and Clement fell out over expenses for moving Clement's workshop closer to Dorset Street. Clement downed tools, dismissed his men and, as English law then allowed, kept his specialized tools and working drawings. Roughly twelve thousand finished parts were eventually melted for scrap.
Worse, while ministers dithered for eight years over whether to rescue the project, Babbage cheerily told them he had invented a far grander machine that made the Difference Engine obsolete, rather like a bridge builder announcing halfway across the river that he now had lovely plans for a tunnel. In November 1842 Prime Minister Robert Peel killed the grant. Whitehall had spent £17,500, the price in 1831 of twenty-two brand-new steam locomotives from Robert Stephenson's works, and Babbage had spent £6,000 of his own. Dealing with Westminster left a scar. "On two occasions I have been asked," he wrote, "'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' In one case a member of the Upper, and in the other a member of the Lower, House put this question. I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."
Yet the machine he had conceived in 1834, the Analytical Engine, really did belong to another century. Driven by steam, it was a general-purpose mechanical computer with the exact logical layout of modern machines. Borrowing factory terms, Babbage separated memory from processor: a "store" of gear columns holding a thousand fifty-digit numbers, and a "mill" where numbers were brought to be added, subtracted, multiplied or divided, complete with conditional branching and loops. To instruct the mill, he borrowed from the French weaver Joseph Marie Jacquard, whose 1804 loom steered silk threads with chains of perforated cards; Babbage owned a woven silk portrait of Jacquard made from 24,000 punched cards that visitors mistook for an engraving. His engine would read operation cards for instructions and variable cards for addresses in the store. Tired of British ministers, he gave his one full public presentation in Turin in 1840, where a young Italian military engineer and future prime minister, Luigi Menabrea, wrote it up in French in October 1842.
Which was when Ada Lovelace stepped in and made the machine immortal.
Born Augusta Ada Byron on 10 December 1815, she was the only legitimate child of the poet Lord Byron and Anne Isabella Milbanke. Byron had dubbed his mathematically minded bride "the Princess of Parallelograms," confessing in 1812 that "I know that two and two make four, and should be glad to prove it too if I could, though I must say if by any sort of process I could convert two and two into five it would give me much greater pleasure." Five weeks after Ada's birth, Lady Byron fled her husband's rages for good; Byron sailed from England that spring and died in Greece at thirty-six, when Ada was eight. Lady Byron schooled her briskly in arithmetic (when six-year-old Ada preferred geography to sums, geography was replaced with more arithmetic), though historians Christopher Hollings, Ursula Martin and Adrian Rice note that the popular tale of mathematics used solely as a vaccine against poetry is overstated, since Ada loved music too and at twelve studied bird wings to design a steam flying machine.
On 5 June 1833, at seventeen, Ada met the forty-one-year-old Babbage at a party, and two weeks later visited Dorset Street to see the working piece of the Difference Engine; while others stared at it like a conjuring trick, a friend recalled, she understood its working and saw its beauty. Guided by the science writer Mary Somerville, she married William King in 1835 (becoming Countess of Lovelace in 1838), had three children in four years, and in 1840 persuaded the logician Augustus De Morgan to coach her by post through advanced algebra and calculus. De Morgan told her mother she had the makings of "an original mathematical investigator, perhaps of first-rate eminence."
In 1843 Lovelace translated Menabrea's French paper into English, and at Babbage's urging added seven appendices of her own. Signed "A. A. L." in Taylor's Scientific Memoirs that September, Notes A to G took up forty-one of the article's sixty-six pages, about three times the length of Menabrea's text. Babbage called her "the Enchantress of Number."
Two insights in those Notes saw further than anyone else in Victorian science. In Note A, Lovelace summed up the machine in one unforgettable line ("the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves") and saw something Babbage himself had barely glimpsed: because the gears merely followed abstract rules, the symbols did not have to stand for numbers at all. Express the relations of pitch and harmony in its notation, she wrote, and "the engine might compose elaborate and scientific pieces of music of any degree of complexity or extent." Yet in Note G she paired that vision with a warning that we shall meet again with Alan Turing: "The Analytical Engine has no pretensions whatever to originate anything. It can do whatever we know how to order it to perform."
Beside it in Note G unfolded a large table tracing how twenty-five operation cards, with operations 13 to 23 repeating in a loop, would compute the Bernoulli numbers, a tricky sequence of fractions named for Jacob Bernoulli, whom we met feuding with his brother in Basel. Calling Lovelace "the first computer programmer" without qualification flattens a true collaboration: Babbage had drafted unpublished sample programs in his notebooks by 1837, Menabrea's paper held simpler tables, and Babbage recalled in 1864 that he had worked out the Bernoulli algebra "to save Lady Lovelace the trouble." In the very next sentence, though, he added that she sent it back for repair, "having detected a grave mistake which I had made in the process." Whether first programmer or first debugger, she published the first complex looping algorithm ever written for a general-purpose computer, and did it for hardware that existed only in ink.
She never got to write a sequel. Chronic illness closed in soon after 1843; she lost heavily betting on horses with a syndicate, pawning family jewels and dying £2,000 in debt from uterine cancer on 27 November 1852. Like the father she never knew, she died at thirty-six, and at her own wish was buried beside him in Nottinghamshire. In 1980 the United States Department of Defense named its programming language Ada in her honor, numbering the standard MIL-STD-1815 for her birth year.
Babbage lived nineteen crankier years at 1 Dorset Street, tinkering with the Analytical Engine, drafting a sleeker, eight-thousand-part Difference Engine No. 2 between 1847 and 1849 (one-third the parts of his first engine, good to thirty-one digits) that Whitehall declined to touch, and waging war on London's street musicians. In a chapter of his 1864 memoirs titled "Street Nuisances," he reckoned that organ-grinders, brass bands and penny whistles had destroyed a quarter of his working power, "an additional income-tax upon the brain," logging 165 interruptions in eighty days. Neighbors bought damaged wind instruments to blow beneath his windows; jeering crowds of a hundred people and ragged-school children trailed him down Marylebone streets; dead cats landed in his area; and at one in the morning after he underwent a painful surgical operation, a brass band conferred in Manchester Square and marched up his street to blast him awake. He died on 18 October 1871, aged seventy-nine, leaving half his brain in a jar at London's Science Museum.
For more than a century, the sensible verdict was that Victorian metalwork simply could not build his designs; even a Swedish father and son, Georg Scheutz and his son Edvard, who built smaller difference engines in the 1850s, died bankrupt. Then in 1985 a Science Museum team led by curator Doron Swade set out to build Difference Engine No. 2 from Babbage's 1847 drawings, machining nothing more finely than a nineteenth-century workshop could manage. They finished the four-thousand-part calculating section in June 1991 for his bicentenary and added his four-thousand-part self-inking printer in 2002: five tons of iron, steel and bronze, eleven feet long, worked by a hand crank. Once a few small slips in the drawings were corrected, it turned smoothly and stamped out thirty-one-digit answers without a murmur. The gears had been ready all along. It was only the century that wasn't.