1 Mathematical Algorithms 1. Arithmetic, (Pseudo) Random Numbers and all that 2. Evaluation & Multiplication of Polynomials I 3. Multiplication of Large Integers 4. Strassen's algorithm for large Matrices 5. Zeros of Polynomials: Bisection vs Newton's method 6. Evaluation & Multiplication of Polynomials II 7. Fast Fourier Transforms 8. Interpolation/splines etc. 9. SHOULD BE A SEPARATE COURSE!!! Ari’s class: PHO 211 – 4/13/06
14
Embed
1 Mathematical Algorithms 1. Arithmetic, (Pseudo) Random Numbers and all that 2. Evaluation & Multiplication of Polynomials I 3. Multiplication of Large.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Mathematical Algorithms
1. Arithmetic, (Pseudo) Random Numbers and all that2. Evaluation & Multiplication of Polynomials I3. Multiplication of Large Integers4. Strassen's algorithm for large Matrices5. Zeros of Polynomials: Bisection vs Newton's method6. Evaluation & Multiplication of Polynomials II7. Fast Fourier Transforms 8. Interpolation/splines etc.9. SHOULD BE A SEPARATE COURSE!!!
Ari’s class: PHO 211 – 4/13/06
2
Adding, Multiplying and Evaluating Polynomials
Why are polynomials so interesting? PN(x) = a0 + a1 x + a2 x2 aN xN
Fit data di = PN(xi) by picking ai’s
Integer arithmetic base B is polynomial with x = B: e.g Integer decimal base (B=10)
PN-1 (10) = a0 + a1 10 + a2 102 aN-1 10N-1
Fourier transform is PN-1(xk) with xk=kN= exp[i k 2 /N]
yk ´ l eik n 2 /N an
ETC
3
Evaluation of p(x) = a0 + a1 x + ... + aN xN
Method 1: Compute x, x2, x3, ...xN with N-1-mults plus N mults and N adds
or 2N-1 mults and N adds
Horner’s Method 2: a0 + x(a1 + x (a2 + x (a3 + .a4 x) ) ) for N = 4
N adds and N multiplies! Evaluating it at N points is O(N2)
Special case: p(x) = xN do in Log(N) steps! Consider N in binary base eg.100111001101.
Cal x, x2, x4, x8.... by repeated squaring and then multiply
to get xN in O(Log2(N)) steps.
4
Polynomial Multiplication P(x) = a0 + a1 x + ... + aN xN and Q(x) = b0 + b1 x + ... + b