9

I've learned a cool trick several days ago. Suppose I want to find a polynomial that gives me:

$$f(1)=1, \quad f(2)=5,\quad f(3)=14,\quad f(4)=30\tag{1}$$

I could do the following: Take a polynomial of degree $3$ and make the following system with it:

\begin{eqnarray*} {ax^3+bx^2+cx+d}&=&{1} \\ {ax^3+bx^2+cx+d}&=&{5} \\ {ax^3+bx^2+cx+d}&=&{14} \\ {ax^3+bx^2+cx+d}&=&{30} \end{eqnarray*}

I just need to substitute the $x^n$'s according to $(1)$. This gives me:

\begin{eqnarray*} {a1^3+b1^2+c1+d}&=&{1} \\ {a2^3+b2^2+c2+d}&=&{5} \\ {a3^3+b3^2+c3+d}&=&{14} \\ {a4^3+b4^2+c4+d}&=&{30} \end{eqnarray*}

Now this is easy, we need only to find the coefficients $a,b,c,d$, that is, find the inverse of a matrix $A$ in the matricial equations $Ax=b$:

$$\left( \begin{array}{cccc} 1 & 1 & 1 & 1 \\ 2 & 4 & 8 & 16 \\ 3 & 9 & 27 & 81 \\ 4 & 16 & 64 & 256 \\ \end{array} \right)$$

And then: $x=A^{-1}b$. This gives me:

$$a=\frac{1}{3}\quad\quad b= \frac{1}{2}\quad\quad c= \frac{1}{6}\quad\quad d= 0$$

That is, our polynomial is: $\cfrac{x^3}{3}+\cfrac{x^2}{2}+\cfrac{x}{6}$ and this is - at least to me - surprising because it is the formula for the sum of the first $n$ square numbers. What baffles me more is that if I do the same with a polynomial of degree $4$ and a $5\times 5$ matrix and $f(5)=55$ it will give me the same formula. So I have three questions:

  1. When I did this trick, I used only $4$ and $5$ values of the sum of the first $n$ squares. So why does it give me exactly the polynomial for the sum of the first $n$ squares instead of any other polynomial? There is an infinite abyss of possible polynomials, why exactly this one? For example: Why didn't it give a polynomial that gives me:

$$f(1)=1, \quad f(2)=5,\quad f(3)=14,\quad f(4)=30 \quad f(5)=55\quad f(6)=2\quad ?$$

  1. Why does the result holds for a higher $n$, that is: Why doing the same thing with $n+1$ gives me the same polynomial it gave me for $n$ instead of any other polynomial in the behemothic chasm of possible polynomials?

  2. I've tried for other formulas in the past, just like the sum of the first $n$ positive integers. Why does it hit exactly the polynomial for the sum of the first $n$ positive integers instead of any other polynomial in the humongous crevasse of possible polynomials?

Sorry if the question is too stupid, but I've figured this trick some time ago and couldn't find a clue to why this is hapenning. The main drama of the thing for me is that it seems as if I were doing incomplete induction and then BAM! it just hits exactly where I wanted it to hit.

Red Banana
  • 23,956
  • 20
  • 91
  • 192
  • 1
    something related to the input data ; try with $f(17.5)$ , $f(\pi/3)$ , $f(e)$ etc –  Aug 05 '16 at 04:09
  • 2
    A little error : $x=bA^{-1} $ should be $x=A^{-1}b$. – Jean Marie Aug 05 '16 at 04:21
  • @JeanMarie Yes, thanks. Totally forgot. – Red Banana Aug 05 '16 at 05:39
  • 1
    You seem to think this "cool trick" gives you only "a" polynomial satisfying your $n$ data points, rather than the unique* polynomial of degree at most $n-1$* satisfying your data. If you combine this fact with the fact that the sum of the first $n$ perfect $k$th powers is a polynomial of degree $k+1$, there is no mystery. – symplectomorphic Aug 05 '16 at 15:17

5 Answers5

4

Suppose that $f(x)$ is a polynomial of degree $n$. We denote $\Delta f(x)$ to represent $f(x+1)-f(x)$, and call this the forward difference operator. Using the binomial theorem we have $\Delta f(x)$ is of degree $n-1$. Using the binomial theorem again we deduce that $\Delta \Delta f(x)$ is of degree $n-2$.......$\Delta^{n-1}f(x)$ is of degree $1$, hence $\Delta^{k} f(x)=0$ for $k > n$.

Now suppose we have the sequence $f(0),f(1),f(2),...f(n)$ and we want to find an explicit form for $f(x)$. Then, note that we can sum both sides of:

$$f(i+1)-f(i)=\Delta f(i)$$

From $1$ to $x-1$ to get $f(x)=f(0)+\sum_{i=0}^{x-1} \Delta f(i)$ as we have a telescoping series. Now we can represent $\Delta f(x)$ in a similar manner, $\Delta \Delta $ in a similar manner ..... and we can combine all this.From this we can see that if the series converges:

$$f(x)=f(0)+\Delta (0) \sum_{x_0=0}^{x-1} 1+\Delta \Delta (0) \sum_{x_0=0}^{x-1} \sum_{x_1=0}^{x_0-1} 1+\Delta \Delta \Delta (0) \sum_{x_0=0}^{x-1} \sum_{x_1=0}^{x_0-1} \sum_{x_2=0}^{x_1-1} 1+\cdots$$

Where $\Delta^i (0)$ denotes the first term ($x=0$) of the $i$ th difference sequence of $f(x)$.

Through a combinational argument, if we take ${x \choose 0}=1$ and $\Delta^{0}(0)=f(0)$ one can show that is equal to:

$$\sum_{i=0}^{\infty} \Delta^i(0){x \choose i}$$

If we assume $\Delta^n(f(x))=c$, which is a safe assumption given the $n+1$ data points (take the difference sequences and see what I mean, it leads to a correct answer but not all correct answers ), we have that $\Delta^i(0)=0$ for $i >n$ so this equation reduces to:

$$\sum_{i=0}^{n} \Delta^i(0){x \choose i}$$

The important thing to note is that the leading coefficient is of most degree $n$.

$\Delta^i(0)=0$ for $i>n$ follows because one can assume $\Delta^n(f(x))=c$ given these $n$ terms (take the finite differences and see what I mean), but what if $c=0$? Then it can be deduced that $f(x)$ is degree at most $n-1$. On the other hand if $c \neq 0$ then from the equation we must have that $f(x)$ is of degree $n$.Furthermore if $c=0$, then we also have that $\Delta^{n-1}(f(x))=c_2$. And if $c_2=0$ then $f$ is at most degree $n-2$. So the important thing is that if $f$ is at minimum $d$ then $d$ is the first positive integer such that $\Delta^d(f(x))=c \neq 0$. Furthermore if $\Delta^n(f(n))=c \neq 0$ then we must have that $f$ is of degree $n$.

Note that:

$$\Delta^3(s(x))=\Delta (\Delta (\Delta \sum_{i=1}^{x} i^2)))=\Delta (\Delta (\Delta s(x)))=\Delta \Delta (x+1)^2=\Delta (2x+3)=2 \neq 0$$

We must have then that $s$ is of degree $3$. Adding values won't change a thing so long as they follow $s(x)$ because $\Delta^i(0)=0$ for $i>3=\text{degree}$ (note I haven't assumed that$\Delta^3(s(x))=c \neq 0$, rather I proved it). On the other hand if we add values that do not follow $s(x)$ then we may find a different (higher degree) polynomial (again think of the differences). Thus your polynomial is of minimum degree for $4$ given terms (it can be of larger degree just take the next value in such a way that it does not follow $s(x)$), and we call this a Lagrange polynomial. Let me also note that given $n+1$ data points $f(0),f(1),...f(n)$ if we assume $\Delta^n (f(x))=c$ then we consequently find the Lagrange polynomial that corresponds to this sequence.

3

A line is described uniquely using $2$ points.

A parabola is described uniquely using $3$ points.

A cubic is described uniquely using $4$ points.

In general, a polynomial with degree $n$ is described uniquely using exactly $n+1$ points.

Since you give the first $4$ points, it will uniquely describe the cubic polynomial that produces the sum of the first $n$ squares. You will notice that if you remove any point from the cubic or reduce the degree of the polynomial, it will no longer produce the same function.

  • 3
    If you would like me to go into exactly WHY the sum of the first $n$ squares is modeled by a cubic function, let me know. – Will Sherwood Aug 05 '16 at 04:02
2

This is an example of working out Ahmed's answer, which is good and contains a lot of information.

This trick works best if you start from $0$. To find the polynomial $f(x)$ with $$f(0) = 0, \; f(1) = 1, \; f(2) = 5, \; f(3) = 14, \; f(4) = 30,$$ form a triangle of differences

\begin{align*} &0\quad \quad 1 \quad\quad 5 \quad\quad 14 \quad\quad 30 \\ &\quad 1 \quad\quad 4 \quad\quad 9 \quad\quad 16 \\ &\quad\quad 3 \quad\quad 5 \quad\quad 7 \\ &\quad\quad\quad 2 \quad\quad 2 \\ &\quad\quad \quad\quad 0\end{align*}

and take the left side of the triangle as coefficients in a Newton series:

\begin{align*} f(x) &= 0 \binom{x}{0} + 1 \binom{x}{1} + 3 \binom{x}{2} + 2 \binom{x}{3} + 0 \binom{x}{4} \\ &= 0 + x + \frac{3x (x-1)}{2} + \frac{2 x(x-1)(x-2)}{6} \\ &= \frac{x}{6} + \frac{x^2}{2} + \frac{x^3}{3}.\end{align*}

1

Hint $\ $ The difference operator $\,\Delta f(x) = f(x\!+\!1)-f(x)\,$ decrements the degree (if $\,f\ne 0),$ hence $\,f\,$ satisfies a recurrence $\,\Delta ^k f = 0,\ $ for $\,k = 1+\deg f.\,$

By the uniqueness theorem for such recurrences, solutions are uniquely determined by their values at $k\,$ consecutive integers ("initial conditions").

The uniqueness theorem has a trivial one-line inductive proof, so the basic idea is quite simple.

Bill Dubuque
  • 272,048
1

You generated the numbers by using the Polynomial $P(x)=\cfrac{x^3}{3}+\cfrac{x^2}{2}+\cfrac{x}{6}$.

Now, let $Q(X)$ be the polynomial of degree $n-1$ which you obtain such that $$P(1)=Q(1),.., P(n)=Q(n)$$ [where $n$ is the number of values you use].

Then $P(X)-Q(X)$ is a polynomial of degree at most $n-1$ which has $1,2,3,..,n$ as roots. But the only polynomial which has more roots than the degree is the zero polynomial.

Thus $$P(X)-Q(X)=0 \Rightarrow Q(X)=P(X)$$

N. S.
  • 132,525