Timmy is now given two matrices to multiply using the schoolbook algorithm. Which complexity best describes the process?
This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.
First, we notice that the output vector consists of n 2 entries, each of which is a dot product of two vectors of n components.
Since computing the dot product of two vectors require summing over all n corresponding pairs of components, this task is O ( n ) .
Doing an O ( n ) task O ( n 2 ) times takes time in O ( n 3 )
Actually, one can use Strassen's Algorithm for faster multiplication.