Question: roject Activity 8 . 4 . We introduce a little notation to help us describe the efficiency of our cal - culations. We won t

roject Activity 8.4. We introduce a little notation to help us describe the efficiency of our cal-
culations. We wont be formal with this notation, rather work with it in an informal way. Big O
(the letter O) notation is used to describe the complexity of an algorithm. Generally speaking,
in computer science big O notation can be used to describe the run time of an algorithm, the space
used by the algorithm, or the number of computations required. The letter O is used because the
behavior described is also called the order. Big O measures the asymptotic time of an algorithm, not
its exact time. For example, if it takes 6n2 n +8 steps to complete an algorithm, then we say that
the algorithm grows at the order of n2(we ignore the constants and the smaller power terms, since
they become insignificant as n increases) and we describe its growth as O(n2). To measure the
efficiency of an algorithm to determine a matrix product, we will measure the number of operations
it takes to calculate the product.
(a) Suppose A and B are n n matrices. Explain why the operation of addition (that is,
calculating A + B) is O(n2).
(b) Suppose A and B are n n matrices. How many multiplications are required to calculate
the matrix product AB? Explain.
Section 8. Matrix Operations 167
(c) The standard algorithm for calculating a matrix product of two n n matrices requires n3
multiplications and a number of additions. Since additions are much less costly in terms
of operations, the standard matrix product is O(n3). We wont show it here, but using
Strassens algorithm on a product of 2m 2m matrices is O(nlog2(7)), where n =2m.
That means that Strassens algorithm applied to an n n matrix (where n is a power of
2) requires approximately nlog2(7) multiplications. We use this to analyze situations to
determine when Strassens algorithm is computationally more efficient than the standard
algorithm.
i. Suppose A and B are 55 matrices. Determine the number of multiplications re-
quired to calculate the matrix product AB using the standard matrix product. Then
determine the approximate number of multiplications required to calculate the matrix
product AB using Strassens algorithm. Which is more efficient? (Remember, we
can only apply Strassens algorithm to square matrices whose sizes are powers of 2.)
ii. Repeat part i. with 125125 matrices. Which method is more efficient?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!