Proving that exists a single polynomial satisfies $p(a_{i})=b_{i}$ Let $a_{1},\dots,a_{n}\in\mathbb F$, $\forall i,j, a_{i}\neq a_{j}$, and some $b_{1}\dots b_{n}\in\mathbb F$.
I need to prove that exists only a single $p\in\mathbb F[x]$ s.t. $\forall1\leq j\leq n,p(a_{i})=b_{i} \land \deg p=n-1$. but I got stuck when only trying to construct a suitable $p$ for proof of existence.
I was given a hint to observe at a polynomial such as: $p_{j}(x)=\frac{\prod_{i\neq j}(x-a_{j})}{\prod_{i\neq j}(a_{i}-a_{j})}$.
the only thing I could infer from this is that $\forall1\leq j\leq n,\deg p_{j}=n-1\land p_{j}\left(a_{k}\right)=\begin{cases}
1 & k=j\\
0 & k\neq j
\end{cases}$
$\sum_{j}p_{j}$ won't give me anything. couldn't wrap my head around this, honestly.
Can anyone give me a hint please?
 A: I think you are on the right track all you'd now need to do is multiply your $p_j$ polynomials with the corresponding $b_j$ and sum them up to obtain your desired function:
$p(x)=\sum_{i=1}^{n}(p_i(x)b_i)$
A: First of all, the correct expression for $p_j(x)$ is
$p_j(x) = \displaystyle \dfrac{\prod_{i \ne j}(x - a_i)}{\prod_{i \ne j}(a_j - a_i)}; \tag 0$
it is then evident that $p_j(a_k) = \delta_{jk}$.
Set
$p(x) = \displaystyle \sum_1^n b_i p_i(x); \tag 1$
then
$p(a_k) = \displaystyle \sum_1^n b_i p_i(a_k) = \sum_1^n b_i \delta_{ik} = b_k. \tag 2$
It seems we have to be a little careful here; it appears the correct statement is $\deg p(x) \le n - 1$, not $\deg p(x) = n - 1$; for example if we choose $b_j$, $2 \le j \le n$ arbitrarily, then take $b_1$ to satisfy
$b_1 = -\displaystyle \prod_{i = 2}^n (a_1 - a_i) \sum_{j = 2}^n \dfrac{b_j}{\prod_{i \ne j}(a_j - a_i)}, \tag 3$
we find the coefficient of $x^{n - 1}$ in (1) is $0$, so $\deg p(x) < n - 1$; an analogous result holds for each of the $b_i$.
As for uniqueness, if $q(x)$ is a polynomial with $\deg q(x) \le n - 1$ such that
$q(a_i) = p(a_i) = b_i, \; 1 \le i \le n,  \tag 4$
then setting
$r(x) = p(x) - q(x) \tag 5$
we have
$r(a_i) = p(a_i) - q(a_i) = 0, \; 1 \le i \le n; \tag 6$
since the $a_i$ are distinct, this shows that if $r(x) \ne 0$ it has at least $n$ distinct zeroes $a_i$, which implies that $\prod_1^n (x - a_i) \mid r(x)$; but 
$\deg \displaystyle \prod_1^n (x - a_i) = n, \tag 7$
whereas 
$\deg r(x) \le n - 1; \tag 8$
this contradiction forces $r(x) = 0$, hence $q(x) = p(x)$, and uniqueness has been shown.
