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

Slides:



Advertisements
Similar presentations
Number Theory Algorithms and Cryptography Algorithms Prepared by John Reif, Ph.D. Analysis of Algorithms.
Advertisements

Having Proofs for Incorrectness
Polynomial Division Division Long and Short. 8/10/2013 Polynomial Division 2 Division of Polynomials Long Division (by hand): Polynomial Functions 245.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Information and Coding Theory Finite fields. Juris Viksna, 2015.
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Reductions Some of these lecture slides are adapted from CLRS Chapter 31.5 and.
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Fast Fourier Transform Jean Baptiste Joseph Fourier ( ) These lecture.
Dividing Polynomials Section 2.4. Objectives Divide two polynomials using either long division or synthetic division. Use the Factor Theorem to show that.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Long Division of Polynomials
Richard Fateman CS 282 Lecture 61 Evaluation/Interpolation (I) Lecture 6.
Dan Boneh Intro. Number Theory Modular e’th roots Online Cryptography Course Dan Boneh.
The Remainder and Factor Theorems Check for Understanding 2.3 – Factor polynomials using a variety of methods including the factor theorem, synthetic division,
Quiz 2 key.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Introduction to Modular Arithmetic and Public Key Cryptography.
CPSC 3730 Cryptography and Network Security
Great Theoretical Ideas in Computer Science.
6.8 Synthetic Division. Polynomial Division, Factors, and Remainders In this section, we will look at two methods to divide polynomials: long division.
Long Division Algorithm and Synthetic Division!!!
2.5 Apply the Remainder and Factor Theorems p. 120 How do you divide polynomials? What is the remainder theorem? What is the difference between synthetic.
5.4 – Apply the Remainder and Factor Theorems Divide 247 / / 8.
Polynomial Division and the Remainder Theorem Section 9.4.
6.5 The Remainder and Factor Theorems p. 352 How do you divide polynomials? What is the remainder theorem? What is the difference between synthetic substitution.
Copyright © 2009 Pearson Education, Inc. CHAPTER 4: Polynomial and Rational Functions 4.1 Polynomial Functions and Models 4.2 Graphing Polynomial Functions.
 PERFORM LONG DIVISION WITH POLYNOMIALS AND DETERMINE WHETHER ONE POLYNOMIAL IS A FACTOR OF ANOTHER.  USE SYNTHETIC DIVISION TO DIVIDE A POLYNOMIAL BY.
Chapter 4 – Finite Fields
Great Theoretical Ideas in Computer Science.
The Fast Fourier Transform and Applications to Multiplication
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Section 2.4 Dividing Polynomials; The Factor and Remainder Theorems.
Copyright © 2012 Pearson Education, Inc. Publishing as Addison Wesley 4.3 Polynomial Division; The Remainder and Factor Theorems  Perform long division.
ACTIVITY 31: Dividing Polynomials (Section 4.2, pp )
6-7 The Division Algorithm & The Remainder Theorem dividend=quotient. divisor + remainder If a polynomial f(x) is divided by x - c, the remainder is the.
Date: 2.4 Real Zeros of Polynomial Functions
Factor Theorem Using Long Division, Synthetic Division, & Factoring to Solve Polynomials.
1 Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Dividing Polynomials Section 2.4. Objectives Divide two polynomials using either long division or synthetic division. Use the Factor Theorem to show that.
3.3 Polynomial and Synthetic Division. Long Division: Let’s Recall.
Introduction: Efficient Algorithms for the Problem of Computing Fibonocci Numbers Prepared by John Reif, Ph.D. Analysis of Algorithms.
Section 4.3 Polynomial Division; The Remainder and Factor Theorems Copyright ©2013, 2009, 2006, 2001 Pearson Education, Inc.
Algorithms 2005 Ramesh Hariharan. Polynomial Computation.
May 9, 2001Applied Symbolic Computation1 Applied Symbolic Computation (CS 680/480) Lecture 6: Multiplication, Interpolation, and the Chinese Remainder.
Real Zeros of Polynomial Functions
Polynomial Long Division
College Algebra Chapter 3 Polynomial and Rational Functions Section 3.3 Division of Polynomials and the Remainder and Factor Theorems.
Page : 1 bfolieq.drw Technical University of Braunschweig IDA: Institute of Computer and Network Engineering  W. Adi 2011 Lecture-5 Mathematical Background:
Prepared by John Reif, Ph.D.
Lecture 4 The Euclidean Algorithm
Dividing Polynomials A review of long division:
Section 5.4 – Dividing Polynomials
Mathematical Background: Extension Fields
Great Theoretical Ideas in Computer Science
Dividing Polynomials Long Division A little review:
Dividing Polynomials.
Polynomial Division; The Remainder Theorem and Factor Theorem
Revision on Polynomials
Lecture 20 Guest lecturer: Neal Gupta
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
Division of Polynomials
Division of Polynomials and the Remainder and Factor Theorems
5.5 Apply the Remainder and Factor Theorems
6.5 The Remainder and Factor Theorems
Remainder Theorem.
2.5 Apply the Remainder and Factor Theorem
Cryptography Lecture 16.
5.5 Apply the Remainder and Factor Theorems
Mathematical Background: Extension Finite Fields
Presentation transcript:

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

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

Taylor Expansion

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

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

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

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

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!

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

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

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

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

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

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

Modular Arithmetic Assume relatively prime P 0, P 1, …, P k-1 Let given x, 0  x < p

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

Super Moduli Computation Input p 0, p 1, …, p k-1, where p i < 2 b Output Super modular Tree:

Super Moduli Computation (cont’d) Time Cost

Algorithm Residue Computation Input Output x 0, x 1, …, x k-1, when x i =x mod P i i=0, and k-1 Recursive algorithm [1] compute quotient and remainders:

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

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

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

Advanced Topic: Residue Computation on Polynomials Input moduli P 0 (x), P 1 (x), …, P k-1 (x) and each degree  d and relatively prime Algorithm uses similar Super modular Tree tre, but using polynomials rather than integers

Advanced Topic: Residue Computation on Polynomials (cont’d) Output for i=0, …, k-1 Q i (x) = Q(x) mod P i (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

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

Polynomial Interpolation Input evaluation points x 0, …, x n-1 values y 0, …, y n-1 Output P(x) where y k = P(x k ) for k=0, …, n-1

Polynomial Interpolation (cont’d) Interpolation formula: Where

Proof of Polynomial Interpolation Proof uses identities:

Using Chinese Remaindering for Integer Interpolation Input relatively prime P 0, P 1, …, P n-1 and y i  {0,…P i-1 } for i=0,…,n-1 Problem compute y <  P i s.t. y i = y mod P i i=0, …, n-1

Generalized Interpolation Formula: Where proof Using Chinese Remaindering for Integer Interpolation

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

Preconditioned Interpolation (cont’d)

Time Cost for Preconditioned Interpolation Assuming {a 0, …, a n-1 } precomputed

Precomputation of {a 0, …, a n-1 } 1)Compute 2)Compute b k where b k P k = P mod (P k ) 2 by Residue Computation O(M(n) log n) 3)Compute a k = (b k ) -1 mod P k by Extended GCD algorithm

Proof of Precomputation of {a 0, …, a n-1 } proof

Precomputation of {a 0, …, a n-1 } for Polynomial Interpolations Here P i = (x-x i ) for i=0, …, n-1  reduces to multipoint evaluation of derivative of Q(x) O(M(n) log n) time!

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

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