Matrix multiplication explained

Matrix multiplication explained

Why is matrix multiplication defined the way it is?

When I first learned about it, the formula seemed too complicated and counter-intuitive! I wondered, why not just multiply elements at the same position together?

Let me explain why!

No alt text provided for this image

First, let's see how to make sense of matrix multiplication!

The elements of the product are calculated by multiplying rows of ?? with columns of ??.

No alt text provided for this image

It is not trivial at all why this is the way. ?? To understand, let's talk about what matrices really are!

Matrices are just representations of linear transformations: mappings between vector spaces that are interchangeable with addition and scalar multiplication.

Let's dig a bit deeper to see why are matrices and linear transformations are (almost) the same!

No alt text provided for this image

The first thing to note is that every vector space has a basis, which can be used to express every vector uniquely as their linear combination.

No alt text provided for this image

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.)

No alt text provided for this image

Why is this good for us? ?? Because a linear transformation is determined by its effect on the basis vectors! ??

If we know the image of the basis vectors, we can calculate the image of every vector, as I show below.

No alt text provided for this image

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.)

No alt text provided for this image

So, let's recap! For any linear transformation, there is a matrix such that the transformation itself corresponds to the multiplication with that matrix.

No alt text provided for this image

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.)

No alt text provided for this image

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.)

No alt text provided for this image

This is why matrix multiplication is defined the way it is.

Having a deep understanding of math will make you a better engineer. I want to help you with this, so I am writing a comprehensive book about the subject.

If you are interested in the details and beauties of math, check out the early access!


要查看或添加评论,请登录

Tivadar Danka的更多文章

  • Math + Escher + Midjourney = ??

    Math + Escher + Midjourney = ??

    Making mathematical art with generative AI I asked Midjourney to imagine some of the most beautiful and famous…

    2 条评论
  • Matrices are graphs

    Matrices are graphs

    The single most undervalued fact of linear algebra: matrices are graphs, and graphs are matrices. Encoding matrices as…

    24 条评论
  • Recursion 101

    Recursion 101

    What is recursion? A concise guide from zero to one. 100% knowledge, 0% fluff.

    2 条评论

社区洞察

其他会员也浏览了