why we need a polynomial of degree at most n-1 not n when doing interpolation with n data points I am getting very confused about why we need a polynomial of degree at most n-1 but not n when doing interpolation with n data points.
polynomial interpolation
 A: It is because a polynomial of degree $n-1$ does not consists of $n-1$, but $n$ terms (the terms are called monomials):
$$\color{red}{a_0}+\color{red}{a_1}x+\color{red}{a_2}x^2+\cdots \color{red}{a_{n-1}}x^{n-1}.$$
Hence it has $n$ coefficients (colored in red). You see: the clou is that we start counting at $0$ instead of $1$, hence having $n$ terms only gives highest degree $n-1$ (and this is the degree of the polynomial). One could argue that the term "degree" is defined in an unfavorable way here, and we could define it as the "number of terms in the polynomial" instead (this would give $n$). But this definition makes sense in a lot of other situations and will not going to change.
Then, everything is about counting and matching degrees of freedom. Having $n$ coefficients which we can modify independently represents $n$ degrees of freedom. A set of $n$ points also has $n$ degrees of freedom. So interpolating these points is done with a polynomial with $n$ coefficients, i.e. of degree $n-1$.
