Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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|cite|improve this question

migrated from Sep 5 '13 at 6:51

This question came from our site for professional mathematicians.

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

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|cite|improve this answer

protected by user26857 Nov 9 '15 at 7:23

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?