Answer to Question 2-2

Question. Suppose that A = [ai, j] and B = [bi, j are two n×n matrices. (Notation A = [ai, j] is just a way of saying that the entry in row i and column j of A is ai, j.) The matrix product C = AB is an n×n matrix defined by C = [ci, j] where ci, j = ∑nk=1ai, kbk, j.

Notice that there are n2 entries of matrix C to compute. Each involves computing a sum of n products of numbers.

Can we argue that computing the product of two n×n matrices requires time Θ(n3) time based on this?

Answer. No. This algorithm does take Θ(n3) time. But it is not at all obvious that there cannot be better algorithms.