Hacker News new | past | comments | ask | show | jobs | submit login

You actually save additions too.

If you look at Strassens algorithm [1] you see that it splits each matrix in 4 blocks. Naively you can do 8 multiplications of those blocks, as well as 4 matrix additions, and recover the full matrix multiplication.

If T(n) is the number of operations (additions as well as multiplications) for an nxn matrix multiplication, we can write the equation T(n) = 8T(n/2) + 4(n/2)^2. If we solve this, we end up with T(n) ~ n^3, which is of course the time complexity of naive matrix multiplication.

However, with Strassen you end up with 7 smaller matrix multiplications and 18 matrix additions. The equation we get now is T(n) = 7T(n/2) + 18(n/2)^2. We end up with T(n) ~ n^(2.8).

We see that when we save _matrix_ multiplications we eventually end up saving both elementary multiplications _and_ additions.

[1]: https://en.wikipedia.org/wiki/Strassen_algorithm




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: