In the 1820s, English mathematician and inventor Charles Babbage became frustrated by the errors he found in printed mathematical tables. To solve this problem, he designed a machine called the Difference Engine, a large mechanical calculator intended to perform complex calculations automatically and with greater accuracy.
While working on the project, Babbage developed an even more ambitious idea: the . Unlike earlier calculating machines, it was designed to follow instructions, store information, and perform different tasks depending on the program it was given. The design even included components similar to a modern computer’s processor and memory. Its instructions were to be fed in on punched cards, an idea Babbage borrowed from the Jacquard loom, which wove patterns into silk by following a chain of cards.
Although neither engine was completed during Babbage’s lifetime, the Analytical Engine’s design contained many of the fundamental concepts used in computers today. For this reason, Charles Babbage is often remembered as the “Father of the Computer.”
How can a machine made of gears produce a table of squares without ever multiplying? Babbage used a trick called the method of differences. Look at the squares 1, 4, 9, 16, 25. The gaps between them are 3, 5, 7, 9, and the gaps between those gaps are always 2. So every new line can be made by adding alone: add 2 to the last gap, then add that gap to the last square. Adding, with a carry from one wheel to the next, is exactly what gears do well.
Crank the Difference Engine
Turn the handle. Each turn adds every column into the one on its left, and the first column becomes the next line of the table. The printed table beside it contains two misprints, like the ones Babbage kept finding. Can the engine catch them?
| n | Engine | Printed |
|---|---|---|
| 1 | 1 | 1 |
| 2 | 4 | |
| 3 | 9 | |
| 4 | 16 | |
| 5 | 25 | |
| 6 | 36 | |
| 7 | 94 | |
| 8 | 64 | |
| 9 | 81 | |
| 10 | 100 | |
| 11 | 112 | |
| 12 | 144 |
The first line and its differences are set by hand. After that, the handle does the rest.
A simplified engine with three or four columns of four number wheels. Babbage’s designs had many more columns and much longer numbers, and a printer, so no human copying error could creep in.
Babbage’s work inspired mathematician Ada Lovelace, who recognized that the Analytical Engine could do far more than perform calculations. In 1843 she published detailed notes describing how the machine could solve a mathematical problem step by step, creating what is widely considered the world’s first computer program. Today, Ada Lovelace is celebrated as the first computer programmer.
She also saw that the engine’s numbers could stand for other things, such as musical notes, and suggested that such a machine might one day compose music.
A few decades after Babbage, a quieter revolution was taking shape in a very different setting — the United States Census. Tabulating the 1880 census by hand had taken about seven years. With the population growing fast, officials feared the 1890 count might not be finished before the next one began. A young engineer named Herman Hollerith had an idea: what if information could be encoded as holes punched into a card, and a machine could read them automatically?
He built exactly that. Hollerith’s tabulating machine used patterns of holes punched into paper cards to represent data — age, sex, nationality — and could count and sort millions of records far faster than clerks working by hand. To read a card, the clerk pressed a box of spring-loaded pins down onto it. Wherever there was a hole, a pin passed through into a small cup of mercury and completed an electric circuit, and that circuit moved a counting dial on by one. A bell rang to show the card had been counted.
Run the 1890 census
Choose the answers to punch, or tap the card itself, and press the card. Then feed a whole batch and watch the dials count.
Choose the answers to punch, or tap the card itself. Then press the card.
A simplified card with three questions. The real 1890 cards had room for many more answers, and a sorting box beside the machine opened the right lid for each card.
It cut the time needed to tabulate the census from about seven years to three. Hollerith went on to found a company that would eventually become IBM.
Cards could store information, but the machines that read them could only count and sort. The next idea was a machine that could do any job at all, if only it was given the right instructions.
Sources for this part
Babbage and Lovelace
- Charles Babbage’s Difference Engines and the Science Museum
- Difference Engine No. 2, built by the Science Museum – Science Museum Group Collection
- Women in Computing – Science Museum
The punch card