Skip to main content
  1. Posts/
  2. Computing History Series/

The Legend of the Difference Engine: Babbage's Unfinished Dream

sun.ao
Author
sun.ao
I’m sun.ao, a programmer passionate about technology, focusing on AI and digital transformation.
Table of Contents
Computing Through the Ages - This article is part of a series.
§ : This article

One night in 1821, Cambridge, England.

Two young men were flipping through a book of astronomical tables. The densely packed numbers were used by navigators for positioning.

“These tables are full of errors!” one young man said angrily. “These errors will cause ships to lose their way, or even sink!”

His friend asked, “So what can be done?”

The young man was silent for a moment, then said: “I will build a machine that automatically calculates these tables, never making mistakes.”

This young man was named Charles Babbage. He was about to design the most complex mechanical device in human history—the Difference Engine.

Who Was Babbage?
#

Babbage was born in London in 1791; his father was a wealthy banker.

He was fascinated by mechanics from childhood. Once, he asked his mother, “Why can’t toys move by themselves?” His mother said, “Because they have no life.” Babbage wasn’t satisfied with this answer; he began studying clocks, trying to understand how gears make hands turn by themselves.

Later he entered Cambridge to study mathematics. But he found that British mathematics education lagged far behind continental Europe. So he and several friends translated the latest European mathematical works into English, promoting the revival of British mathematics.

But what Babbage cared most about was another question: How to make calculation accurate and efficient?

In those days, all mathematical tables—logarithm tables, astronomical tables, insurance actuarial tables—were calculated by hand by “human computers.” These people sat at desks every day, performing tedious calculations with paper and pen.

Humans always make mistakes. One wrong number could cause ships to run aground, insurance claims to be wrong, scientific experiments to fail.

Babbage thought: If machines could calculate instead of humans, there would be no errors.

The Difference Engine: Calculating Polynomials with Gears
#

The machine Babbage designed was called the Difference Engine, because it used a mathematical technique called the “method of differences.”

What is the method of differences?

Suppose you want to calculate a polynomial, like f(x) = x² + x + 41. When x=0,1,2,3…:

xf(x)First DifferenceSecond Difference
041--
1432-
24742
35362
46182

Notice? The second difference is constant (all 2). This means that knowing just the first two terms, you can calculate all subsequent terms using simple addition!

43 + 4 = 47, 47 + 6 = 53, 53 + 8 = 61…

No multiplication needed, only addition! And mechanical devices are best at addition.

Babbage’s Difference Engine used gears to implement this calculation. Each gear represented a digit; turning gears was equivalent to addition. The machine could automatically calculate polynomial values, then print the results on paper.

Government Funding and Difficulties
#

In 1823, Babbage applied for government funding. The government was impressed by his plan and granted him £1,500—a huge sum at the time.

Babbage began building the Difference Engine. But he soon encountered problems.

The first problem was technical. The machining precision of the time wasn’t high enough; Babbage needed gear precision down to one-thousandth of an inch. He had to design new machine tools himself and train new workers.

The second problem was cost. The machine became increasingly complex, and the budget kept overrun. By 1833, he had spent £17,000 but completed only one-seventh of the machine.

The third problem was Babbage himself. He was a perfectionist, constantly modifying designs. Whenever he thought of a better solution, he would overturn previous work.

The government finally lost patience. In 1842, the Chancellor of the Exchequer announced the end of funding: “We don’t know if this machine can be completed, nor if it’s worth the money.”

Babbage wrote angrily: “The government wasted £17,000, and I wasted 20 years of my life.”

The Analytical Engine: A Concept Ahead of Its Time
#

But Babbage didn’t give up. In fact, he already had an even crazier idea in his mind.

While building the Difference Engine, he realized: Why build a machine that can only calculate polynomials? Why not build one that can calculate anything?

This was the concept of the Analytical Engine.

The Analytical Engine’s design contained all the core concepts of modern computers:

  • Store: To store data, equivalent to today’s memory
  • Mill: To perform calculations, equivalent to today’s CPU
  • Input/Output: Using punched cards for program input, printers for output
  • Branching and Looping: The machine could choose different execution paths based on conditions

This was essentially a modern computer! Except it used gears and steam power instead of electronics and electricity.

Babbage designed over 200 drawings and more than 3,000 types of parts. If built, this machine would have been the size of a small room.

But it was never built.

Ada Lovelace: The First Programmer
#

At Babbage’s loneliest moment, one person understood his dream.

She was Ada Lovelace, daughter of the famous English poet Lord Byron.

Ada was fascinated by mathematics from childhood. In 1833, at age 17, she met Babbage and his Difference Engine model and was immediately captivated. She later wrote: “The operation of this machine weaves algebraic patterns just as the Jacquard loom weaves flowers.”

In 1843, Ada wrote notes for an article about the Analytical Engine. In these notes, she wrote the first computer program in human history—an algorithm for calculating Bernoulli numbers.

More importantly, she foresaw the infinite possibilities of computers: “This machine can compose music, draw graphics, do anything that can be expressed in symbols.”

She is called the world’s first programmer. Although she never saw the Analytical Engine run, her thoughts transcended her era.

A Tragic Ending
#

Babbage died in 1871 at age 79.

He spent his life designing machines but never saw them completed. Only a few people attended his funeral; newspapers called him “a failed inventor.”

But history proved Babbage didn’t fail. He was simply too far ahead.

His design concepts were 100 years ahead of the world.

In 1985, the London Science Museum built a complete Difference Engine based on Babbage’s drawings. It has 8,000 parts, weighs 5 tons, is 3.4 meters long—but it actually works!

The results calculated by this machine are accurate to 31 decimal places. Babbage’s design was correct; only the machining technology of his era couldn’t meet the requirements.

Why Did Babbage Fail?
#

Looking back at Babbage’s life, we can see several key issues:

First, technical limitations. The mechanical machining precision of the 19th century couldn’t meet the complexity of Babbage’s designs.

Second, funding issues. Babbage constantly modified designs, causing costs to spiral out of control. If he had completed a simplified version first, the outcome might have been different.

Third, personality factors. Babbage was a perfectionist and a terrible project manager. He couldn’t compromise between “perfect” and “done.”

But Babbage’s greatest contribution was not the machines he built, but the questions he raised: Can machines think? Can machines be programmed? Can machines do anything that can be expressed in symbols?

The answers to these questions were given by another person 100 years later.

His name was Alan Turing.

His story continues tomorrow.


Today’s Key Concepts
#

Method of Differences A technique for calculating polynomials. For polynomial functions, if you repeatedly calculate the differences between adjacent terms, you eventually get a constant. This means you can use simple addition instead of complex multiplication to calculate polynomial values. Babbage’s Difference Engine was based on this principle.

Punched Card A method of storing information using holes. Holes in different positions on cards represent different data or instructions. Babbage’s Analytical Engine planned to use punched cards for program input. Later, IBM used punched cards for early electronic computers, becoming the primary data storage medium through the mid-20th century.


Discussion Questions
#

  1. Babbage’s Analytical Engine contained all the core concepts of modern computers. Can you identify what they correspond to in modern computers?
  2. If Babbage lived today, what kind of person do you think he would be? A programmer? An entrepreneur? Or a university professor?

Tomorrow’s Preview: Alan Turing and the Turing Machine—how a mathematician defined “computation” and laid the theoretical foundation for computers.

Computing Through the Ages - This article is part of a series.
§ : This article

Related articles