Question 94361
Soluton by Edwin McCravy:
`
Tutor Stanbon assumed you were taking statistics and were 
looking for a regression equation.  But you were not looking
for that.  You want to find a polynomial f(n) that will have
those values exactly.  
`
<pre><font size = 5><b>
I need help with two different charts:

n    1    2     3     4     5  
f(n) 0    4     20    54    112

To find the degree:
Make a difference table, by finding the
difference of each adjacent pair, writing
the differences until you find a line of
differences that are all the same.

n    1     2      3     4     5  
f(n) 0     4     20    54    112
1       4     16    34    58
2          12    18    24 
3              6    6
                 
It took 3 lines of differences to find
a line on which all the numbers are the 
same, so we know to assume a polynomial 
of degree 3:

f(n) = An³ + Bn² + Cn + D 

Since f(1) = 0,

f(1) = A(1)³ + B(1)² + C(1) + D = 0
f(1) = A + B + C + D = 0

So

Since f(2) = 4

f(2) = A(2)³ + B(2)² + C(2) + D = 4
f(2) = A(8) + B(4) + C(2) + D = 4
f(2) = 8A + 4B + 2C + D = 4

Since f(3) = 20

f(3) = A(3)³ + B(3)² + C(3) + D = 20
f(3) = A(27) + B(9) + C(3) + D = 2-
f(3) = 27A + 9B + 3C + D = 20

Since f(4) = 54

f(4) = A(4)³ + B(4)² + C(4) + D = 54
f(3) = A(64) + B(16) + C(4) + D = 54
f(3) = 64A + 16B + 4C + D = 54


So we have the system of equations:

  A +   B +  C + D =  0
 8A +  4B + 2C + D =  4
27A +  9B + 3C + D = 20
64A + 16B + 4C + D = 54

Do you know how to solve that system of
equations with matrices?  If not post
again asking how.  The solution is

A=1, B=0, C=-3, D=2

So

f(n) = An³ + Bn² + Cn + D so

f(n) = 1n³ + 0n² + (-3)n + 2

f(n) = n³ - 3n + 2
 
------------------------------- 

n    1     2     3     4     5
f(n) 2    17    86    275   674

Need to find degree and equation for the polynomial

Make a difference table, by finding the
difference of each adjacent pair, writing
the differences until you find a line of
differences that are all the same.

n    1     2      3     4     5  
f(n) 2     17     86    275   674
1       15     69   189    399
2          54    120    210 
3            66     90
4                 24
                  
We had to make 4 lines this time because
we didn't come to a row that was all the
same, so we had to take it all the way to
4 lines, so the degree is 4.

f(n) = An<sup><font size = 3>4</font></sup> + Bn³ + Cn² + Dn + E

Since f(1) = 2,

f(1) = A(1)<sup><font size = 3>4</font></sup> + B(1)³ + C(1)² + D(1) + E = 2
f(1) = A + B + C + D + E = 2

Since f(2) = 17

f(2) = A(2)<sup><font size = 3>4</font></sup> + B(2)³ + C(2)² + D(2) + E = 17
f(2) = A(16) + B(8) + C(4) + D(2) + E = 17
f(2) = 16A + 8B + 4C + 2D + E = 17

Since f(3) = 86

f(3) = A(3)<sup><font size = 3>4</font></sup> + B(3)³ + C(3)² + D(3) + E = 86
f(3) = A(81) + B(27) + C(9) + 3D + E = 86
f(3) = 81A + 27B + 9C + 3D + E = 86

Since f(4) = 275

f(4) = A(4)<sup><font size = 3>4</font></sup> + B(4)³ + C(4)² + D(4) + E = 275
f(4) = A(256) + B(64) + C(16) + 4D + E = 275
f(4) = 256A + 64B + 16C + 4D + E = 275

Since f(5) = 674

f(4) = A(5)<sup><font size = 3>4</font></sup> + B(5)³ + C(5)² + D(5) + E = 674
f(4) = A(625) + B(125) + C(25) + 5D + E = 674
f(4) = 625A + 125B + 25C + 5D + E = 674


So we have the system of equations:

   A +    B +   C +  D + E =   2
 16A +   8B +  4C + 2D + E =  17 
 81A +  27B +  9C + 3D + E =  86
256A +  64B + 16C + 4D + E = 275
625A + 125B + 25C + 5D + E = 674

Do you know how to solve that system of
equations with matrices?  If not post
again asking how.  The solution is

A=1, B=1, C=-4, D=5, E=-1

So

f(n) = An<sup><font size = 3>4</font></sup> + Bn³ + Cn² + Dn + E

f(n) = 1n<sup><font size = 3>4</font></sup> + 1n³ + (-4)n² + 5n - 1

f(n) = n<sup><font size = 3>4</font></sup> + n³ - 4n² + 5n - 1

Edwin</pre>