Advanced Algebraic Algorithms on Integers and Polynomials

Similar documents
Example: (13320, 22140) =? Solution #1: The divisors of are 1, 2, 3, 4, 5, 6, 9, 10, 12, 15, 18, 20, 27, 30, 36, 41,

THE CHINESE REMAINDER THEOREM. We should thank the Chinese for their wonderful remainder theorem. Glenn Stevens

Some Consequences. Example of Extended Euclidean Algorithm. The Fundamental Theorem of Arithmetic, II. Characterizing the GCD and LCM

An efficient algorithm for multivariate Maclaurin Newton transformation

Polynomial Arithmetic

Review of Taylor Series. Read Section 1.2

a b a In case b 0, a being divisible by b is the same as to say that

Polynomials. 1 What is a polynomial? John Stalker

18.781: Solution to Practice Questions for Final Exam

Finding Primitive Roots Pseudo-Deterministically

5012: VLSI Signal Processing

ALGEBRA HW 7 CLAY SHONKWILER

DISCRIMINANTS AND RAMIFIED PRIMES. 1. Introduction A prime number p is said to be ramified in a number field K if the prime ideal factorization

Decision Diagrams Derivatives

Math Review. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University

Generalized Linear Methods

Lecture 10 Support Vector Machines II

11 Tail Inequalities Markov s Inequality. Lecture 11: Tail Inequalities [Fa 13]

Polynomials. 1 More properties of polynomials

Section 8.3 Polar Form of Complex Numbers

MULTIPLICATIVE FUNCTIONS: A REWRITE OF ANDREWS CHAPTER 6

Continued..& Multiplier

Exercises. 18 Algorithms

FACTORING POLYNOMIALS OVER FINITE FIELDS USING BALANCE TEST CHANDAN SAHA

Introduction to Algorithms

CSE4210 Architecture and Hardware for DSP

LETTER Skew-Frobenius Maps on Hyperelliptic Curves

Algorithms for factoring

Bernoulli Numbers and Polynomials

Problem Solving in Math (Math 43900) Fall 2013

Attacks on RSA The Rabin Cryptosystem Semantic Security of RSA Cryptology, Tuesday, February 27th, 2007 Nils Andersen. Complexity Theoretic Reduction

On the average number of divisors of the sum of digits of squares

A p-adic PERRON-FROBENIUS THEOREM

Beyond Zudilin s Conjectured q-analog of Schmidt s problem

Section 3.6 Complex Zeros

Lectures - Week 4 Matrix norms, Conditioning, Vector Spaces, Linear Independence, Spanning sets and Basis, Null space and Range of a Matrix

Dynamic Programming. Preview. Dynamic Programming. Dynamic Programming. Dynamic Programming (Example: Fibonacci Sequence)

Lecture 5 Decoding Binary BCH Codes

Math 261 Exercise sheet 2

Lecture 10: May 6, 2013

COMPLEX NUMBERS AND QUADRATIC EQUATIONS

CHAPTER 4d. ROOTS OF EQUATIONS

New modular multiplication and division algorithms based on continued fraction expansion

Foundations of Arithmetic

HMMT February 2016 February 20, 2016

Bezier curves. Michael S. Floater. August 25, These notes provide an introduction to Bezier curves. i=0

Tabulating pseudoprimes and tabulating liars

Meshless Surfaces. presented by Niloy J. Mitra. An Nguyen

For now, let us focus on a specific model of neurons. These are simplified from reality but can achieve remarkable results.

(2mn, m 2 n 2, m 2 + n 2 )

U.C. Berkeley CS294: Spectral Methods and Expanders Handout 8 Luca Trevisan February 17, 2016

FOR WHICH p-adic INTEGERS x CAN k

E Tail Inequalities. E.1 Markov s Inequality. Non-Lecture E: Tail Inequalities

Design and Analysis of Algorithms

REDUCTION MODULO p. We will prove the reduction modulo p theorem in the general form as given by exercise 4.12, p. 143, of [1].

IV. Performance Optimization

Introduction to Algorithms

FACTORING POLYNOMIALS OVER FINITE FIELDS USING BALANCE TEST CHANDAN SAHA

MERGESORT BBM ALGORITHMS DEPT. OF COMPUTER ENGINEERING ERKUT ERDEM. Mergesort. Feb. 27, 2014

Differential Polynomials

Chapter 4: Root Finding

The Geometry of Logit and Probit

Chapter 12. Ordinary Differential Equation Boundary Value (BV) Problems

Computing Correlated Equilibria in Multi-Player Games

inv lve a journal of mathematics 2008 Vol. 1, No. 1 Divisibility of class numbers of imaginary quadratic function fields

Report on Image warping

CALCULUS CLASSROOM CAPSULES

2.29 Numerical Fluid Mechanics

Smarandache-Zero Divisors in Group Rings

Speeding up Computation of Scalar Multiplication in Elliptic Curve Cryptosystem

Min Cut, Fast Cut, Polynomial Identities

5 The Rational Canonical Form

There are two approaches to Hensel lftng. Lnear lftng starts wth polynomals f = f (0) and teratvely constructs polynomals f () such that ()f () f (?)

The Ramanujan-Nagell Theorem: Understanding the Proof By Spencer De Chenne

NOTES ON SIMPLIFICATION OF MATRICES

Case A. P k = Ni ( 2L i k 1 ) + (# big cells) 10d 2 P k.

Bézier curves. Michael S. Floater. September 10, These notes provide an introduction to Bézier curves. i=0

Instance-Based Learning (a.k.a. memory-based learning) Part I: Nearest Neighbor Classification

Complex Numbers. x = B B 2 4AC 2A. or x = x = 2 ± 4 4 (1) (5) 2 (1)

Chapter Newton s Method

Algebraic properties of polynomial iterates

Calculation of time complexity (3%)

Fast Arithmetics in Artin-Schreier Towers over Finite Fields

NUMERICAL DIFFERENTIATION

find (x): given element x, return the canonical element of the set containing x;

Lecture 4: Universal Hash Functions/Streaming Cont d

From the Euclidean Algorithm for Solving a Key Equation for Dual Reed Solomon Codes to the Berlekamp-Massey Algorithm

Lecture Torsion Properties for Line Segments and Computational Scheme for Piecewise Straight Section Calculations

6.842 Randomness and Computation February 18, Lecture 4

Learning Theory: Lecture Notes

Finding Dense Subgraphs in G(n, 1/2)

Fast Variants of RSA

Chapter 6. BCH Codes

Line Drawing and Clipping Week 1, Lecture 2

arxiv: v1 [math.co] 12 Sep 2014

A summation on Bernoulli numbers

On the irreducibility of a truncated binomial expansion

UNIT 4 EXTENDING THE NUMBER SYSTEM Lesson 3: Operating with Complex Numbers Instruction

Singular Value Decomposition: Theory and Applications

n α j x j = 0 j=1 has a nontrivial solution. Here A is the n k matrix whose jth column is the vector for all t j=0

Transcription:

Advanced Algebrac Algorthms on Integers and Polynomals Analyss of Algorthms Prepared by John Ref, Ph.D.

Integer and Polynomal Computatons a) Newton Iteraton: applcaton to dvson b) Evaluaton and Interpolaton va Chnese Remanderng Man Lecture Materal: Algorthms on Integers Advanced Lecture Materal: Extenson of Algorthms to Polynomals

Taylor Expanson (x-x 0) f (x) = f (x 0) + (x - x 0) f ' (x 0) + f " (x 0) +...

Taylor Expanson (cont d) To fnd root f(x), use Newton Iteraton: x + 1 = x - f (x ) f '(x ) Example: To fnd recprocal of x choose fnd root f ( y) = 1 1 y = x f ( y ) y 1= y y ( y x) + f '( y ) = 1 xy

Applcaton of Newton Iteraton to Recprocal of an Integer Input nteger x, accuracy bound k Intalze f x has n bts y 0 = n for =1 to k do y y ( y x) + 1 1 output yk where 1 yk x proof let error ε = 1 y x k k then ε = 1 y x = 1 xy ( y x) k + 1 k + 1 k k k k = ( ε ) = ( ε ) = snce ε k 0 0 k 1

Applcaton of Newton Iteraton to Recprocal of an Integer (cont d) Theorem Integer Recprocal can be computed to accuracy -n n O(log n) nteger mults and addtons.

Steven Cooks s Improvement (Hs Harvard Ph.D. Thess) Key Trck: Snce we need only compute y k up to k+1 bt accuracy of error on kth stage Total Tme Cost log n k = 0 1 yk x c M O M n k + 1 ( ) ( ( )) k Where M(n) s tme cost to multply two n bt ntegers 1

Other Applcatons of Newton Iteratons on Integers O(M(n)) tme algorthms: Quotent + dvsor of nteger dvson Square root Sn, cosne, etc. Used n practce!

Advanced Topc: Extenson to Polynomal Recprocal Defnton of Polynomal Recprocal Recprocal ( P( x)) = n x P( x) " # = polynomal r(x) where r x p x x x n ( ) ( ) = + ε ( ) and ε(x) has degree < n-1

Algorthm: Recprocal (P(x)) Input polynomal P( x) n 1 = a x = 0 degree n-1, n s power of 1 [1] f n = 1 then return else a 1 1 1 (3/) n 1 1 n 0 [] r(x) Recprocal ( P( x)) where P( x) = ax [3] Rx ( ) r( xx ) r( x) Px ( ) [4] return r( x) = Rx ( ) x n 1 = n/ n

Proof of the Recprocal Algorthm Theorem: The Algorthm Correctly Computes Recprocal(P(x)) Proof by nducton bass n = 1 P( x) = a so r( x) = 0 1 a 0 n 1 nductve step let P( x) = P ( x) x + P ( x) n n where deg ( P1 ) = 1, deg ( P ) 1

Proof Algorthm Computes Recprocal (P(x)) (cont d) By nducton hypothess, f r ( x) = recprocal ( P ( x)) then 1 1 r ( x) P ( x) = x + ε ( x) n 1 1 1 n where ε1( x) has degree < 1

Proof Algorthm Computes Recprocal (P(x)) (cont d) At lne [3] we compute R( x) r ( x) x r ( x) P( x) (3/ ) n 1 1 n 1 snce P( x) = P ( x) x + P ( x) P( x) R( x) = r ( x) P ( x) x + r ( x) P ( x) x n (3/ ) n 1 1 1 n # $ % r1 ( x) p1 ( x) x + r1 ( x) p( x) & ' (

Proof Algorthm Computes Recprocal (P(x)) (cont d) n Substtutng x + ε1(x) for r1 ( x) p1 ( x), we get n 3n 4 % & R( x) p( x) = x ' ε1( x) x + r1 ( x) p( x) ( ) * 3n 4 n 4 = x 0( x ) R( x) But r( x) = so x n # $ r x p x x o x n n ( ) ( ) = ( )

Modular Arthmetc Assume relatvely prme P 0, P 1,, P k-1 Let p k 1 = = 0 p gven x, 0 < x < p x # x x ( 1 1 0,..., k-1) where x = x mod p for = 0,..., k -1

Applcatons to Arthmetc Compute u op v by computng for =0,...,k-1 w = u op v mod p where u = u mod p v = v mod p op {+, -, } But doesn t extend to dvson (overflow problems)

Super Modul Computaton Input p 0, p 1,, p k-1, where p < b Output Super modular Tree:

Super Modul Computaton (cont d) Tme Cost log k = 0 = k ( ) M b OM ( ( kb)log k)

Algorthm Resdue Computaton Input k 1 x, 0 x < P = P = 0 Output x 0, x 1,, x k-1, when x =x mod P =0, and k-1 Recursve algorthm [1] compute quotent and remanders: 1 1 1 1 ( k 1)/ x = q v + r, v = P = 0 k 1 x = q v + r, v = P ( k 1) = + 1

Algorthm Resdue Computaton (cont d) [] recursvely compute ( k 1) (.1) r1 mod P for = 0,..., ( k 1) (.) r mod P for = + 1,..., k 1 [3] output for = 0, 1,, k-1 x mod P " r1 mod P for $ = % $ r mod P for > $& ( k 1) ( k 1)

Tme Cost for Resdue Computaton Let D(n) = tme cost for nteger dvson = O(M(n)) Total Tme for nput sze n = k b! n " T ( n) = T # $ + kd( b) + O( n) % &! n " T # $ + O( M ( n)) % & O( M ( n)log n)

Proof of Algorthm for Resdue Computaton Idea of Proof of algorthm Uses fact: f x = q v + r and v mod P = 0, then X mod P = r mod P

Advanced Topc: Resdue Computaton on Polynomals Input modul P 0 (x), P 1 (x),, P k-1 (x) assume each degree < d and relatvely prme Algorthm uses smlar Super modular Tree tre, but usng polynomals rather than ntegers

Advanced Topc: Resdue Computaton on Polynomals (cont d) Output for =0,, k-1 Q (x) = Q(x) mod P (x) Q(x) has degree < kd Theorem The Resdue Computaton can be done n tme O(M(n) log n) where n = k d Proof Idea use same algorthm as n nteger case

Advanced Topc: Multpont Evaluaton of Polynomals by Resdue Computaton Input polynomal f(x) degree n-1 and ponts x 0, x 1,, x n-1 [1] for =0,, n-1 let P (x) = (x-x ) [] By Resdue Algorthm Computer for =0,, n-1 f(x ) = f(x) mod P (x) [3] output f(x 0 ),, f(x n-1 ) Tme Cost O(M(n) log n), = O(n(log n) )

Polynomal Interpolaton Input evaluaton ponts 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

Polynomal Interpolaton (cont d) Interpolaton formula: Where n 1 = P( x) y a ( x x ) k k k = 0 k a k = k 1 ( x x ) k

Proof of Polynomal Interpolaton Proof uses denttes: a k ( x x) mod( x xk) = 1 k a k ( x x) mod( x xj) = 0 for j k k

Usng Chnese Remanderng for Integer Interpolaton Input relatvely prme P 0, P 1,, P n-1 and y {0, P -1 } for =0,,n-1 Problem compute y < P 0 P 1 P n-1 s.t. y = y mod P =0,, n-1

Usng Chnese Remanderng for Integer Interpolaton Generalzed Interpolaton Formula: n 1 y y a P = k k k = 0 k Where proof a k = k s, k and s P P 1, k = ( ) mod k # $ " 1 & a k P ' mod Pj = % ( k ) * 0 j = k j k

Advanced Topc: Precondtoned Interpolaton Precondtoned Case assumes coeffcents {a k k=0,, n-1} precomputed Use Dvde & Conquer n 1 y y a P = k k k = 0 k # ( n 1)/ $ # $ n 1 n 1 n 1 = % ykak P & + % ykak P & k = 0 k ( n 1) k = + 1 k % & % & ' = 0 ( ' = 0 (

Precondtoned Interpolaton (cont d) # % $ & = ) * % & ( n 1)/ n 1 ( n 1) ' ( P % yka k P & + = 0, ( n 1) k = + 1 k % ( n 1) = + 1 & -. ' ( # n 1 ( n 1)/ ( n 1)/ $ + ) P * % ykak P & ( n 1) ) % & k = 0 = + 1 k + * %, - = 0 &.

Tme Cost for Precondtoned Interpolaton! n "! n " T ( n) = T # $ + M # $ % & % & = O( M ( n)log n) Assumng {a 0,, a n-1 } precomputed

Precomputaton of {a 0,, a n-1 } 1) Compute P n 1 = P = 0 ) Compute b k where b k P k = P mod (P k ) by Resdue Computaton O(M(n) log n) 3) Compute a k = (b k ) -1 mod P k by Extended GCD algorthm

Proof of Precomputaton of {a 0,, a n-1 } proof snce b P = P mod (P ) k k k k k k then P = d (P ) + b P so P = d P + b so b k = k k P mod P k k k

Precomputaton of {a 0,, a n-1 } for Polynomal Interpolatons Here P = (x-x ) for =0,, n-1 n-1 Q(x) b k = where Q(x)= (x-x j) (x - x ) k Q(x) - Q(x ) reduces to multpont evaluaton of dervatve of Q(x) O(M(n) log n) tme! j=0 k = snce Q(x k ) = 0 (x - x k ) = d Q(x) dx x = x k

Concluson Polynomal and Integer Computatons use smlar dvde and conquer technques to solve: 1. Multplcaton. Dvson 3. Interpolaton and evaluaton Open Problem Reduce from tme O(M(n)log n) to O(M(n))

Newton Iteraton and Polynomal Computaton Analyss of Algorthms Prepared by John Ref, Ph.D.