Main menu

Home » Calculating Devices » Charles Babbage's difference engine

Early calculating machines, despite their ingenuity, were more like intellectual playthings than essential aids. Most of the functions that had to be calculated for standard tables were far more complicated. Charles Babbage (1791-1871) found a way to simplify these calculations, and in so doing conceived one of the earliest notions of a general-purpose computer. Never completed in his lifetime, a remaining fragment built by his son, Henry, demonstrates the working principles of Babbage's design.

Charles Babbage XR **(Image 1)** was born to a wealthy London-area banking family in 1791 and, after being educated in a number of schools and by various tutors, he enrolled at Trinity College, Cambridge in 1810. There, he befriended future Victorian science luminaries John Herschel XR (polymath astronomer and one of the first inventors of photography) and George Peacock (a noted mathematician), with whom he formed the Analytical Society to support the use of Leibniz's calculus over that of Newton.

Babbage was elected a fellow of the Royal Society G in 1816, just two years out of Cambridge, and eventually became Lucasian Professor of Mathematics in 1828, a position held once by Isaac Newton and, more recently, Stephen Hawking.

Babbage's life was typical of the 19th century gentleman scientist. Like many of his peers, inherited wealth allowed him to explore his interests and contribute to research in mathematics, astronomy, and engineering.

Babbage's largest project, the Difference Engine no. 1, was a machine intended to save the government money by preventing critical errors in tables calculated and copied by hand. But after twenty years of costly work on his design - in which time he suffered through personal disputes with his toolmaker Joseph Clement and lost his father, wife, and all but three of their eight children - the Difference Engine no. 1 remained uncompleted.

Tables of data generated from polynomial functions were critical for aiding navigation at sea using the lunar distance method of determining longitude G . But because such tables had to be calculated by human 'computers', they suffered from errors in both calculation and in transcription and typesetting for the printing process.

Babbage was something of a connoisseur of tables and fastidiously combed through them for errors. During a meeting with Herschel in 1821 to verify calculations made by human computers he lamented,

"I wish to God these calculations had been executed by steam." Babbage in 1821(1)

Babbage's idea, hatched over the following two years, was for a device that would reduce the calculation of polynomial functions to mechanical addition using the method of finite differences. The engine would be 'programmed' with a function and cranked by hand to deliver the result. It would also be equipped with a press that would allow results to be printed as they were calculated in real time and replicated on the spot without error.

In 1822 he received funding for the device, called the 'Difference Engine', and hired a toolmaker, Joseph Clement, to build it. The Difference Engine called for nearly 25,000 parts in total, one of the most complicated engineering feats attempted in its day.

Although the engine would only be able to calculate polynomial functions, these could approximate logarithms and trigonometric functions, which was of much use to scientists and navigators. Babbage often required support for the device from his friends in high scientific society, and John Herschel used a seafaring comparison to great rhetorical effect:

"An undetected error in a logarithmic table is like a sunken rock at sea yet undiscovered, upon which it is impossible to say what wrecks may have taken place." Sir John Herschel, 1842 (2)

Understandably, the government was more interested in reliable tables than the machine in principle. A demonstration model was constructed in 1832, but despite his best efforts Babbage never saw one of his engines put to work in his lifetime.

Funding was officially cut off in 1842 at which time he had spent over £17,000, ten times as much as originally intended. Somewhat embarrassingly, the British government purchased a difference engine based on Babbage's original design made by Swedes Georg and Edvard Schuetz, which they demonstrated at the World's Fair in 1855. Babbage, however, was already preoccupied with bigger problems.

Part of the reason for the failure of the Difference Engine No. 1 was Babbage's growing preoccupation with an even more ambitious project, his Analytical Engine, a machine more revolutionary, yet simpler in design, on which he began work in 1834.

Inspired by the punched cards used to set up the industrial loom of Joseph Marie Jacquard, the Analytical Engine would 'store' numbers and intermediate results, while a separate 'mill' would process them arithmetically. Its architecture and degree of programmability has led many to label it a forerunner to the electronic computer. For her written description of how the Analytical Engine could be used to calculate a series of numbers, Ada King, Countess of Lovelace, has been called the first computer programmer.

Babbage learned much from designing the Analytical Engine and in 1847 began work on his Difference Engine no. 2, which could calculate much larger polynomials than the original engine and would require only one third of the number of parts.

However, the Difference Engine no. 1, even as incomplete, has its own place in computer history. After his death, Babbage's son Henry XR continued to work out his father's engineering problems, having inherited original components made during the failed construction attempts.

By recombining these components, Henry produced the partial fragment held in the Whipple's collection **(Image 2)** in 1879, as a means of demonstrating the feasibility of his father's design. This fragment has only two axles, compared to the seven in the original, so it can only perform very simple calculations. Indeed, it was used in the 1950s in Cambridge University's computer laboratories to demonstrate the automation of simple addition.

A similar fragment at Harvard University may have inspired a young Howard Aiken XR , who developed the Harvard Mark I (or IBM Automatic Sequence Controlled Calculator), the electromechanical calculator used by the U.S. in the Manhattan project G .

- Quoted in: D. Swade,
*Charles Babbage and his Calculating Engines*(London: Science Museum, 1991). (Find in text ^) - Quoted in: D. Swade,
*Charles Babbage and his Calculating Engines*(London: Science Museum, 1991). (Find in text ^)

Mikey McGovern

Mikey McGovern, 'Charles Babbage's difference engine', *Explore Whipple Collections*, Whipple Museum of the History of Science, University of Cambridge, [http://www.hps.cam.ac.uk/whipple/explore/calculatingdevices/charlesbabbagesdifferenceengine/, accessed 25 May 2019]

http://www.hps.cam.ac.uk/whipple/explore/calculatingdevices/charlesbabbagesdifferenceengine/