I´m working on an assignment which I think I have solved properly but since I don´t have the solution I´m a little nervous and I wonder if someone could take a look at it.

Here´s the question (translated from another language):

What is the best adjustment, in the "least square" sense, of the parabola $\displaystyle y=c_0+c_1x+c_2x^2$ to the data points $\displaystyle (x_i,y_i)$ given by the set $\displaystyle {(0,3),(1,2),(2,4),(3,4)}$

Here´s my solution:

I plug the given points in the equation and solve the system of linear equations and find that there is no solution $\displaystyle c_0,c_1,c_2$. Which means i need to find a parabola which is as close as possible.

From $\displaystyle Ac=b$ where $\displaystyle A= \left[ \begin {array}{ccc} 1&0&0\\ \noalign{\medskip}1&1&1

\\ \noalign{\medskip}1&2&4\\ \noalign{\medskip}1&3&9\end {array}

\right] , c= \left[ \begin {array}{c} c_{{0}}\\ \noalign{\medskip}c_{{1}}

\\ \noalign{\medskip}c_{{2}}\end {array} \right]

$ and $\displaystyle b=\left[ \begin {array}{c} 3\\ \noalign{\medskip}2\\ \noalign{\medskip}

4\\ \noalign{\medskip}4\end {array} \right]

$

And since the columns in A are linearly independent, $\displaystyle A^TA$ is invertible I get

$\displaystyle c=(A^TA)^{-1}A^Tb=\left[ \begin {array}{ccc} {\frac {19}{20}}&-{\frac {21}{20}}&1/4

\\ \noalign{\medskip}-{\frac {21}{20}}&{\frac {49}{20}}&-3/4

\\ \noalign{\medskip}1/4&-3/4&1/4\end {array} \right]

\left[ \begin {array}{cccc} 1&1&1&1\\ \noalign{\medskip}0&1&2&3

\\ \noalign{\medskip}0&1&4&9\end {array} \right]

\left[ \begin {array}{c} 3\\ \noalign{\medskip}2\\ \noalign{\medskip}

4\\ \noalign{\medskip}4\end {array} \right]

$

Which gives me $\displaystyle c= \left[ \begin {array}{c} 11/4\\ \noalign{\medskip}-1/4

\\ \noalign{\medskip}1/4\end {array} \right]

$

This means that the parabola that is the best adjustment to the given set of points is

$\displaystyle 4y=11-x+x^2$

I really need to get this straight because I´m studying math on my own without the help of tutors and peers. So any help is appreciated.