# Constructing Difference Engines

When I was in college, several decades ago, I relied heavily on a computational device called a slide rule and on a little, paperbound handbook of mathematical and scientific tables. I occasionally enjoyed simply browsing the handbook’s many tables, formulas, and other data. The table of random digits, by itself, presented intriguing mysteries.

I also wondered at times about the sources of all this information. Mathematicians and many others have relied on tables of logarithms, trigonometric functions, and other mathematical formulas for a very long time. Carl Friedrich Gauss (1777–1855), for one, pondered such tables in formulating ideas about the distribution of prime numbers (see Gauss’ Prime Tables at http://blog.sciencenews.org/2006/03/gauss_prime_tables_1.html).

Computing mathematical tables itself has a long history, often tied closely to astronomical and navigational requirements. In the 18th and 19th centuries, in particular, there arose a great need for large tables of numerical values of a wide variety of mathematical functions.

Newton’s method of differences is the basis of one technique for computing values of polynomial functions. Consider, for example, the quadratic polynomial p(x) = x2 – 4x + 3. Suppose that you want to compute the values of p(x) when x = 0, 0.1, 0.2, 0.3, 0.4, and so on.

In the table below, the first column contains the value of the polynomial, the second column contains the differences of two neighbors in the first column, and the third column contains the differences of two neighbors in the second column.

 p(0) = 3 3 – 2.61 = 0.39 p(0.1) = 2.61 0.39 – 0.37 =0.02 2.61 – 2.24 =0.37 p(0.2) = 2.24 0.37 – 0.35 =0.02 2.24 – 1.89 =0.35 p(0.3) = 1.89 0.35 – 0.33 =0.02 1.89 – 1.56 =0.33 p(0.4) = 1.56

Note that the values in the third column are constant. In general, if you start with any polynomial of degree n, the number in column n + 1 will always be constant.

With such a start, you can readily compute p(0.5). Starting from the right with the value 0.02, you subtract it from the value in the second column, 0.33 – 0.02, to get 0.31. Subtracting this result from the value for p(0.4), 1.56 – 0.31, gives the value p(0.5) = 1.25.

So, it’s possible to generate successive values of a polynomial without having to multiply.

This process can be automated in a mechanical device. In the 18th century, J.H. Mueller designed such a mechanism—a difference machine—but it was never built. Charles Babbage (1791–1871) revived the idea in 1821 when he proposed a design for a decimal-based difference engine operated by a hand crank. He designed a second, improved version between 1847 and 1849. However, Babbage made little progress in building either machine.

In 1985, the Science Museum in London launched a project to build a complete, working version of Babbage’s second difference engine. This model was completed and working in November 1991, 1 month before the anniversary of Babbage’s birth. See http://www.sciencemuseum.org.uk/on-line/babbage/index.asp.

Babbage’s second difference engine could hold seven numbers of 31 decimal digits each, allowing it to tabulate seventh-degree polynomials to high precision.

The challenge of reconstructing Babbage’s difference engines has also attracted others. In 2003, Tim Robinson constructed small-scale, working models of both of Babbage’s difference engines entirely from standard Meccano parts (see http://www.meccano.us/difference_engines/).

Andrew Carol, a software developer for Apple, recently built a working difference engine out of Lego pieces (see http://acarol.woz.org/LegoDifferenceEngine.html).

Although none of these models matches the complexity and intricacy of Babbage’s original designs, they are still mechanical calculators that do the same job that Babbage’s machines were supposed to do. They’re remarkable tributes to mechanical ingenuity—and patience.

Check out Ivars Peterson’s MathTrek blog at http://blog.sciencenews.org/.

Paid Content
{"ft_lang_label":"__label__en","ft_lang_prob":0.8885654,"math_prob":0.9275853,"size":4116,"snap":"2023-40-2023-50","text_gpt3_token_len":1035,"char_repetition_ratio":0.11429961,"word_repetition_ratio":0.015873017,"special_character_ratio":0.26020408,"punctuation_ratio":0.16901408,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98744726,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-26T23:14:28Z\",\"WARC-Record-ID\":\"<urn:uuid:87e0555e-9a16-40a3-9b0f-03467cd81f58>\",\"Content-Length\":\"441964\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d56daa9f-2212-4b2b-b01b-7ade204d86a6>\",\"WARC-Concurrent-To\":\"<urn:uuid:91e7f81a-7910-44ad-b534-a218b4b85013>\",\"WARC-IP-Address\":\"3.162.125.49\",\"WARC-Target-URI\":\"https://www.sciencenews.org/article/constructing-difference-engines\",\"WARC-Payload-Digest\":\"sha1:2QY25RI76PKV4CPFFKND64UKKWNSMHB5\",\"WARC-Block-Digest\":\"sha1:TNPL5GDJEOURCFCRSM3BNZLEKIPQBKIN\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233510225.44_warc_CC-MAIN-20230926211344-20230927001344-00677.warc.gz\"}"}