1 / 38

Advanced Algebraic Algorithms on Integers and Polynomials

Advanced Algebraic Algorithms on Integers and Polynomials. Analysis of Algorithms. Prepared by John Reif, Ph.D. Integer and Polynomial Computations. Newton Iteration: application to division Evaluation and Interpolation via Chinese Remaindering Main Lecture Material:

mohammed
Download Presentation

Advanced Algebraic Algorithms on Integers and Polynomials

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Advanced Algebraic Algorithms on Integers and Polynomials Analysis of Algorithms Prepared by John Reif, Ph.D.

  2. Integer and Polynomial Computations • Newton Iteration: application to division • Evaluation and Interpolation via Chinese Remaindering Main Lecture Material: Algorithms on Integers Advanced Lecture Material: Extension of Algorithms to Polynomials

  3. Taylor Expansion

  4. Taylor Expansion (cont’d) • To find root f(x), use Newton Iteration: • Example: • To find reciprocal of x choose find root

  5. Application of Newton Iteration to Reciprocal of an Integer • Input integer x, accuracy bound k • Initialize if x has n bits

  6. Application of Newton Iteration to Reciprocal of an Integer (cont’d) • TheoremInteger Reciprocal can be computed to accuracy 2-n in O(log n) integer mults and additions.

  7. Steven Cooks’s Improvement (His Harvard Ph.D. Thesis) • Key Trick: Since we need only compute yk up to 2k+1 bit accuracy of error on kth stage • Total Time Cost • Where M(n) is time cost to multiply two n bit integers

  8. Other Applications of Newton Iterations on Integers • O(M(n)) time algorithms: • Quotient + divisor of integer division • Square root • Sin, cosine, etc. • Used in practice!

  9. Advanced Topic: Extension to Polynomial ReciprocalDefinition of Polynomial Reciprocal • Reciprocal = polynomial r(x) • where and (x) has degree < n-1

  10. Algorithm: Reciprocal (P(x)) • Input polynomial degree n-1, n is power of 2

  11. Proof of the Reciprocal Algorithm • Theorem: The Algorithm Correctly Computes Reciprocal(P(x)) • Proof by induction

  12. Proof Algorithm Computes Reciprocal (P(x)) (cont’d) • By induction hypothesis, if

  13. Proof Algorithm Computes Reciprocal (P(x)) (cont’d) • At line [3] we compute

  14. Proof Algorithm Computes Reciprocal (P(x)) (cont’d)

  15. Modular Arithmetic • Assume relatively prime P0, P1, …, Pk-1 • Let given x, 0 < x < p

  16. Applications to Arithmetic • But doesn’t extend to division(overflow problems)

  17. Super Moduli Computation • Input p0, p1, …, pk-1, where pi < 2b • Output Super modular Tree:

  18. Super Moduli Computation (cont’d) • Time Cost

  19. Algorithm Residue Computation • Input • Outputx0, x1, …, xk-1, when xi =x mod Pi i=0, and k-1 • Recursive algorithm [1] compute quotient and remainders:

  20. Algorithm Residue Computation (cont’d) [2] recursively compute[3] output for i = 0, 1, …, k-1

  21. Time Cost for Residue Computation • Let D(n) = time cost for integer division = O(M(n)) • Total Time for input size n = k· b

  22. Proof of Algorithm for Residue Computation • Idea of Proof of algorithm Uses fact: if x = q v + r and v mod Pi = 0, then X mod Pi = r mod Pi

  23. Advanced Topic: Residue Computation on Polynomials • Input moduli P0(x), P1(x), …, Pk-1(x) assume each degree < d and relatively prime • Algorithm uses similar Super modular Tree tre , but using polynomials rather than integers

  24. Advanced Topic: Residue Computation on Polynomials (cont’d) • Output for i=0, …, k-1 Qi(x) = Q(x) mod Pi(x) Q(x) has degree < kd • Theorem The Residue Computation can be done in time O(M(n) log n) where n = k· d • Proof Idea use same algorithm as in integer case

  25. Advanced Topic: Multipoint Evaluation of Polynomials by Residue Computation • Input polynomial f(x) degree n-1 and points x0, x1, …, xn-1 [1] for i=0, …, n-1 let Pi(x) = (x-xi) [2] By Residue Algorithm Computer for i=0, …, n-1 f(xi) = f(x) mod Pi(x) [3] output f(x0), …, f(xn-1) • Time Cost O(M(n) log n), = O(n(log n)2)

  26. Polynomial Interpolation • Input evaluation points x0, …, xn-1 values y0, …, yn-1 • Output P(x) where yk = P(xk) for k=0, …, n-1

  27. Polynomial Interpolation (cont’d) • Interpolation formula: • Where

  28. Proof of Polynomial Interpolation • Proof uses identities:

  29. Using Chinese Remaindering for Integer Interpolation • Inputrelatively prime P0, P1, …, Pn-1and yi ∈ {0,…Pi-1} for i=0,…,n-1 • Problem compute y < P0 P1 … Pn-1 s.t. yi = y mod Pi i=0, …, n-1

  30. Using Chinese Remaindering for Integer Interpolation • Generalized Interpolation Formula: • Where • proof

  31. Advanced Topic: Preconditioned Interpolation Preconditioned Case assumes coefficients {ak | k=0, …, n-1} precomputed • Use Divide & Conquer

  32. Preconditioned Interpolation (cont’d)

  33. Time Cost for Preconditioned Interpolation • Assuming {a0, …, an-1} precomputed

  34. Precomputation of {a0, …, an-1} • Compute • Compute bk where bkPk = P mod (Pk)2by Residue Computation O(M(n) log n) • Compute ak = (bk)-1 mod Pk by Extended GCD algorithm

  35. Proof of Precomputation of {a0, …, an-1} • proof

  36. Precomputation of {a0, …, an-1} for Polynomial Interpolations • Here Pi = (x-xi) for i=0, …, n-1  reduces to multipoint evaluation of derivative of Q(x) O(M(n) log n) time!

  37. Conclusion • Polynomial and Integer Computations use similar divide and conquer techniques to solve: • Multiplication • Division • Interpolation and evaluation • Open Problem Reduce from time O(M(n)log n) to O(M(n))

  38. Newton Iteration and Polynomial Computation Analysis of Algorithms Prepared by John Reif, Ph.D.

More Related