30-5 Polynomial evaluation at multiple points

We have seen how to evaluate a polynomial of degree-bound nn at a single point in O(n)O(n) time using Horner's rule. We have also discovered how to evaluate such a polynomial at all nn complex roots of unity in O(nlgโกn)O(n\lg n) time using the FFT\text{FFT}. We shall now show how to evaluate a polynomial of degree-bound nn at nn arbitrary points in O(nlgโก2n)O(n\lg^2 n) time.

To do so, we shall assume that we can compute the polynomial remainder when one such polynomial is divided by another in O(nlgโกn)O(n\lg n) time, a result that we state without proof. For example, the remainder of 3x3+x2โˆ’3x+13x^3 + x^2 - 3x + 1 when divided by x2+x+2x^2 + x + 2 is

(3x3+x2โˆ’3x+1)modโ€‰โ€‰(x2+x+2)=โˆ’7x+5.(3x^3 + x^2 - 3x + 1) \mod (x^2 + x + 2) = -7x + 5.

Given the coefficient representation of a polynomial A(x)=โˆ‘k=0nโˆ’1akxkA(x) = \sum_{k = 0}^{n - 1} a_kx^k and nn points x0,x1,โ€ฆ,xnโˆ’1x_0, x_1, \dots, x_{n - 1}, we wish to compute the nn values A(x0),A(x1),โ€ฆ,A(xnโˆ’1)A(x_0), A(x_1), \dots, A(x_{n - 1}). For 0โ‰คiโ‰คjโ‰คnโˆ’10 \le i \le j \le n - 1, define the polynomials Pij(x)=โˆk=ij(xโˆ’xk)P_{ij}(x) = \prod_{k = i}^j (x - x_k) and Qij(x)=A(x)modโ€‰โ€‰Pij(x)Q_{ij}(x) = A(x) \mod P_{ij}(x). Note that Qij(x)Q_{ij}(x) has degree at most jโˆ’ij - i.

a. Prove that A(x)modโ€‰โ€‰(xโˆ’z)=A(z)A(x) \mod (x - z) = A(z) for any point zz.

b. Prove that Qkk(x)=A(xk)Q_{kk}(x) = A(x_k) and that Q0,nโˆ’1(x)=A(x)Q_{0, n - 1}(x) = A(x).

c. Prove that for iโ‰คkโ‰คji \le k \le j, we have Qik(x)=Qij(x)modโ€‰โ€‰Pik(x)Q_{ik}(x) = Q_{ij}(x) \mod P_{ik}(x) and Qkj(x)=Qij(x)modโ€‰โ€‰Pkj(x)Q_{kj}(x) = Q_{ij}(x) \mod P_{kj}(x).

d. Give an O(nlgโก2n)O(n\lg^2 n)-time algorithm to evaluate A(x0),A(x1),โ€ฆ,A(xnโˆ’1)A(x_0), A(x_1), \dots, A(x_{n - 1}).

(Omit!)