Interpolation of polynome - is degree needed?

41 Views Asked by At

I'm doing my project from numerical methods in math and I'm supposed to create the following program:

Inputs:

  • $n \in [0,\infty)$

  • a sequence $\Gamma_{i=0}^{n} (u_i) \in \mathbb{R}^{n+1}$ of x-coordinates to interpolate

  • a sequence $\Gamma_{i=0}^{n} (v_i) \in \mathbb{R}^{n+1}$ of y-coordinates to interpolate

Output:

  • elements of sequence $\Gamma_{i=0}^{n} (a_i)$, which are coefficients of the interpolation of a polynome $L(x)= \sum_{i=0}^{n} > a_ix^i$, defines by the $(\Gamma_{i=0}^{n} (u_i), \Gamma_{i=0}^{n} > (v_i) )$

but I don't understand one thing:

From what I understand, I have to calculate the Lagrange polynomial. But what is the $n$ in the inputs and how should I include it in my calculations? Really not sure about that part. The lagrange polynome should always be the lowest degree possible, right? So why is the degree $n$ included as an input? I'm rather asking here than my prof, because I'm afraid that it's a stupid question.

EDIT: I think I understand now. The number $n$ is just the number of $x-y$ coordinates. Do I understand it correctly?

Thanks!