W08/CS5592
TEST ONE
Design and Analysis of Algorithms
Feb. 27, 2008,
Wednesday,
7:008:15pm
The following are three take home problems
1
Let
A
and
B
be two
n
×
n
matrices. It is well known that direct computing the
product
C
=
AB
needs
θ
(
n
3
) multiplications and additions. Strassen’s algorithm can
do better. The following is the algorithm:
Strassen’s algorithm (A, B,
n
) ;
Step 1.
Divide each matrix into four smaller matrices:
A
=
A
A
A
A
22
21
12
11
and
B
=
B
B
B
B
22
21
12
11
, where
A
ij
and
B
ij
are
n
/2
×
n
/2 matrices.
Step 2.
Compute the following matrices:
P
= (
A
11
+
A
22
)(
B
11
+
B
22
);
Q
= (
A
21
+
A
22
)
B
11
;
R
=
A
11
(
B
12

B
22
);
S
=
A
22
(
B
21

B
11
);
T
= (
A
11
+
A
22
)
B
22
;
U
= (
A
21

A
11
)(
B
11
+
B
12
);
V
= (
A
12

A
22
)(
B
21
+
B
22
);
Step 3.
Compute the following matrices:
C
11
=
P
+
S
–
T
+
V
;
C
12
=
R
+
T
;
C
21
=
Q
+
S
;
C
22
=
P
+
R
–
Q
+
U
;
Step 4.
Output the answer:
AB
=
C
C
C
C
22
21
12
11
.
Please determine the time complexity of the Strassen’s algorithm. You need only to
show the order and you can assume
n
= 2
k
. Also, you need NOT to worry about the
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '05
 Shen
 Algorithms, Divide and conquer algorithm, Strassen, following matrices, A12 B11 B12

Click to edit the document details