Loading...

PPT – Introduction to Algorithms PowerPoint presentation | free to download - id: 70d0cb-OTFhN

The Adobe Flash plugin is needed to view this content

Introduction to Algorithms

- Polynomials and the FFT
- My T. Thai _at_ UF

Polynomials

- A polynomial in the variable x
- Polynomial addition
- Polynomial multiplication
- where

Representing polynomials

- A coefficient representation of a polynomial

d of degree bound n is a

vector of coefficients - Horners rule to compute A(x0)
- Time O(n)
- Given a , b
- Sum c a b, takes O(n) time
- Product c (convolution of a and b),

takes O(n2) time

Representing polynomials

- A point-value representation of a polynomial A(x)

of degree-bound n is a set of n point-value pairs

d - All of the xk are distinct

Proof

Da y D

gt a D-1y

Vandermonde matrix

Operations in point-value representation

- A
- B
- Addition
- C
- Multiplication
- Extend A, B to 2n points
- Product

Fast multiplication of polynomials in coefficient

form

- Evaluation coefficient representation ?

point-value representation - Interpolation point-value representation

?coefficient form of a polynomial

Compute evaluation and interpolation

- Evaluation using Horner method takes O(n2) gt

not good - Interpolation computing inversion of Vandermonde

matrix takes O(n3) time gt not good - How to complete evaluation and interpolation in

O(n log n) time? - Choose evaluation points complex roots of unity
- Use Discrete Fourier Transform for evaluation
- Use inverse Discrete Fourier Transform for

interpolation

Complex roots of unity

- A complex nth root of unity is a complex number

such that - There are exactly n complex nth roots of unity
- Principal nth root of unity
- All other complex nth roots of
- unity are powers of

Properties of unitys Complex roots

- Proof

Halving lemma

- Proof
- Cancellation lemma

Summation lemma

- Proof

- Note
- k is not divisible by n
- only when k
- is divisible by n

Discrete Fourier Transform

- Given
- The values of A at evaluation points
- Vector is

discrete Fourier transform (DFT) of the

coefficient vector d

. Denote

Fast Fourier Transform

- Divide A into two polynomials based on the

even-indexed and odd-indexed coefficients - Combine
- Evaluation points of A0 and A1
- are actually the n/2th roots of unity

Fast Fourier Transform

- Time

Inversion of Vandermonde matrix

- Proof

Interpolation at the complex roots of unity

- Compute by modifying FFT algorithm
- Switch the roles of a and y
- Replace
- Divide each element by n

FFT and Polynomial mutiplication

Efficient FFT implementations

- Line 10 12 change the loop to compute

only once storing it in t ( Butterfly operation)

Butterfly operation

Structure of RECURSIVE-FFT

- Each RECURSIVE-FFT invocation makes two recursive

calls - Arrange the elements of a into the order in which

they appear in the leaves ( take log n for each

element) - Compute bottom up

An iterative FFT implementation

Time

A parallel FFT circuit