Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Is there a formula to calculate the number of multiplications that take place when multiplying 2 matrices? For example

$$\begin{pmatrix}1&2\\3&4\end{pmatrix} \times \begin{pmatrix}5&6\\7&8\end{pmatrix} = \text{8 multiplications and 4 additions} $$

share|improve this question

migrated from mathoverflow.net Sep 5 '13 at 6:51

This question came from our site for professional mathematicians.

1  
There is actually a way to multiply a pair of $2\times2$ matrices doing only 7 multiplications, and finding the minimum number of multiplications for $n\times n is ongoing research. But the number of multiplications required by the straightforward method is not a research question, and research is what this website is about. –  Gerry Myerson Sep 5 '13 at 6:34
add comment

1 Answer 1

Doing a $k\times l$ times $l\times m$ matrix multiplication in the straightforward way, every entry of the result is a scalar product of of two $l$-vectors, which requires $l$ multiplications and $l-1$ additions. Multiply that by the number $km$ of entries of the result (or don't multiply if you have sufficiently many processors to do everything in parallel).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.