Here is a function that will find the differences between each pair of consecutive terms in a list:
|
|
Here is a list of random numbers:
|
|
|
|
|
|
The differences between random items will also be random.
See what happens with the differences between pairs of consecutive terms in a list of fibonaccis:
|
|
|
|
|
|
The differences between consecutive fibonaccis will themselves be fibonaccis!
See what happens with the differences between consecutive odd numbers:
|
|
|
|
Now see what happens with the differences between consecutive squares:
|
|
|
|
The differences between consecutive squares are consecutive odd numbers!
And so the differences between the differences are:
|
|
It took us 2 levels of differences to get a row of constants, and the formula n^2 has degree 2.
It only took us 1 level of differences with the odd numbers, and in that formula n had degree 1: 2n+1.
Here's a list of cubes:
|
|
|
|
|
|
|
|
Here we had to find 3 levels of differences before we got a list of constants.
That's the whole point of finding these differences -
The following cell will create a fourth degree polynomial function:
|
|
Here are the values of f(x) for x values between 0 and 10:
|
|
|
|
|
|
|
|
|
|
It took 4 levels of differences to reach a row of constants.
Here is the original function:
|
|
Again, a constant row of differences will only occur when f(x) is a polynomial function.
|
|
|
|
|
|
|
|
In this case the formula was 2^x. It's not a polynomial.
|
|
|
|