# Binder1 - CS6505 Computability Algorithms and Complexity...

This preview shows pages 1–3. Sign up to view the full content.

CS6505 Computability, Algorithms, and Complexity Spring 2010 GT-Korea MSCS Program Practice questions for ﬁnal examination Topics: FFT. Maximum ﬂow. Matchings in bipartite graphs. NP-Completeness. 1. Given a list of values z 0 ,z 1 ,...,z n - 1 (possibly with repetitions), show how to ﬁnd the coeﬃcients of a polynomial P ( x ) of degree-bound n + 1 that has zeros only at z 0 ,z 1 ,...,z n - 1 . Your algorithm should run in time O ( n log 2 n ). (Hint: The polynomial P ( x ) has a zero at z j if and only if P ( x ) is a multiple of ( x - z j ).) Solution: From the hint, we see that P ( x ) is a multiple of ( x - z i ) for each root z i . The only polynomial (of degree n ) that satisﬁes this constraint is P ( x ) = n - 1 Y i =0 ( x - z i ) = ( x - z 0 ) ... ( x - z n - 1 ) So we need to multiply these n degree-1 polynomials together to get P ( x ). We can do this via a recursive algorithm using the FFT-multiply algorithm as a primitive to multiply two polynomials at a time. The following algorithm takes a list of polynomials and multiplies them. PROD ( p 1 ,p 2 ,...,p N ) if N = 1 return p 1 f = PROD ( p 1 ,...,p N 2 ) g = PROD ( p N 2 +1 ,...,p N ) return h = FFT-MULTIPLY ( f,g ) When PROD is called with input polynomials p 1 ,p 2 ,...,p N then f ( x ) and g ( x ) are polynomials of degree N/ 2 and are computed recursively. The FFT-MULTIPLY procedure takes time O ( N 2 log( N 2 )) = O ( N log N ). Thus the total number of multiplications performed by PROD is T ( N ) = 2 T ( N/ 2)+ O ( N log N ), the solution to which is T ( N ) = O ( N 2 log N ). 2. For N a power of 2, let ω be a principal N -th root of unity and ω - 1 be its multiplicative inverse. We saw in class that ω - 1 is a principal N -th root of unity as well. Let V ( ω ) be an order N matrix with ω jk as its ( j,k )-th entry for 0 j,k ( N - 1). (The matrix V ( ω ) is called the DFT matrix.) (a) Let X = x 0 x 1 . . . x N - 1 be an N -vector. 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
We saw in class that the algorithm FFTevaluation ( X,ω,N ) produces the matrix-vector product V ( ω ) × X . Given an
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

Binder1 - CS6505 Computability Algorithms and Complexity...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online