Banner ads
TechCo Hosting Information and Blog

Work in Progress by John Weller

January 22nd, 2009 ~ No Comments

Almost everyone who has been involved with computers will have heard of Charles Babbage, ‘the father of computing’, and his Difference Engine but how many of us know what the Difference Engine was and why it was so important? I hope to give a brief answer to these questions in this article.

The Difference Engine was a very specialised mechanical calculator. It is reported that Babbage spent about £17,000 of government grants and a similar sum of his own money on the project – an enormous sum of money in the early 1820s! It is impossible to give a direct comparison but using the per capita GDP it would equate to about £25 million at today’s values – not the AEW Nimrod of its time perhaps but in the same league as some of the more spectacular government IT failures of recent times.

Why was it so important? For that we have to look at the background. Britain had an extensive empire and was a major maritime trading power with one of the largest merchant fleets and the most powerful navy in the world at that time. One of the major issues facing maritime navigators was finding their position when out of sight of land. The only method available was to use the sun and stars. For accurate navigation several items are needed – an almanac showing the positions of the sun and stars, an accurate chronometer, an instrument for accurately measuring the angle between the star and the horizon and mathematical tables for carrying out the complex calculations. All of these were available to the 19th century navigator but the tables were of an indifferent quality for reasons that will become apparent. It was said that if a French ship was captured during the Napoleonic wars, the first item the British officers attempted to capture was not the code books, as might be expected, but the navigation tables because they were of better quality than those in use in the Royal Navy!

The values of logarithms and trigonometric ratios can be calculated by means of formulae. However, the computations required are difficult and tedious with purely human brainpower. But there was a mathematical shortcut that made these calculations much simpler. This shortcut is known as the method of finite differences.

If we look at a simple function, say
f(x) = 3×2 + 2x + 1
and evaluate it for x = 1 to 5 we get a series of values. We then take the difference between each result and the preceding result (the first difference) and tabulate it. Then we take the difference between the first difference for a value and the first difference for the preceding value (the second difference) and we will find that they are the same, as shown in Table 1. This is a consequence of the function being a second order function, i.e. the highest power of x is 2; if it had been, say, 5 we would have had to go to the fifth difference before we hit a constant.

We can now stop evaluating the function directly and use our table of differences, which will only require addition. If we add the first and second difference for a value to that value we will derive the next value in the series; adding the first and second differences will also provide the first difference for the next calculation with the second difference being the constant. So, in table 1, if we know the values shown bold, we can deduce the first ‘unknown’ 1st difference as 17 + 6 = 23 and hence the value of
f(4) as 23 + 34 = 57.

Table 1: Two subtractions produce a constant difference
x f(x) 1st diff. 2nd diff.
1 6    
2 17 11  
3 34 17 6
4 57 23 6
5 86 29 6
6 121 35 6

The manufacturing process used therefore was for good mathematicians to calculate the first few values manually until the constant difference was arrived at. Then the remainder of the table was derived by adding the differences as described above. This work could be left to less skilled clerks who did the addition manually and recorded their results in manuscript. (The clerks were known as ‘computers’ incidentally). The sheets containing their results were then set into type and printed to become the mathematical tables needed by the navigator. Unfortunately the opportunities for error were many and the consequences of an arithmetical error in the addition great in a cumulative system such as this. Typographical errors were also commonplace. The end result was a set of tables of dubious quality, which led to shipwrecks caused by navigation errors due to erroneous calculations. One of the most famous wrecks commonly attributed to inaccurate tables was that of Admiral Sir Cloudesley Shovell’s flagship, Association, off the Scillies in 1707.

Creating these tables without errors was the job the Difference Engine was designed for. Once the initial set of values and the constant difference had been set, the engine would mechanically calculate the subsequent values without error or fatigue. To eradicate the typographical errors, the results of each calculation were to be set as type and impressed into wet papier maché. When the papier maché sheet dried, it was to be used as a mould to create the typeface from which the tables could be printed directly. There would therefore be no human intervention between the original parameter set-up and the final printed tables.

So we can see that the need for such a device was great and the pressure to succeed high. Why, then, did it fail? There were several reasons but the main one was that the design, whilst quite ingenious, required a degree of accuracy in manufacture that was not available to Babbage’s workmen. For instance, the first standardised screw thread in the world, the Whitworth, was not invented until several years after work on the Difference Engine ceased. Another contributing factor was that Babbage lost interest when he conceived the concept of the Analytical Engine. The Difference Engine was to be a calculating machine with but a single purpose, the production of mathematical tables, but the Analytical Engine was to be a multipurpose machine capable of many more tasks. But that is another story…

Footnote: Interestingly, despite the superior quality of their existing tables, the French had embarked on an ambitious project, under de Prony, committing about 800 man-years to the same problem between 1791 and 1801. De Prony used the ‘human computer’ model and did indeed complete the task. However, he then found that it was simply too expensive to have the results printed! A partial set of tables appeared at the end of the 19th Century but they were never published in full. If we pay his workers £30,000 p.a. including on-costs (not unreasonably, since they would all have been pretty well educated for their time) we get a total cost of £24 million – very comparable to Babbage’s outlay. So Babbage and de Prony spent pretty much the same sums failing to solve the same problem by completely different means.

This article first appeared in the Visual Software Journal

John Weller is a Fellow of the Institution of Analysts and Programmers, and a Council member. You can contact John through the Institution, and purchase books at substantial discounts through the IAP Bookstore

If you are a software engineer, project manager, business analyst, process consultant, or involved in business improvement, you may be eligable for membership of the Institution of Analysts and Programmers.

Tags: History