The Philosophical Breakfast Club
Page 11
Babbage knew that a machine that could merely add, subtract, multiply, and divide was not of the utmost importance for scientific or commercial endeavors. What was really needed was a machine that could compute—and do so accurately—the kinds of tables used not only by men of science, but also by workers in nearly every field, from captains of ships to “captains of industry,” as Thomas Carlyle would soon scornfully call powerful businessmen.
Numerical tables were hugely important in the days before electronic computers. Such tables were used to look up figures that otherwise would require onerous calculations each and every time. There were tables of actuarial statistics for insurance agents; tables of astronomical data for astronomers and navigators; tables of taxation rates for excise officers; tables of compound interest rates and investment returns for bankers, investors, moneylenders, and clerks; tables with figures relating to strength of materials and distances for engineers, architects, surveyors, and builders; tables with figures relating to mapping a spherical earth on a flat surface for cartographers. There were tables of logarithms, tables of multiplication, tables of multiples of fractions, tables of conversions of units, and others. Such tables saved inordinate amounts of time, and therefore money. And, if calculated correctly, such tables could save lives.
For example, the computers of the Nautical Almanac provided sailors with tables containing precalculated predictions of lunar distances for every three hours of every day of the year. Lunar distances were used in determining a ship’s longitude, which allowed navigators to plot the fastest, safest course to the ship’s destination. The problem of determining longitude at sea had plagued explorers and navigators for centuries. Latitude, or north-south position, was fairly easy to determine from the positions of stars in the sky. But figuring out longitude—east-west position—was a more vexing quandary. It was known that the earth rotates at a rate of 15 degrees per hour. So if the local time could be compared to the time at another fixed point, then the difference between the two could be used to calculate longitude (with each hour of difference corresponding to 15 degrees of longitude difference). But finding the time at another fixed point presented a challenge.
If a clock set to Greenwich Time could be brought on board at the start of the voyage, and could continue to run accurately, the ship’s captain would be able to keep track of Greenwich Time and use that for his comparison with local time. However, clocks were run by pendulums, which were thrown off by the roiling of the sea, and which rusted easily in the salty air. In the mid-1700s, John Harrison designed a clock that could keep time on a long sea voyage, an invention that seemed to solve the longitude problem. But the Harrison chronometer was incredibly expensive to produce, and it was not until 1840 or later that most British ships carried one. Until then, the older method of lunar distances was routinely used to calculate the difference between Greenwich Time and local time.14
A navigator would use a sextant to measure the angle between the moon and a star (this was taking a lunar distance). He would consult the tables in the Nautical Almanac, which would give him the distances between the moon and nine easily observed stars, and the times at Greenwich at which those distances would occur. By comparing his observation with this table, the navigator would be able to determine Greenwich Time. He would then ascertain local time by using the sextant to observe the altitude of a star. Longitude could then be easily established, by comparing Greenwich Time with local time.
Having the Greenwich Time lunar distances precalculated in the tables saved even the most experienced sailors from having to spend over four hours making the calculations at sea in order to determine longitude, and decreased the chances of error. But the figures printed in the tables required extremely difficult calculations, which were themselves subject to error. Each month of the year required 1,365 calculations using logarithms applied to sexagesimal numbers, that is, numbers in base-60 (celestial distances are calculated in degrees, minutes, and seconds, where there are sixty seconds of arc in each minute, sixty minutes of arc in each degree, and 360 degrees in the celestial sphere). Although the results were checked, the printed tables in the Almanac still inevitably contained many mistakes.15
Such errors could—and sometimes did—lead ships to lose their way, even to be wrecked at sea. Babbage knew this well: his friend Whewell had survived a shipwreck in 1819, while trying to go from Brighton to Calais (luckily, another ship was nearby that safely delivered all the passengers back to Brighton). Later, Herschel would prey on the public’s fear of shipwrecks to prod the government to fund Babbage’s invention: “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,” he warned.16
But it wasn’t only the specter of error on the high seas that inspired Babbage to create his table-calculating machine. It was also hearing about the great French table-making project, the eighteen-volume Tables du Cadastre (the tables for the French Ordnance Survey), which had been supervised in the 1790s by the mathematician and civil engineer Gaspard-Clair-François-Marie Riche, Baron de Prony (1755–1839). De Prony had been commissioned to produce a definitive set of logarithmic and trigonometric tables for the newly introduced metric system in France, to facilitate the accurate measurement of property as a basis for taxation.
De Prony had recently read Adam Smith’s Wealth of Nations, originally published in 1776. In his book, Smith discussed the importance of a division of labor in the manufacture of pins. It made no sense, Smith cautioned, to have a man who was talented enough to temper iron also turn the grinding wheel, which could be done by an unskilled boy. It was a waste not only of talent, but of money, as the skilled man needed to be paid more per day than the unskilled boy. Smith’s analysis was taken up in Britain, leading to the establishment of the factory system of manufacturing there; instead of having finished products made, one at a time, by workers who made each one from start to finish, manufacturers began to divide up the labor into parts in something like a modern-day assembly line.
De Prony was the first to see that a Smithian division of intellectual labor could be equally valuable in the work of computation of mathematical tables—although his idea had been anticipated by Leibniz, who believed that talented mathematicians should be freed from tedious calculations that could be done by “peasants.”
De Prony set three sections to work. The first consisted in five or six mathematicians of the highest rank, including de Prony himself and Adrien-Marie Legendre, who made important contributions to number theory, mathematical analysis, abstract algebra, and statistics. They were in charge of the analytical part of the work: choosing the mathematical formulae to be used for calculations and setting the initial values of the numbers. The second section consisted of seven or eight highly skilled calculators, including the mathematician Antoine Parseval (who would later develop what is now known as “Parseval’s Theorem,” concerned with the summing of infinite series), who determined the values and the orders of difference that needed to be calculated, and set up the columns for each table, complete with the first values and instructions for how to compute the remaining values using only addition and subtraction. They passed these tables and the instructions to the third section, consisting of sixty to eighty men and women—many of them hairdressers unemployed after the French Revolution made the former elaborate, aristocratic hairstyles passé—who had only the basic rudiments of arithmetic. By performing additions and subtractions in the order prescribed by the second section, they filled in the tables. Their results were then sent back to the second section, which checked for errors. By 1794, seven hundred results were being produced each day. At the end of the project, almost a million figures had been computed, including a table of the logarithms of all numbers from one to 200,000, calculated to fourteen digits (including decimal places).17
Because of the incredible expense of printing the tables, they were not published until 1891, and then only in part. But by 1820 Bab
bage had read about the tables in scientific journals and the popular press. As soon as he learned of the tables, Babbage recognized the incredible power of the division of labor as applied to intellectual work.
He took it one step further. Not only should talented mathematicians like de Prony and Legendre not spend their time on simple calculations that could be done by unemployed hairdressers, but even the hairdressers’ labor was wasted when their work could be done by machinery.
Babbage would later outline his views in his book On the Economy of Machinery and Manufactures—in which a whole chapter is devoted to a discussion of de Prony’s tables—but it is clear that the main outlines of his view were in place by the early 1820s, when he called de Prony’s tables “one of the most stupendous monuments of arithmetical calculation which the world has yet produced.”18 In the book, Babbage later described de Prony’s system as resembling a “cotton or silk mill,” and noted that the calculations of de Prony’s third section “might almost be termed mechanical.”19
Babbage had realized that just as steam-driven mechanical looms were replacing men and women in the wool and cotton mills, so too could a machine replace the human computers. Babbage was undaunted by the prospect of putting the French hairdressers out of work (again), and seemed unconcerned that unemployed English computers would riot like the unemployed wool and cotton workers had done in Whewell’s home county of Lancashire in 1813 (it helped that these were still part-time laborers; only after 1832 did computing for the Nautical Almanac become a full-time job). During these labor disturbances and others that took place between 1811 and 1816 in the manufacturing districts in the north of England, displaced workers destroyed mechanized looms and clashed with government troops. The term Luddite was coined in this period, after Ned Ludd, an English laborer who was lionized for having destroyed two stocking frames in a factory around 1779. Babbage would have none of this Luddism. Progress in science and industry required more-mechanical means of calculation, as well as mechanical means of factory manufacturing, and nothing should stand in the way of that progress.
BABBAGE SET to work creating a machine that would calculate tables like a mechanized loom weaves wool cloth (he would later take the comparison even further, when the punched cards of the Jacquard loom would inspire Babbage to invent a computer that could be programmed using similar devices). He had realized almost at once that in order to make the machine general, such that it could calculate every type of table, its mechanism must be founded on a comprehensive mathematical principle, one that could be applied to all types of calculations. Babbage saw that the “method of finite differences” could be this principle.
The method of finite differences relies on a peculiar fact about polynomial functions. Polynomial functions are algebraic expressions constructed from variables and constants using addition, subtraction, and multiplication, with non-negative, whole-number exponents, for example F(x) = x2 ‒ 5x + 3. It is a mathematical law that any polynomial function of order n will have its nth order of difference constant, and each successive new value of the function can be obtained by n simple additions. So, for instance, a polynomial whose highest order is x2 will have its second order of difference constant, and require two additions to reach each successive value. Only addition, then, is necessary to calculate successive values of polynomial functions.20
To build a machine that can reliably calculate squares, or any more-complex polynomial function, Babbage realized, he needed only create a machine that could add orders of difference based on initial values of a function and initial values of the orders of difference fed into it from the start. Babbage christened his machine the “Difference Engine” in honor of this mathematical process. And since almost any regular mathematical function can be approximated by a polynomial to any required fixed accuracy with a fixed interval, Babbage saw that a machine that could add orders of difference could be used to generate almost any kind of numerical table.
This is what distinguishes Babbage’s achievement—and his machine—from all the efforts that had preceded it throughout history. Instead of creating another machine that could perform the four basic arithmetical operations, Babbage invented a calculating machine that was fully general—it could produce numerical tables of any kind, following any law initially impressed upon the machine. It was also fully automatic—no human intervention was required once the initial values were set, besides providing the physical power to the machine by turning the crank handle, Babbage having decided from the start that his machine would run on human, rather than steam, power.
Babbage’s mathematical brilliance enabled him to see that the method of difference could be harnessed to the calculations needed for computing almost any table, and also that such calculations could be done by machinery. He recognized both points rather quickly. What took much longer was designing the mechanism that could carry out those calculations accurately and quickly.
BABBAGE WAS SOON obsessed with his machine. He was working around the clock—not eating, hardly sleeping. His wife, Georgiana, called in his doctor, who warned Babbage to take some time off and relax, or else his health could be permanently impaired. Babbage went to stay with Herschel at Slough, and tried to put aside thoughts of the engine. But one day, when Herschel left Babbage at Slough to attend a meeting of the Board of Longitude in London—reminding them both of the problem with the tables in the Nautical Almanac—Babbage could not resist taking up a pencil and some paper and making sketches. By the time Herschel returned home, Babbage had worked out a preliminary plan for his Difference Engine.
The design Babbage showed Herschel upon his return home called for a series of vertically stacked toothed wheels, each wheel circled by engraved numbers from 0 to 9. A number such as 1,745 has four digits: the 5 represents the number of units, the 4 represents the number of tens, the 7 the number of hundreds, and the 1 the number of thousands. In Babbage’s design, this number would appear on four figure wheels stacked vertically, with the 5 on the bottom and the 1 on top. To represent this number, the toothed gear wheel at the bottom of the column would rotate five teeth around to show the 5, the next wheel, representing the 4, would rotate four teeth around to show the 4, and so on.
The engine Babbage designed in the 1820s had six columns, each with twenty figure wheels, to represent numbers up to twenty digits long. By 1830 his plans showed eighteen stacked figure wheels in each of seven columns, which would enable calculations of eighteen-digit numbers using polynomials up to six orders of difference. Had this machine been completed, it would have measured about eight feet high, seven feet wide, and three feet deep, an enormous size compared to the earlier calculating machines: Colmar’s first machine, the largest to that point, would take up a tabletop. Babbage’s would take up a good part of a room.21
The machine would be completely automatic after the initial setup. To set up the machine, a mathematician would first need to determine the correct polynomial function to use for calculating a desired table. Next, the finite differences for several evaluations of the polynomial would be manually computed. The operator—who need not be a mathematician, or have any knowledge of mathematical processes at all—would then set the results of the initial evaluation into the machine. First he would have to make sure that the whole engine was set to zero. Then the initial values for x = 0 would be set in the results column, to the far left of the machine, and the order of difference columns, to the right of the results column. The crank on the side of the machine would be turned four half turns, two in each direction. The machine would automatically advance the figure wheels to show the result and the orders of difference for x = 1. With another four half cranks the machine would advance to the correct results for x = 2.22 A series of figure wheels at the top of the machine would show the current value of x. No new intervention from the operator would be needed from this point on, no matter how many results were desired. The engine would just keep producing further values of the polynomial.
Babbage also devised an
ingenious solution to the problem of carrying tens, one that allowed his calculating device to work on extremely large numbers. We have seen that an obstacle for Schickard’s machine was that the force required to execute a ripple carry tended to be so much as to destroy the gear wheels. If a 1 is added to 999,999, then the force of the initial movement of the rightmost wheel had to be enough to turn all the other wheels up to the last one. Babbage realized that there had to be a way of allowing the carry in a different way, without the transmission of the initial force, in order to enable a calculating device to work on numbers twenty, thirty, forty, or even fifty digits long.
Babbage saw, too, that a system like Pascal’s, in which the carries occurred successively one after the other, would take far too long for large numbers; at that point the machine would be almost as slow as manual computation.
In Babbage’s Difference Engine, the carriage of tens would be performed in two steps. First the machine would execute the addition of all the digits at once by meshing the two columns digit for digit. Anytime the numbers on two meshed digits added up to 10, during the addition the lower wheel would advance from 9 to 0. But instead of having the wheel above it advance right away to 1, Babbage instead had a peg on the rightmost wheel nudge a lever into a new position, in which it was latched or “warned.”
Next, an arm would sweep over the levers. Whenever it encountered a warned lever, the arm would intersect with it and, in the act of sweeping over it, advance by one position the next wheel above in the column. If the lever was unwarned, the arm would pass over it with no interaction. In this way, Babbage allowed for the ripple carry even for huge numbers without requiring immense amounts of force, or long periods of time.23 Babbage referred to this action of successive carrying as being akin to “memory”: “The lever thrust aside by the passage of the tens, is the equivalent of the note of an event made in the memory, whilst the spiral arm, acting at an after time upon the lever put aside, in some measure resembles the endeavors made to recollect a fact.”24