***Welcome to ashrafedu.blogspot.com * * * This website is maintained by ASHRAF***

Saturday, 7 December 2019

Representing polynomials


Representing polynomials



A polynomial in the variable x over an algebraic field F represents a function A(x) as a formal sum:

, the values a0, a1, . . . ,an-1 the coefficients of the polynomial.


A polynomial A(x) has degree k if its highest nonzero coefficient is ak i.e, degree(A) = k. 
Any integer strictly greater than the degree of a polynomial is degree-bound of that polynomial.

Polynomials can be represented using

  •          the coefficient and
  •          point-value representations of polynomials.
1. Coefficient representation: A coefficient representation of a polynomial 


, of degree bound ‘n’ is a vector of coefficients a = (a0, a1, . . . ,an-1). 

Example: A(π‘₯) = 6π‘₯3+7π‘₯2−10π‘₯+9  coefficients of A(x) are (9,−10,7,6).

The coefficient representation is convenient for certain operations on polynomials.
The operation of evaluating the polynomial (π‘₯) at point π‘₯0 consists of computing the value of 𝐴(π‘₯). Evaluation takes time ΞΈ(𝑛) using Horner’s rule 𝐴(π‘₯0)=π‘Ž0+π‘₯0(π‘Ž1+π‘₯0(π‘Ž2++π‘₯0(π‘Žπ‘›−2+π‘₯0 ­(π‘Žπ‘›−1 )))).

Adding two polynomials represented by the coefficient vectors π‘Ž=(π‘Ž0,π‘Ž1,…,π‘Žπ‘›−1) and 𝑏=(𝑏0,𝑏1,…,𝑏𝑛−1) takes time Θ(𝑛). Sum is the coefficient vector 𝑐=(𝑐0,𝑐1,…,𝑐𝑛−1), where 𝑐𝑗=π‘Žπ‘—+𝑏𝑗 for 𝑗=0,1,…,𝑛−1.
Example:
𝐴π‘₯= 6π‘₯3 + 7π‘₯2 − 10π‘₯ + 9             (9,−10,7,6)
𝐡π‘₯=− 2π‘₯3 + 4π‘₯ − 5                      (−5,4,0,−2)
----------------------------------------------------------
(π‘₯)= 4π‘₯3 + 7π‘₯2 − 6π‘₯ + 4              (4,−6,7,4)

2. Point-Value Representation: A point-value representation of a polynomial 𝐴(π‘₯) of degree-bound 𝑛 is a set of 𝑛 point-value pairs {(π‘₯0,𝑦0),(π‘₯1,𝑦1),…,(π‘₯𝑛−1,𝑦𝑛−1)} such that all of the π‘₯π‘˜ are distinct and π‘¦π‘˜=𝐴(π‘₯π‘˜) for π‘˜=0,1,…,𝑛−1.
 Example: A(π‘₯) =π‘₯3−2π‘₯+1






Using Horner’s method, 𝒏-point evaluation takes time ΞΈ(𝑛2).
The inverse of evaluation—determining the coefficient form of a polynomial from a point-value representation—is interpolation.
For any set {(π‘₯0,𝑦0),(π‘₯1,𝑦1),…,(π‘₯𝑛−1,𝑦𝑛−1)} of 𝑛 point-value pairs such that all the π‘₯π‘˜ values are distinct, there is a unique polynomial 𝐴(π‘₯) of degree-bound 𝑛 such that π‘¦π‘˜=𝐴(π‘₯π‘˜) for π‘˜=0,1,…,𝑛−1.
Using Lagrange’s formula, interpolation takes time ΞΈ(𝑛2).
Lagrange’s formula




Example: Using Lagrange’s formula, we interpolate the point-value representation {(0,1),(1,0),(2,5),(3,22)}.












In point-value form, addition 𝐢(π‘₯)=𝐴(π‘₯)+𝐡(π‘₯) is given by 𝐢(π‘₯π‘˜)=𝐴(π‘₯π‘˜)+𝐡(π‘₯π‘˜) for any point π‘₯π‘˜.




𝐴 and 𝐡 are evaluated for the same 𝑛 points. The time to add two polynomials of degree-bound 𝑛 in point-value form is ΞΈ(𝑛).
Example:  Add (π‘₯)=𝐴(π‘₯)+𝐡(π‘₯) in point-value form 








In point-value form, multiplication 𝐢(π‘₯)=𝐴(π‘₯)𝐡(π‘₯)  is given by 𝐢(π‘₯π‘˜)=𝐴(π‘₯π‘˜)𝐡(π‘₯π‘˜) for any point π‘₯π‘˜. If 𝐴 and 𝐡 are of degree-bound 𝑛, then 𝐢 is of degree-bound 2𝑛.
Need to start with “extended” point-value forms for 𝐴 and 𝐡 consisting of 2𝑛 point-value pairs each.




The time to multiply two polynomials of degree-bound 𝑛 in point-value form is ΞΈ(𝑛). 
Example:  Multiply 𝐢π‘₯=𝐴(π‘₯)𝐡(π‘₯) in point-value form








Given two input polynomials in extended point-value form, the time to multiply them to obtain the point value form of the result is ΞΈ(n), which is much less than the time required to multiply polynomials in coefficient form ΞΈ(n2).

A graphical outline of an efficient polynomial-multiplication process is given below. Representations on the top are in coefficient form, while those on the bottom are in point-value form.












No comments:

Post a Comment