I am reading this text:
and I'm confused at this part:
If all x-coordinates of the points are distinct, then there is precisely one polynomial function of degree n - 1 (or less) that fits the n points, as shown in Figure 1.4.
Why is this? So I can see that if there were 2 points, there could be a polynomial of degree 1 (say something like 2x) that could fit the two distinct points. Additionally, if there are 3 points, you'd need a parabola or something to fit the 3 distinct points. But where is the rule from? I'm rereading my old precalc textbook and I can't find anything of the sort.
Lastly, how did the text get this:
a0 = 24, a1 = -28, and a2 = 8 $\endgroup$ 4 2 Answers
$\begingroup$Given $x_0 < \dots < x_{n-1}$ and values $y=(y_0 , \dots, y_{n-1})$, finding a polynomial $\sum_{i=0}^{n-1} a_i x^i$ of degree $n-1$ such that $p(x_i) = y_i$ for every $i$ is equivalent to solving for $a=(a_0,\dots,a_{n-1})$ in the matrix equation $Va = y$, $$ \begin{pmatrix} x_0^0 & x_0^1& \dots& x_0^{n-1} \\ x_1^0 & x_1^1& \dots& x_1^{n-1} \\ \vdots & \vdots & & \vdots \\ x_{n-1}^0 & x_{n-1}^1& \dots& x_{n-1}^{n-1} \\\end{pmatrix} \begin{pmatrix}a_0\\a_1\\\vdots\\ a_{n-1}\end{pmatrix} = \begin{pmatrix}y_0\\y_1\\\vdots\\ y_{n-1}\end{pmatrix}.$$
Indeed, this is what is next written("to solve for the $n$ coefficients...") in your text, but in the form of $n$ equations.
You may notice that this matrix $V$ is the so-called Vandermonde matrix which is invertible iff the given $x$ coordinates are all different.
Lastly, how did the text get...
In the given example, you have $(x_0,x_1,x_2) = (1,2,3)$ and you are trying to match with the values $(y_0,y_1,y_2)=(4,0,12)$. So just plug these values in and you should see that (assuming there is no typo in your book)
$$\begin{pmatrix}a_0\\a_1\\a_2\end{pmatrix} = \begin{pmatrix}1 & 1 & 1\\ 1 &2 &4\\ 1&3&9 \end{pmatrix}^{-1}\begin{pmatrix} 4\\0\\12\end{pmatrix} = \begin{pmatrix} 24\\-28\\8\end{pmatrix}.$$
If you were unsure about the uniqueness part: the above exhibits one solution to the problem and the solution is unique since the existence of two different solutions $$a=(a_0,\dots,a_{n-1}),\quad b=(b_0,\dots,b_{n-1})$$ would imply (since $V(b-a) =0$) that the kernel of the Vandermonde matrix $V$ has dimension $\geq 1$. Indeed, for any matrix $M$, any two solutions $a,a'$ to $Ma=y$ must be related via $a=a'+k$ for some $k\in\ker M$. In particular if you use a higher degree polynomial(= adding columns to $V$), you will have infinitely many solutions.
If you were wondering if you can use a lower degree polynomial: not in general. This corresponds to removing columns from $V$ to obtain a nonsquare matrix $V'$, which is of lower rank. In particular the Rank-Nullity theorem tells us that the image is not all of $\mathbb R^n$, and picking any $(y_0,\dots y_{n-1})$ in $\mathbb R^n \setminus \operatorname{Im}(V') \neq \emptyset$ provides a counterexample.
$\endgroup$ 0 $\begingroup$Simply note that the general polynomial function of degree $n$ is defined by $n+1$ coefficients $a_0,a_1,\ldots,a_n$
$$p_n(x)=a_{n}x^n+a_{n-1}x^{n-1}+\ldots+a_{1}x+a_0$$
and thus we need exactly $n+1$ (independent) conditions to obtain a linear system with an unique solution.
$\endgroup$