How to use this course
Charles Babbage is remembered for two machines that he never finished. The Difference Engine would have computed and printed mathematical tables without human error. The Analytical Engine, designed from the 1830s, had a memory, an arithmetic unit, punched-card programs and conditional branching: the logical outline of a general-purpose computer, a century before one was built. Babbage was also a serious mathematician, a founder of scientific societies, a pioneer of the economics of production, a cryptanalyst and a fierce critic of the British scientific establishment.
- Single-variable calculus and basic algebra of polynomials.
- Elementary number theory: congruences and modular inverses.
- For Lesson 07, the idea of a Turing machine or a simple register machine is helpful but not required.
- For Lesson 08, power series and the generating function \(x/(e^x-1)\).
Each technical lesson opens with a paragraph for the general reader, then gives precise statements, derivations and exercises with folded solutions. Lessons 04 and 09 cover Babbage's pure mathematics; Lessons 05 to 08 follow the engines from finite differences to programming; Lesson 10 treats his economics.
Timeline
| 1791 | Born 26 December in London, son of the banker Benjamin Babbage and Betsy Plumleigh Teape. Baptised 6 January 1792. |
| c.1800–10 | Schools at Alphington near Exeter and at Enfield; private tutors. |
| 1810 | Enters Trinity College, Cambridge, in October. |
| 1812 | Founds the Analytical Society with John Herschel, George Peacock and others; moves to Peterhouse. |
| 1814 | BA from Peterhouse. Marries Georgiana Whitmore on 25 July. |
| 1815–16 | An Essay towards the Calculus of Functions, in two parts, in the Philosophical Transactions. Elected Fellow of the Royal Society (1816). English translation of Lacroix's calculus, with Herschel and Peacock. |
| 1819 | Theorem on binomial coefficients modulo \(p^2\). Begins a small model difference engine. |
| 1820 | Co-founds the Astronomical Society of London; Fellow of the Royal Society of Edinburgh. |
| 1822 | 14 June: paper to the Astronomical Society announcing the Difference Engine; open letter to Sir Humphry Davy. |
| 1823 | First Treasury grant; Joseph Clement engaged to build the engine. |
| 1824 | Gold Medal of the Astronomical Society. |
| 1827 | Death of his father, his wife and two children. Publishes logarithm tables. |
| 1828 | Elected Lucasian Professor at Cambridge while travelling abroad; holds the chair until 1839. |
| 1830 | Reflections on the Decline of Science in England. |
| 1831 | British Association for the Advancement of Science founded. |
| 1832 | On the Economy of Machinery and Manufactures. Demonstration section of the Difference Engine assembled. Stands for Parliament at Finsbury. |
| 1833 | Meets Ada Byron, later Countess of Lovelace. Dispute with Clement; work on the engine stops. |
| c.1834–37 | Designs the Analytical Engine; first programs written in 1837. Co-founds the Statistical Society of London (1834). |
| 1837 | The Ninth Bridgewater Treatise. |
| 1840 | Lectures on the Analytical Engine in Turin. |
| 1842 | Peel's government abandons the Difference Engine. Luigi Menabrea publishes an account of the Analytical Engine. |
| 1843 | Ada Lovelace's translation of Menabrea, with her Notes A–G. |
| 1847–49 | Designs Difference Engine No. 2. |
| 1850s | Breaks the Vigenère and autokey ciphers; the work stays unpublished. |
| 1864 | Passages from the Life of a Philosopher. |
| 1871 | Dies 18 October at 1 Dorset Street, Marylebone, aged 79; buried at Kensal Green. |
| 1991 | The Science Museum, London, completes the calculating section of Difference Engine No. 2 from his drawings. |
London and Devon, 1791–1810
Charles Babbage was born in London on 26 December 1791, probably at Walworth in Southwark, and baptised at St Mary's, Newington, on 6 January 1792. His father, Benjamin Babbage, was a wealthy banker from Totnes in Devon; his mother was Betsy Plumleigh Teape. He was one of four children, and the family money later allowed him to work without needing a salary.
He was a sickly child. Around the age of eight he was sent to a country school at Alphington near Exeter for his health, and he spent a short time at the grammar school in Totnes. The decisive school was Holmwood Academy at Enfield, north of London, run by the Reverend Stephen Freeman, which had a good library. There Babbage discovered mathematics and taught himself from books. Later he was tutored privately, including by a clergyman near Cambridge and by an Oxford tutor who prepared him in classics.
By the time he reached Cambridge he had read some continental analysis, including work of Lagrange, and was eager to learn more of it.
Cambridge and the Analytical Society, 1810–1815
Babbage entered Trinity College, Cambridge, in October 1810. He was disappointed. Cambridge mathematics was still built on Newton's fluxions and dot notation, while the continent had developed the calculus in Leibniz's \(d\)-notation into a powerful algebraic analysis.
In 1812 he and fellow undergraduates founded the Analytical Society to promote continental methods. Its leading members besides Babbage were John Herschel, son of the astronomer, and George Peacock. Babbage joked that the society stood for the principles of pure \(d\)-ism against the dot-age of the university. With Herschel he wrote the Memoirs of the Analytical Society (1813), and the three friends published an English translation of Lacroix's elementary calculus in 1816, with a volume of examples in 1820. Peacock, as an examiner, soon introduced the \(d\)-notation into the Mathematical Tripos, and within a generation Cambridge had changed.
In 1812 Babbage moved to Peterhouse. He took his BA in 1814 without honours and without sitting the examination. On 25 July 1814 he married Georgiana Whitmore, against his father's wishes, and the couple moved to London in 1815. They had eight children, four of whom survived to adulthood.
Tables, errors and steam, 1815–1822
In London Babbage lived on an allowance from his father and wrote mathematics. His two-part Essay towards the Calculus of Functions appeared in the Philosophical Transactions in 1815 and 1816 (Lesson 04), and he was elected a Fellow of the Royal Society in 1816, at 24. He lectured on astronomy at the Royal Institution and applied unsuccessfully for several academic posts. In 1819 he and Herschel visited Paris and met leading French scientists, including Laplace. Babbage learned how Gaspard de Prony had produced great tables of logarithms and trigonometric functions in the 1790s by dividing the work among a few mathematicians, some calculators of moderate skill and many human computers who only added and subtracted. The lesson he drew was that the lowest level of the work was mechanical.
In 1820 Babbage and Herschel were among the founders of the Astronomical Society of London, later the Royal Astronomical Society, and Babbage served as one of its first secretaries. The society needed accurate astronomical tables. Babbage's own account says that while checking computed tables with Herschel and finding error after error, he exclaimed that he wished the calculations had been executed by steam. Navigational and astronomical tables of the day were computed by hand, copied by hand and set in type by hand, and every stage introduced errors.
He began a small model engine in 1819 and had it working by 1822. It computed tables of polynomials by the method of differences (Lesson 05). On 14 June 1822 he described it in a paper to the Astronomical Society, and in July he published an open letter to Sir Humphry Davy, President of the Royal Society, on applying machinery to the calculation of tables. The Royal Society reported favourably, and in 1823 the Treasury gave him a first grant to build a full-scale engine.
The calculus of functions
For the general reader. An ordinary equation asks for an unknown number. A functional equation asks for an unknown function. Babbage's first research, published in 1815 and 1816, was one of the earliest systematic studies of such equations. A typical question: which functions undo themselves when applied twice, like \(x\mapsto -x\) or \(x\mapsto1/x\)? He found a general way to produce all of them from one example.
- State the problem of functions of finite order and Babbage's conjugation principle.
- Construct involutions and functions of order 3.
- Characterize Möbius transformations of finite order.
Functions of finite order
Write \(\psi^n\) for the \(n\)-fold composite \(\psi\circ\cdots\circ\psi\). Babbage asked for the general solution of
\[ \psi^n(x)=x, \]the functions he called periodic of order \(n\). For \(n=2\) these are involutions. His key observation is that the solutions form a conjugacy-closed family.
Let \(f\) satisfy \(f^n(x)=x\) on a set \(X\), and let \(\varphi:Y\to X\) be any bijection. Then \(\psi=\varphi^{-1}\circ f\circ\varphi\) satisfies \(\psi^n(x)=x\) on \(Y\). Conversely, on an interval of \(\mathbb R\), every continuous involution other than the identity is of the form \(\varphi^{-1}(-\varphi(x))\) for some continuous strictly increasing \(\varphi\) with \(\varphi(c)=0\) at its fixed point \(c\).
Proof of the first part. \(\psi^n=\varphi^{-1}\circ f\circ\varphi\circ\varphi^{-1}\circ f\circ\varphi\circ\cdots=\varphi^{-1}\circ f^n\circ\varphi=\mathrm{id}\). For the converse, a continuous non-identity involution on an interval is strictly decreasing and has exactly one fixed point \(c\). Take \(\varphi(x)=x-c\) for \(x\ge c\) and \(\varphi(x)=c-\psi(x)\) for \(x<c\); one checks \(\varphi(\psi(x))=-\varphi(x)\). Babbage's own treatment was formal and did not specify domains or continuity; the precise version is modern.
Möbius transformations
The maps \(x\mapsto\dfrac{ax+b}{cx+d}\) with \(ad-bc\ne0\) compose like the matrices \(\begin{pmatrix}a&b\\c&d\end{pmatrix}\), up to a scalar factor. So the map has order dividing \(n\) exactly when \(M^n\) is a scalar matrix. Over \(\mathbb C\), when \(M\) is diagonalizable with eigenvalues \(\lambda_1,\lambda_2\), this happens iff \((\lambda_1/\lambda_2)^n=1\).
Exercise 4.1Show that \(\psi(x)=\dfrac{1}{1-x}\) has order 3, and use conjugation by \(\varphi(x)=1/x\) to produce another function of order 3.
Show solution
Exercise 4.2Show that a Möbius map \(x\mapsto\frac{ax+b}{cx+d}\) other than the identity is an involution iff \(a+d=0\).
Show solution
Exercise 4.3Find all functions of the form \(\psi(x)=\varphi^{-1}(-\varphi(x))\) with \(\varphi(x)=\log x\) on \((0,\infty)\). What is the fixed point?
Show solution
The method of differences
For the general reader. To tabulate the squares 1, 4, 9, 16, 25, … one can avoid multiplication. The gaps between them are 3, 5, 7, 9, and the gaps between those are always 2. So each new square is the previous one plus a gap, and each new gap is the previous gap plus 2. Any polynomial can be tabulated this way, using addition alone. This is the principle of the Difference Engine.
- Prove that the \(n\)-th difference of a degree-\(n\) polynomial is constant.
- Run the engine's algorithm and compute its starting values.
- Analyse how errors in the starting values propagate.
Forward differences
For a function \(f\) and step \(h\), define \(\Delta f(x)=f(x+h)-f(x)\) and \(\Delta^{k+1}=\Delta(\Delta^k)\).
If \(f\) is a polynomial of degree \(n\) with leading coefficient \(a_n\), then \(\Delta^nf\equiv n!\,a_nh^n\) is constant and \(\Delta^{n+1}f\equiv0\). Moreover, for every integer \(m\ge0\), Newton's forward-difference formula holds:
\[ f(x+mh)=\sum_{k=0}^{n}\binom{m}{k}\Delta^kf(x). \]Proof. \(\Delta\) lowers the degree by one: \(\Delta x^n=(x+h)^n-x^n=nhx^{n-1}+\cdots\). Applying it \(n\) times to \(a_nx^n+\cdots\) leaves \(n!\,a_nh^n\). For the formula, write the shift operator as \(E=1+\Delta\), so \(E^m=\sum_k\binom mk\Delta^k\), and the sum stops at \(k=n\).
The engine's algorithm
Store \(D_0=f(x_0)\), \(D_1=\Delta f(x_0)\), …, \(D_n=\Delta^nf(x_0)\) in \(n+1\) registers. Each step performs
\[ D_0\leftarrow D_0+D_1,\quad D_1\leftarrow D_1+D_2,\quad\dots,\quad D_{n-1}\leftarrow D_{n-1}+D_n, \]in that order, each using the old value of the next register. After \(m\) steps \(D_0=f(x_0+mh)\). The engine needs \(n\) additions per table entry, and \(D_n\) never changes.
Non-polynomial functions
Logarithms and sines are not polynomials, but on a short interval they are well approximated by one. The engine tabulates the approximating polynomial over that interval; then the operator resets the starting differences, computed independently, for the next interval. Babbage's planned engines had six (No. 1) and seven (No. 2) orders of differences, enough for very accurate tables over useful intervals.
If the starting value of \(D_k\) is wrong by \(\varepsilon\), and the rest are exact, then after \(m\) steps \(D_0\) is wrong by exactly \(\binom mk\varepsilon\).
This follows from the forward-difference formula and linearity. Errors in high differences grow fast, so starting values must be exact; conversely, a final check value computed independently at the end of an interval verifies the whole run.
Exercise 5.1For \(f(x)=x^2+x+41\) with \(h=1\), give the starting values at \(x_0=0\) and run three steps of the engine.
Show solution
Exercise 5.2Find the starting differences for \(f(x)=x^3\), \(h=1\), \(x_0=0\), and verify the constant third difference.
Show solution
Exercise 5.3A sixth-order engine is started with \(D_6\) wrong by one unit in the last place. After 100 steps, how large is the error in the table? What does this imply for practice?
Show solution
The Difference Engine as a machine
For the general reader. Babbage's engines store numbers on columns of brass wheels, one wheel per decimal digit. Turning a crank adds one column into another. The hard parts are carrying (when 9 becomes 10, the next wheel must advance) and timing (several additions must happen without interfering). Babbage solved both, and in 1991 the Science Museum in London proved his second design worked by building it.
- Describe the architecture of Difference Engines No. 1 and No. 2.
- Understand the carry problem and why it dominates the time of an addition.
- Prove the correctness of the two-phase addition scheme with staggered differences.
Architecture
Difference Engine No. 1 was planned in the 1820s for numbers of 20 digits and six orders of difference, with about 25,000 parts and a weight of several tons. Only a demonstration section, about one-seventh of the whole, was assembled in 1832; it worked with six-digit numbers and two orders of difference and is still in the Science Museum. Difference Engine No. 2, designed in 1847–49, was far simpler: eight columns (the table value and seven differences) of 31 digits, about 8,000 parts in the calculating section. The Science Museum completed it under Doron Swade in 1991, and its printer and stereotyping apparatus in 2002. It weighs about five tons and works as designed.
Carrying
Adding two numbers digit by digit is fast; the carries are slow, because a carry from the lowest digit may have to travel through every higher digit (as in \(999\ldots9+1\)). Babbage separated the two: first all digits are added simultaneously, and any wheel that passes from 9 to 0 sets a warning lever; then the carries are executed in a separate phase. For the Analytical Engine he invented anticipating carriage, which detects in advance the runs of 9s that a carry will pass through and completes all carries in one operation. This is the idea of the carry-lookahead adder in modern processors.
Two phases
A column cannot be read and added to at the same moment. Babbage's solution was to add all odd-numbered difference columns into the even-numbered ones in one half-cycle, and all even into odd in the other half-cycle. This halves the time of a step but means that the even columns run ahead. The engine works if it is started from staggered values.
Let \(f\) be a polynomial of degree \(\le n\), \(h=1\). Suppose that at the start of step \(k\) the columns hold \(D_m=\Delta^mf(k-\lfloor m/2\rfloor)\) for \(m=0,\dots,n\). Perform phase A: \(D_{2j}\leftarrow D_{2j}+D_{2j+1}\) for all \(j\); then phase B: \(D_{2j+1}\leftarrow D_{2j+1}+D_{2j+2}\) for all \(j\), using the values just updated. Then the columns hold \(D_m=\Delta^mf(k+1-\lfloor m/2\rfloor)\); in particular \(D_0=f(k+1)\).
Proof. Phase A: \(\Delta^{2j}f(k-j)+\Delta^{2j+1}f(k-j)=\Delta^{2j}f(k-j+1)\), the required new value. Phase B: \(D_{2j+2}\) now holds \(\Delta^{2j+2}f(k-j)\), so \(D_{2j+1}\) becomes \(\Delta^{2j+1}f(k-j)+\Delta^{2j+2}f(k-j)=\Delta^{2j+1}f(k-j+1)\). Both match the invariant at step \(k+1\). The top difference is constant, so its index does not matter.
Exercise 6.1Use the staggered scheme for \(f(x)=x^3\) starting at \(k=1\): give the initial column values and run one step.
Show solution
Exercise 6.2With sequential (ripple) carry, how many carry operations in sequence can an addition of two 31-digit numbers require in the worst case? Give an example.
Show solution
Exercise 6.3Difference Engine No. 2 has seven orders of difference. How many additions does one table entry need, and how many half-cycles does the two-phase scheme use?
Show solution
The Analytical Engine
For the general reader. A difference engine does one job. From about 1834 Babbage designed a machine that could do any calculation, given the right instructions. It had a store for numbers, a mill that did arithmetic, and punched cards, borrowed from the Jacquard loom, to say which operation to perform on which numbers. Crucially, it could choose what to do next according to the results so far. These are the essential features of a computer.
- Describe the store, the mill and the three kinds of cards.
- Explain conditional branching and why it makes the design universal.
- Write simple programs in an Analytical Engine style.
Architecture
- The store: columns of figure wheels, each holding a signed number. Babbage's plans envisaged up to about 1,000 numbers of 40 or more digits. In modern terms, this is memory.
- The mill: the arithmetic unit, performing addition, subtraction, multiplication and division, with registers for operands and results. Multiplication used a table of the first nine multiples of the multiplicand, formed in advance. In modern terms, the processor.
- Cards: operation cards selected the operation; variable cards named the store columns to read from and write to; number cards supplied constants. Separate card chains for operations and variables let the same operations be applied to different data.
- Control: the cards could be advanced or backed up by a set number of positions, depending on a condition such as the sign of a result. This gives loops and conditional branches.
- Output: a printer, a curve plotter, and a card punch so that results could be stored and read back later.
Babbage wrote programs for the engine from 1837 to 1840. In 1840 he described it in lectures in Turin; the engineer Luigi Menabrea, later prime minister of Italy, published an account in French in 1842, which Ada Lovelace translated and annotated (Lesson 08). Menabrea reported Babbage's estimate that the engine would multiply two 20-digit numbers in about three minutes.
Universality
A register machine has finitely many registers holding natural numbers and a program of numbered instructions: increment a register, decrement a register, and jump if a register is zero.
A register machine with two or more unbounded registers can compute every partial recursive function, given a suitable encoding of input and output. In particular, it can simulate any Turing machine.
The Analytical Engine can add and subtract a constant to any store column and back up or advance its cards on the sign of a result, so it can simulate any register machine whose registers fit in its store. An idealized Analytical Engine with unbounded store and unbounded card supply would therefore be Turing-complete. The real design was finite, as every physical computer is. Alan Turing made the same point in 1950, noting that the engine was a universal digital computer in principle.
Exercise 7.1Write an Analytical Engine style program, using store columns \(V_1,V_2,V_3\), subtraction, and "back up \(k\) cards if the result is negative", to compute \(q=\lfloor a/b\rfloor\) for positive integers \(a,b\).
Show solution
Exercise 7.2Using the formula \(\gcd(a,b)=\gcd(b,a\bmod b)\) and the program from 7.1 as a subroutine, describe a program for Euclid's algorithm. Which feature of the card system lets the subroutine be reused?
Show solution
Exercise 7.3The Harvard Mark I of 1944 multiplied two 23-digit numbers in about six seconds. Compare with Menabrea's figure for the Analytical Engine, and with a processor doing \(10^9\) multiplications per second.
Show solution
Note G and the Bernoulli numbers
For the general reader. In 1843 Ada Lovelace published a translation of Menabrea's paper with notes three times its length. In the last note, G, she worked out in full how the Analytical Engine would compute the Bernoulli numbers, a sequence that appears throughout analysis and number theory. The table of operations in Note G is often called the first published computer program. The mathematics behind it is a recurrence that lets each Bernoulli number be computed from the earlier ones.
- Define the Bernoulli numbers and derive their recurrence.
- Understand the recurrence used in Note G and its indexing.
- Trace the loop structure of the program.
Bernoulli numbers
The Bernoulli numbers \(B_m\), named after Jacob Bernoulli, are defined by
\[ \frac{x}{e^x-1}=\sum_{m\ge0}B_m\frac{x^m}{m!}, \qquad B_0=1,\ B_1=-\tfrac12,\ B_2=\tfrac16,\ B_4=-\tfrac1{30},\ B_6=\tfrac1{42},\ B_8=-\tfrac1{30}, \]and \(B_m=0\) for odd \(m\ge3\). Multiplying both sides by \(e^x-1\) and comparing coefficients of \(x^{m}/m!\) gives
The form in Note G
Note G numbers the non-zero Bernoulli numbers of even index with odd subscripts: its \(B_1,B_3,B_5,B_7\) are the modern \(B_2,B_4,B_6,B_8\). In that notation, the equation programmed is, for \(n\ge1\),
\[ 0=-\frac12\cdot\frac{2n-1}{2n+1}+B_1\frac{2n}{2}+B_3\frac{2n(2n-1)(2n-2)}{2\cdot3\cdot4}+\cdots+B_{2n-1}. \]The coefficient of \(B_{2k-1}\) is \(\binom{2n}{2k-1}\big/(2k)\), and the last coefficient equals 1. So each new number is minus the sum of the earlier terms. The program in Note G computes the fourth of these numbers, \(B_7\) in her notation, from \(B_1,B_3,B_5\) already in the store. Its table lists 25 operations on store columns, with an inner loop that builds each coefficient as a product of factors and an outer loop over \(k\). Historians still debate how much of the program was Lovelace's own work and how much came from Babbage's earlier examples; the notes as published, including their reflections on what such a machine could and could not do, are hers. The published table contains one known slip, a pair of operands written in the wrong order in operation 4.
Exercise 8.1Use the Note G equation with \(n=1,2,3\) to compute \(B_1,B_3,B_5\) (her numbering).
Show solution
Exercise 8.2Carry out the computation that Note G programs: find \(B_7\) (her numbering) from \(n=4\).
Show solution
Exercise 8.3Use the modern recurrence with \(m=3\) and \(m=5\) to show that \(B_2=\tfrac16\) and \(B_4=-\tfrac1{30}\), starting from \(B_0=1\), \(B_1=-\tfrac12\), and using \(B_3=0\).
Show solution
Primes and ciphers
For the general reader. Babbage loved puzzles of every kind. In 1819 he proved a neat fact about binomial coefficients and prime numbers that started a line of research still active today. Decades later he broke the Vigenère cipher, which had been called unbreakable for three centuries. He never published the method, and the credit went for a long time to a Prussian officer, Friedrich Kasiski.
- Prove Babbage's congruence for binomial coefficients.
- Understand the Vigenère cipher and the repeated-fragment attack.
- Find a key length and recover a key from a short ciphertext.
Babbage's congruence
For every prime \(p\ge3\),
\[ \binom{2p-1}{p-1}\equiv1\pmod{p^2}. \]Proof. \(\binom{2p-1}{p-1}=\prod_{k=1}^{p-1}\frac{p+k}{k}=\prod_{k=1}^{p-1}\Big(1+\frac pk\Big)\). Working in the integers modulo \(p^2\), where each \(k\) with \(1\le k\le p-1\) is invertible, expand the product: terms with two or more factors of \(p\) vanish, leaving \(1+p\sum_{k=1}^{p-1}k^{-1}\). Pairing \(k\) with \(p-k\), \(k^{-1}+(p-k)^{-1}\equiv0\pmod p\), so the sum is divisible by \(p\) when \(p\) is odd. Hence the product is \(1\pmod{p^2}\). In 1862 Joseph Wolstenholme showed that the congruence holds modulo \(p^3\) for \(p\ge5\).
The Vigenère cipher
Identify letters with \(\mathbb Z/26\). A key \(k_0k_1\cdots k_{L-1}\) of length \(L\) encrypts \(m_i\) as \(c_i=m_i+k_{i\bmod L}\). Each letter is shifted, but by an amount that cycles with period \(L\), which defeats simple frequency analysis. Babbage's attack, found in the 1850s and published independently by Kasiski in 1863, has two stages.
- Key length. When a common fragment of plaintext (such as THE) happens to fall at the same position relative to the key twice, it produces the same ciphertext fragment. The distance between such repeats is a multiple of \(L\), so \(L\) divides the greatest common divisor of the distances, apart from chance repeats.
- Shifts. Letters in positions \(\equiv j\pmod L\) are all shifted by \(k_j\). Each of these \(L\) subsequences is a Caesar cipher, broken by matching letter frequencies.
Babbage also broke the stronger autokey variant, in which the plaintext itself extends the key. His priority was established from his notebooks by Ole Franksen in 1985.
Exercise 9.1Check Babbage's congruence for \(p=3,5,7\).
Show solution
Exercise 9.2In a Vigenère ciphertext the trigram QXH appears at positions 14, 50 and 92, and the trigram RVA at positions 7 and 67. What is the most likely key length?
Show solution
Exercise 9.3Encrypt ENGINE with the key ADA (A = 0). Which repeated plaintext letters give repeated ciphertext letters, and why?
Show solution
The economy of machinery
For the general reader. To build his engines Babbage toured workshops and factories across Britain and Europe. In 1832 he published what he learned as On the Economy of Machinery and Manufactures, a best-selling analysis of how industry works. Its most famous idea is that dividing a job into tasks of different skill saves money, because each task can then be paid at the rate its skill requires. Economists now call this the Babbage principle.
- State the Babbage principle and distinguish it from Adam Smith's account of the division of labour.
- Compute labour costs with and without division.
- Connect the principle to de Prony's tables and to the engines.
The principle
Adam Smith had explained the gains from dividing labour by dexterity, time saved in switching tasks, and the invention of tools. Babbage added a different effect, which he regarded as the most important.
Suppose a product requires tasks \(i=1,\dots,r\) taking times \(t_i\), where task \(i\) needs a skill level that commands wage \(w_i\). If one worker does everything, the labour cost per unit is \(\big(\sum_it_i\big)\max_iw_i\). If the work is divided so that each task is done by a worker with exactly the needed skill, the cost is \(\sum_it_iw_i\), which is never larger and is strictly smaller whenever the wages differ.
Babbage illustrated the argument with the manufacture of pins in England, giving the time and wage of each stage, from drawing the wire to papering the pins. He applied the same reasoning to mental labour: de Prony's table project used a few mathematicians, some skilled calculators and many people who only added. The bottom layer of that hierarchy, pure addition by differences, was exactly what the Difference Engine mechanized. The book also discussed the cost of verifying quality, the economics of copying processes such as printing, and the advantages of large factories. Harry Braverman's 1974 study of labour named the Babbage principle and stressed its consequence: dividing work also deskills it.
Exercise 10.1Making one item takes 1 hour of skilled work (wage 12 per hour), 2 hours of semi-skilled work (wage 6) and 5 hours of unskilled work (wage 3). Compare the labour cost if one skilled worker does everything with the cost under full division.
Show solution
Exercise 10.2A table of 10,000 entries is computed by differences. Each entry requires 6 additions. A human computer makes one addition per minute at wage 1 per hour, and a mathematician computes one set of starting differences per hour at wage 10 per hour, needed every 100 entries. Find the labour cost, and the share that a difference engine would replace.
Show solution
Engines and controversies, 1823–1842
With government money from 1823, Babbage engaged the engineer Joseph Clement to build Difference Engine No. 1. The work pushed precision engineering forward: Clement's workshop developed new machine tools and standards of accuracy in order to make thousands of identical parts. Progress was slow, and costs rose. Babbage was awarded the Gold Medal of the Astronomical Society in 1824 for the invention.
In 1827 his father, his wife Georgiana and two of their children died. Babbage travelled on the continent for more than a year to recover. While he was away, in 1828, Cambridge elected him Lucasian Professor of Mathematics, the chair once held by Newton. He held it until 1839 but gave no lectures. His father's death also left him a large fortune. He settled at 1 Dorset Street, Marylebone, where his Saturday evening parties drew scientists, writers and politicians.
Reform and controversy
In 1830 Babbage published Reflections on the Decline of Science in England, a sharp attack on the Royal Society's leadership and on the lack of state support for science. The book helped lead to the founding of the British Association for the Advancement of Science in 1831. Babbage helped set up its statistical section in 1833 and was a founder of the Statistical Society of London in 1834. He stood for Parliament for the borough of Finsbury in 1832 and 1834 and lost both times. In 1837 he published The Ninth Bridgewater Treatise, an unofficial addition to a series on natural theology, in which he argued that a programmed machine could follow one law for a long time and then switch to another, as a model of how natural law could include apparent miracles.
Clement, Lovelace and the end of the first engine
In 1832 Clement assembled a demonstration section of the engine, which worked faultlessly and impressed visitors. In 1833 Babbage and Clement quarrelled over payment for moving the workshop, and Clement withdrew his workers and kept the tools. Work stopped. By then the Treasury had spent about £17,000, and Babbage a large sum of his own money. Meanwhile Babbage had conceived the Analytical Engine and asked the government to fund the new machine instead, which further weakened its confidence. In 1842 Robert Peel's government formally abandoned the project, after the Astronomer Royal, George Airy, advised that the engine would be of little use.
In June 1833 Babbage met the seventeen-year-old Ada Byron, daughter of the poet Lord Byron, who saw the demonstration section and became a friend and correspondent. After Menabrea's account of the Analytical Engine appeared in October 1842, Charles Wheatstone suggested she translate it, and Babbage encouraged her to add notes. Published in 1843 in Richard Taylor's Scientific Memoirs, the translation and notes remain the clearest contemporary explanation of the engine, including the remark that it might act on things other than numbers, such as musical notes.
DiscussionThe Difference Engine cost the Treasury about £17,000 and produced no tables. Using Lesson 11, argue either that the government was right to stop funding or that it misjudged the value of the engineering it had paid for.
Last decades and legacy, 1842–1871 and after
Babbage kept refining the Analytical Engine for the rest of his life, and in 1847–49 he designed Difference Engine No. 2, which used ideas from the Analytical Engine to need a third of the parts of the first. He offered it to the government, which declined. In Sweden, Georg Scheutz and his son Edvard built a working difference engine inspired by reports of Babbage's work; their larger engine was completed in 1853, shown at the 1855 Paris exhibition, and sold to the Dudley Observatory in Albany, New York. A copy built for the British government computed life tables.
His later years were full of projects and quarrels: cryptanalysis (Lesson 09), the economics of the Great Exhibition of 1851, which he criticized in print, and a long public campaign against street musicians and organ grinders, who in turn played outside his house. He declined a knighthood and a baronetcy. His autobiography, Passages from the Life of a Philosopher, appeared in 1864. He died at home in Dorset Street on 18 October 1871, aged 79, and was buried at Kensal Green Cemetery. Half of his brain is preserved at the Science Museum and half at the Hunterian Museum of the Royal College of Surgeons.
Legacy
- Computing: the Analytical Engine anticipated the separation of memory and processor, programs on punched cards, conditional branching and looping. His son Henry Prevost Babbage built a section of its mill, which computed a table of multiples of \(\pi\) in 1910. The engineers of the first electronic computers mostly worked without knowledge of Babbage's designs, and Howard Aiken's Harvard Mark I showed no influence from them, but Turing and later historians recognized the conceptual priority.
- Proof of concept: the Science Museum's Difference Engine No. 2, completed in 1991 for the bicentenary of his birth, showed that the design worked with the precision available in his time. A second copy was built for Nathan Myhrvold.
- Mathematics and science: the Analytical Society's reform of Cambridge mathematics; early work on functional equations; Babbage's congruence; and the founding roles in the Astronomical and Statistical Societies and the British Association.
- Economics: the Babbage principle remains a standard reference in the theory of the firm and the sociology of work.
Final projectChoose one technical lesson. Write a two-page account for a strong undergraduate that states the main result, works one example by hand, and explains how Babbage's machine or method would carry it out mechanically, including where errors could enter and how they would be caught.
Connections
People linked to Charles Babbage across this collection. A name without a link has no page here yet. See Charles Babbage in the network of all 337 lives →
Influenced by
- Joseph-Louis Lagrange
- Gaspard de Prony
- Silvestre François Lacroix
Influenced
- Alan Turing
- Georg Scheutz
- Joseph Wolstenholme
Colleagues and collaborators
- Ada Lovelace 1833-1852
- Augustus De Morgan
- David Brewster 1830-1831
- Pierre-Simon Laplace
- George Peacock 1812-1820
- Joseph Clement 1823-1833
- Luigi Federico Menabrea 1840-1842
Rivals
Friends
- John Herschel 1812-1871
- Mary Somerville
Family
- Henry Prevost Babbage
Also mentioned in this life
- Arthur Cayley
- Humphry Davy
- Euclid
- Leonhard Euler
- William Rowan Hamilton
- Jacob Bernoulli
- Gottfried Wilhelm Leibniz
- August Ferdinand Möbius
- Isaac Newton
- Charles Wheatstone
Fields
- mathematics 15 lives
- cryptanalysis 3 lives
Sources and further reading
Biography and history
- J. J. O'Connor and E. F. Robertson, Charles Babbage, MacTutor History of Mathematics.
- Charles Babbage, Wikipedia (with extensive references, including the ODNB entry).
- C. Babbage, Passages from the Life of a Philosopher, Longman, 1864.
- A. Hyman, Charles Babbage: Pioneer of the Computer, Princeton University Press, 1982.
- D. Swade, The Cogwheel Brain (US title The Difference Engine), Little, Brown, 2000.
- J. M. Dubbey, The Mathematical Work of Charles Babbage, Cambridge University Press, 1978.
- C. Babbage, Reflections on the Decline of Science in England, 1830.
Mathematics and machines
- C. Babbage, An essay towards the calculus of functions, Phil. Trans. R. Soc. 105 (1815); Part II, 106 (1816).
- C. Babbage, Demonstration of a theorem relating to prime numbers, Edinburgh Philosophical Journal 1 (1819).
- L. F. Menabrea, Sketch of the Analytical Engine invented by Charles Babbage, translated with notes by A. A. Lovelace, Scientific Memoirs 3 (1843). Online text.
- Difference engine and Analytical engine, Wikipedia.
- C. Babbage, On the Economy of Machinery and Manufactures, Charles Knight, 1832.
- O. I. Franksen, Mr. Babbage's Secret: The Tale of a Cypher and APL, Prentice Hall, 1985.
- A. M. Turing, Computing machinery and intelligence, Mind 59 (1950).
- M. L. Minsky, Computation: Finite and Infinite Machines, Prentice Hall, 1967.
- J. Wolstenholme, On certain properties of prime numbers, Quart. J. Pure Appl. Math. 5 (1862).