Why is matrix multiplication defined the way it is?
When I first learned about it, the formula seemed too complicated and totally unintuitive! I wondered, why not just multiply elements at the same position together?
💡 Let me explain why! 💡
First, let's see how to even make sense of matrix multiplication!
The elements of the product are calculated by multiplying rows of 𝐴 with columns of 𝐵.
It is not trivial at all why this is the way. 🤔
To understand, let's talk about what matrices really are!
Matrices are actually just representations of 𝑙𝑖𝑛𝑒𝑎𝑟 𝑡𝑟𝑎𝑛𝑠𝑓𝑜𝑟𝑚𝑎𝑡𝑖𝑜𝑛𝑠: mappings between vector spaces that are interchangeable with linear operations.
Let's dig a bit deeper to see why are matrices and linear transformations are basically the same!
As you probably know, every vector space has a basis, that can be used to express every vector uniquely as their linear combination.
The simplest example is probably the standard basis in the 𝑛-dimensional real Euclidean space.
(Or, with less fancy words, in 𝐑ⁿ, where 𝐑 denotes the set of real numbers.)
Why is this good for us? 🤔
💡 Because a linear transformation is determined by how it behaves on basis vectors! 💡
If we know the image of the basis vectors, we can calculate the image of every vector, as I show below.
Because the image of a basis vector is just another vector in our vector space, it can also be expressed as the basis vectors' linear combination.
💡 These coefficients are the elements of the transformation's matrix! 💡
(The image of 𝑗-th basis gives the 𝑗-th column.)
So, let's recap!
For any linear transformation, there is a matrix such that the transformation itself corresponds to the multiplication with that matrix.
What is the equivalent of matrix multiplication in the language of linear transformations?
Function composition!
(Keep in mind that a linear transformation is a function, just mapping vectors to vectors.)
💡 Multiplication of matrices is just the composition of the corresponding linear transforms!💡
Let's check this by doing some simple algebra!
(I am using the results of the earlier calculations here, feel free to revisit them.)
Basically, we are done.
Although this explanation involved some algebra, I hope that it made things clearer! (Although, algebra can sometimes overcomplicate the situation.)
What topic shall I explain next? Thinking about the Law of Large Numbers, the most commonly misunderstood mathematical concept of all time.
What do you think?
• • •
Missing some Tweet in this thread? You can try to
force a refresh
If you are building a product, chances are you severely underestimate the importance of idea validation. (Especially if you are a developer.)
Key business assumptions can flop because you fail to look at different angles.
What are some basic questions to ask?
🧵 A thread. 🧵
𝐀𝐦 𝐈 𝐬𝐨𝐥𝐯𝐢𝐧𝐠 𝐚𝐧 𝐞𝐱𝐢𝐬𝐭𝐢𝐧𝐠 𝐩𝐫𝐨𝐛𝐥𝐞𝐦?
Often, the problem is not important enough to justify the existence of a solution. This is the most basic trap to fall for: there is no market need for the product.
Take a look at the top 20 reasons why startups fail by @CBinsights. The number 1 is no market need, causing around 43% percent of failures.