Learning · explorable explanation
Multiplying two 1,024 × 1,024 matrices the school way takes 1,073,741,824 multiplications. Volker Strassen found in 1969 that two 2 × 2 matrices need only 7 products instead of 8. Check the trick on your own numbers, then watch it compound.
Step 1 · guess first
The school method for a 2 × 2 product uses 8 multiplications. Strassen uses 7, a saving of 12.5%. Apply it again inside every block, all the way down to single numbers, for a 1,024 × 1,024 matrix (210, so ten levels). How many times fewer multiplications?
Step 2 · check the trick yourself
Edit the numbers (whole numbers keep the arithmetic exact). Strassen builds seven products M1 to M7 from sums of the entries, then combines them into the four entries of C = A × B. Tap a product to see where it is used, or tap an output to see which products it needs.
The catch: 7 products need 18 additions and subtractions (10 before the products, 8 after) where the school method needs 4. Strassen trades multiplications for additions. That trade matters in step 3.
Step 3 · let it compound
Because the trick works on blocks, it can be used again inside each of the seven products. Pick a matrix size and the block size at which you stop recursing and switch to the school method.
The chart and tiles use the recurrences M(n) = 7·M(n/2) and A(n) = 7·A(n/2) + 18·(n/2)², ending in the school method at your block size. The button runs actual Strassen code (up to 64 × 64), counts the operations it performs, and compares the product with the school method.
Step 4 · the race for the exponent
The school method has ω = 3. Strassen's trick gives log2(7) = 2.807. Reading the input already takes n² steps, so ω cannot be below 2. The chart shows the best upper bounds listed on Wikipedia's timeline. Tap a point or a table row to see what that exponent would mean at your matrix size from step 3, ignoring constant factors.
| Year | Bound on ω | Authors | nω at n |
|---|
These fast algorithms are "galactic": the hidden constant is so large that they only pay off for matrices too big for present-day computers (Wikipedia, citing Iliopoulos 1989 and Robinson 2005). In practice people use Strassen-style methods with a cutoff, like the best setting in step 3, or the school method with good hardware.