We can solve this system using the least squares method we just outlined. Note that, unlike
polynomial interpolation, we have two parameters to help us control the quality of the fit: the
number of points m + 1 and the degree of the polynomial n.
In practice, we try to choose the degree n to be “just right”. If the degree n = 2 and the data
is not in a line, then we will never get a good fit, no matter how many points we have - we need
to increase the degree instead. If the degree n is too large, the least-squares polynomial will follow
the jitters too closely, which is also bad. Finding a good value in between these two extremes is an
art.