CS6505 Computability, Algorithms, and Complexity
Spring 2010
GTKorea MSCS Program Practice questions for ﬁnal examination
Topics:
•
FFT.
•
Maximum ﬂow.
•
Matchings in bipartite graphs.
•
NPCompleteness.
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 degreebound
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
degree1 polynomials together to get
P
(
x
). We can do this via a recursive
algorithm using the FFTmultiply 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
=
FFTMULTIPLY
(
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
FFTMULTIPLY
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