Polynomials and difference engines


A polynomial is a function in which the relationship between the variable x and the unknown y is expressed only in powers of the variable. Examples of polynomials are

y = 4x - 2               1st order polynomial
y = x2                   2nd order polynomial
y = 3x3 - 5x2 + 2x - 25  3rd order polynomial
y = 3x4 - 12x + 1        4th order polynomial

(The order of a polynomial is determined by the highest power of the variable.)

In a digital computer functions such as polynomials are represented through values at discrete intervals. The following table shows the principle; it lists the values of the polynomials for values of x from zero to 5 in increments of 1:

x (variable)            0    1    2    3    4     5
---------------------------------------------------
1st order polynomial   -2    2    6   10   14    18
2nd order polynomial    0    1    4    9   16    25
3rd order polynomial  -25  -25  -17   17   95   235
4th order polynomial    1   -8   25  208  721  1816
---------------------------------------------------

Difference engines work on the principle of repeated differences between values of the polynomial. The following table demonstrates this with the 3rd order example from above:

x (variable)         0    1      2     3     4       5
------------------------------------------------------
3rd order pol.     -25   -25   -17    17    95     235
first difference       0     8     34    78    140
second difference         8    26     44    62
third difference            18    18     18
------------------------------------------------------

Each row of differences is the difference of the values in the row above it. It is seen that the third difference is constant (in this case 18). This property can be used to calculate the polynomial

y = 3x3 - 5x2 + 2x - 25

exclusively through additions: Since the third difference is constant and in this case equal to 18, the next value in the row of second differences has to be 80 (= 62 + 18). The next value in the row of first differences is then 220 (= 140 + 80), which gives the next value of the polynomial itself, ie the value for x = 6, as 455 (= 235 + 220). This is the principle of the difference engine; values of functions are calculated through successive additions of differences.


home