0% found this document useful (0 votes)
56 views2 pages

Strassen's Matrix Multiplication Guide

Strassen's matrix multiplication is an algorithm that multiplies matrices more efficiently than naive matrix multiplication. It works by recursively dividing the matrices into smaller sub-matrices, computing products of these sub-matrices using specific formulas, and combining the results to obtain the final product matrix.

Uploaded by

arki27ki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
56 views2 pages

Strassen's Matrix Multiplication Guide

Strassen's matrix multiplication is an algorithm that multiplies matrices more efficiently than naive matrix multiplication. It works by recursively dividing the matrices into smaller sub-matrices, computing products of these sub-matrices using specific formulas, and combining the results to obtain the final product matrix.

Uploaded by

arki27ki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Powered by AI

Bing
Strassen's matrix multiplication is a divide-and-conquer algorithm that
multiplies two matrices of size n x n 1. The algorithm works by recursively
dividing the matrices into smaller sub-matrices, performing matrix operations
on these sub-matrices, and then combining the results to obtain the final
product matrix 1 2.
Here are the steps for Strassen's matrix multiplication:
1. Divide the input matrices A and B into four sub-matrices each of size
n/2 x n/2.
2. Compute seven products of these sub-matrices using the following
formulas:
○ P1 = A11 x (B12 - B22)
○ P2 = (A11 + A12) x B22
○ P3 = (A21 + A22) x B11
○ P4 = A22 x (B21 - B11)
○ P5 = (A11 + A22) x (B11 + B22)
○ P6 = (A12 - A22) x (B21 + B22)
○ P7 = (A11 - A21) x (B11 + B12)
3. Compute the final product matrix C using the following formulas:
○ C11 = P5 + P4 - P2 + P6
○ C12 = P1 + P2
○ C21 = P3 + P4
○ C22 = P5 + P1 - P3 - P7
Here is an example of how Strassen's matrix multiplication works:
Let's say we have two matrices A and B of size 2 x 2:
A = | 1 2 |
| 3 4 |

B = | 5 6 |
| 7 8 |
We can apply the above steps to compute the product matrix C:
4. Divide A and B into four sub-matrices each of size 1 x 1:
A11 = | 1 | B11 = | 5 |
| | | |
A21 = | 3 | B21 = | 7 |
| | | |
A12 = | 2 | B12 = | 6 |
| | | |
A22 = | 4 | B22 = | 8 |
| | | |
Powered by AI
5. Compute the seven products:
P1 = A11 x (B12 - B22) = 1 x (6 - 8) = -2
P2 = (A11 + A12) x B22 = (1 + 2) x 8 = 24
P3 = (A21 + A22) x B11 = (3 + 4) x 5 = 35
P4 = A22 x (B21 - B11) = 4 x (7 - 5) = 8
P5 = (A11 + A22) x (B11 + B22) = (1 + 4) x (5 + 8) = 45
P6 = (A12 - A22) x (B21 + B22) = (2 - 4) x (7 + 8) = -30
P7 = (A11 - A21) x (B11 + B12) = (1 - 3) x (5 + 6) = -16
6. Compute the final product matrix C:
C11 = P5 + P4 - P2 + P6 = 45 + 8 - 24 - 30 = -1
C12 = P1 + P2 = -2 + 24 = 22
C21 = P3 + P4 = 35 + 8 = 43
C22 = P5 + P1 - P3 - P7 = 45 - 2 - 35 + 16 = 24
Therefore, the product matrix C is:
C = | -1 22 |
| 43 24 |
I hope this helps! Let me know if you have any other questions. 😊..

Source(s)
1. Divide and Conquer | Set 5 (Strassen’s Matrix Multiplication)
2. Strassens’s Algorithm for Matrix Multiplication - Topcoder
3. Strassen’s Matrix Multiplication - Online Tutorials Library
4. Strassen's Matrix Multiplication - CodesDope
5. en.wikipedia.org

You might also like