
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

CMSC878R/AMSC698R Homework 1
This is similar to the simple example given in class. The goal is to develop fast algorithms for the
following matrix-vector product
v = Au, (1)
where
vi =
N X
j=
uj (xi − xj )
n , j = 1, ..., N, (2)
and
0 (x 1 − x 2 ) n (x 1 − x 3 ) n ... (x 1 − xN ) n
(x 2 − x 1 )
n 0 (x 2 − x 3 )
n ... (x 2 − xN )
n
(x 3 − x 1 )
n (x 3 − x 2 )
n 0 ... (x 3 − xN )
n
(xN − x 1 )
n (xN − x 2 )
n (xN − x 3 )
n ... 0
, u =
u 1
u 2
u 3
...
uN
, v =
v 1
v 2
v 3
...
vN
Here x 1 , ..., xN , u 1 , ..., uN , are given. The matrix dimension N > 0 , and the power, n > 0 , are given
(fixed) positive integers.
“Fast” method. Use Matlab. Be sure that you can vary x 1 , ..., xN , and u 1 , ..., uN.
maximum error between the straightforward and the “Fast” method for n = 5 and N varying
between 10
2 and 10
3 .
n = 5 and N varying between 10 2 and 10 3 for the straightforward method, and with N varying
between 10 2 and 10 4 for the “Fast” method. Make the plots log-log. Also plot lines corresponding
to linear and quadratic dependences of the CPU time on N and compare with your computational
results.
Hints
(a + b)
n = a
n
μ n
1
a
n− 1 b +
μ n
2
a
n− 2 b
2
n X
k=
μ n
k
a
n−k b
k , (4)
where the binomial coefficients are
μ n
k
n(n − 1)...(n − k + 1)
1 · 2 · ... · k
n!
(n − k)!k!