Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I actually object a little bit to the claim that matrices are representations of linear transformations. No, matrices are just two-dimensional arrays of numbers. If you then define a specific 'mutliplication' operation on those arrays, and a mapping from linear functions to matrices, it turns out that that multiplication operation is isomorphic to function application. That's neat! But it doesn't mean that that is what matrices are.

If you came up with an isomorphism from matrices to a domain where it made sense to define a different multiplication operation - like maybe placewise multiplication, where

   [a b] * [e f] = [ae bf]
   [c d]   [g h]   [cg dh]
then that would be just as valid, but it wouldn't change what matrices 'are'. In fact, because you know how to map matrices to linear functions, it would let you describe an operation to combine two linear functions in a new way and that might lead to some new insight about linear algebra!

It's like how, in school you were taught that you can't multiply vectors together. Yet, in shader languages, it turns out that it's really useful to be able to multiply two vectors just by multiplying each component ([a,b][c,d]=[ab,cd]), so they define that as a valid operation.



As with most things in mathematics, the varying perspectives on an object and the relationship between those perspectives are more important than what an object is per se, to the point where the idea of what an object "is" per se is often meaningless.

Are the real numbers "actually" Dedekind cuts or equivalence classes of Cauchy sequences? If we prove that both constructions result in isomorphic objects, what difference does it make? Once equivalence has been established, we're free to adopt either perspective as the situation warrants.

Matrices represent linear transformations whether we want them to or not. As someone else pointed out, the operation you've defined is the Hadamard product[1], which is totally valid but doesn't correspond to the composition of linear transformations.

There are other "products", too, like Kronecker product[2] and the Frobenius product[3], each with the own properties, motivations, and relationships to other parts of mathematics. These are neither good nor bad nor anything else — they just are.

I think it was a misstep for the article to be titled What Matrices Are, because the real idea is that when we think of matrices as representing linear functions then the formula for "standard" matrix multiplication corresponds to the composition of linear functions. It's not just some crazy scheme we invented to torture Algebra II students in high school, but a different perspective on the composition operation that has its own advantages and disadvantages relative to other perspectives.

    [1] https://en.wikipedia.org/wiki/Hadamard_product_(matrices)
    [2] https://en.wikipedia.org/wiki/Kronecker_product
    [3] http://planetmath.org/frobeniusproduct


I think I'd be more comfortable with this article making the claim that linear transformation composition is "What matrix multiplication is". Because really, that's a more defensible position. If I weren't treating my matrices as representations of linear functions, I'd really have little reason to define the matrix multiplication operation that we all know and love - it's not a particularly useful operation on a rectangular array in general. So I guess, if you consider 'matrix multiplication' to be part and parcel of matrices, then sure - matrices are linear functions.

And yes, understanding that is very important to motivate high school students. Affine transformations provide a good context for that motivation, as well as a good framework for intuiting noncommutativity of multiplication.


To be honest, I'm not sure what point you're trying to make. It feels like you're over-interpreting the title because the author uses much more precise language in the article.

From the first paragraph, where he explains the purpose of the article:

> The two fundamental facts about matrices is that every matrix represents some linear function, and every linear function is represented by a matrix. Therefore, there is in fact a one-to-one correspondence between matrices and linear functions. We’ll show that multiplying matrices corresponds to composing the functions that they represent.

And later:

> The connection is that matrices are representations of linear transformations, and you can figure out how to write the matrix down by seeing how it acts on a basis.

If there's a meaningful difference between "a matrix is a representation of a linear transformation" and "a matrix can be viewed as a representation of a linear transformation" it seems largely philosophical and, in any case, tangential to the author's stated goal of explaining why matrix "multiplication" is defined the way it is.

Whether or not matrix multiplication is a "particularly useful operation on a rectangular array in general" boils down to a debate about what is or isn't useful to do with a rectangular array. I'll leave that to other folks with stronger opinions on the matter.


What's up, cuz? :)

But, a "matrix" comes with the matrix multiplication we all know and love, right? The word doesn't just mean a 2d array. I think of it as a math term, not a CS data structure. More of a class, if you will, data and operations bound together. Not literally and not always, my analogy is imperfect, but, if you asked someone to perform an inner product on a block of numbers, you'd just confuse people if you said "matrix multiply".


I think it is much more intuitive and powerful to make the reverse reasoning. Linear algebra studies vectors belonging to some vector space and the linear transformations between those spaces. You can then realize that abstract concept with, for instance, ordered 3-tuples of real numbers, in which case 3x3 matrices represent linear mapping between those R^3 vector spaces, in which case we can use it to do physics in a 3D world. But it's misguided to say matrices come "before" abstract linear algebra.


Honestly, the alternative is to teach people component-wise calculations like those in old school (and some new school) GR with a bunch of indices everywhere. As others have pointed out, a 2x2 matrix or a square matrix in general is a nice representation because operations involving them follow basic rules.

For your qualm where people told you "can't" multiply vectors together, what they should have said is "we won't define a multiplication between vectors like we can between scalars" where "we won't" means "we won't for this course." Something I agree that isn't stressed in Math enough in the early years is that it's creation: mathematicians define what they can in order to prove other things, and as long as one can define something that is consistent with other definitions and is logically coherent, it goes. Just like you can define element-wise multiplication, of course it's valid.

Final nitpick: I'd argue an isomorphism between objects A and B is enough to say that A is B, up to some non-isomorphic details, like how they are typeset in an article.


Sure, but "matrix", the word, means just that. What you're talking about would be better referred to as R^4, or R^(2*2).


Set, list, array, these are all words to describe collections of numbers, including an NxM array. But a matrix it's a very specific thing, it is not just an array of numbers, it is a mathematical object with defined mathematical functions applicable to it, as such it does define a set of linear combinations.

Similarly, there is a difference between an N-element set of numbers and an Nth dimensional vector.


Why were you taught that you can't multiply vectors together? Aren't there two ways to "multiply" vectors–dot and cross?


Traditionally, multiplication takes two elements of a set and turns them into another element of that set. The dot product doesn't do that, it takes two vectors and turns them into a scalar.

The cross product only exists in three dimensions. And it's not associative (A×B×C gives a different answer depending which order you do it in), which is another thing multiplication usually satisfies.

There are two other not-quite-multiplication operators that I recall seeing. There's an analog of the cross product in two dimensions: (a,b,0)×(c,d,0) = (0,0,ad-bc), so it can be useful to have an operator (a,b)×(c,d) = ad-bc, again turning two vectors into a scalar.

And if the dot product is defined in terms of matrix multiplication by A·B = AᵀB, then you can also define an operator ABᵀ, turning two vectors into a matrix. These vectors don't even need to have the same length.


> The cross product only exists in three dimensions

While true, the Wedge product is a useful concept that generalizes a cross product to arbitrary dimensions and is used in multivariable calculus for proving various integral theorems in high dimension. Here, generalized Stokes theorems apply despite the cross product not being defined. Admittedly, it isn't really a map on the vector space, but the fact that Stokes theorems still hold makes it pretty darn useful to me.


FYI, in geometric algebra you can truly multiply two vectors and get another element of the geometric algebra out, no matter the dimensionality.


But the product isn't a vector of the same shape as the inputs, so it isn't a vector multiplication. It is tensor multiplication.


To add to the other responses at this level, I want to point out that one form of vector-vector "multiplication"—inner products—corresponds to applying linear functionals, i.e., to linearly mapping a vector space into its underlying scalar field.

So just as every matrix is a representation of a linear transformation of vectors into other vectors, with matrix-vector multiplication corresponding to function application, it is also true that each vector in a vector space represents a linear transformation that turns vectors in the space into a scalar, with vector-vector multiplication in the form of inner products corresponding to function application. The converse is also true: every linear functional on a vector space can be represented by a vector in the space.

This last insight is known (in various forms) as the Riesz representation theorem and holds not only on finite inner-product spaces (i.e., vector spaces on which an inner product is defined) but also on Hilbert spaces (complete inner product spaces, whether finite or infinite). It turns out to be quite powerful.


Well, it actually depends what you've been told about what "multiplication" is. Multiplication should be closed, hence dot product is not a multiplication because the result is not a vector (unless you are using 1-dimensional vectors, sure, but the result is still not a vector.) Wedge (or outer, or cross) product is a delicate issue, because, well, it works as a product but to get it to be actually defined you get the generalisation (exterior algebras) and then they are also not closed (because the exterior algebra is different from the source algebra and is only the same dimension in a few cases)


Surely "multiplication" is a scalar operation and that's why you need to define dot/cross vector products. You can multiply vectors, by scalars.


The product you have described is known as the Hadamard product.


Exactly. There's no reason we couldn't use, say, R^4 for the same purposes, but a 2x2 matrix is just a more convenient structure.


You can do the arithmetic any way you like, I suppose, but there is definitely a reason to always think of a matrix as a rectangle, and the article went to some length to explain why. A 2x2 is not 4 independent real numbers thrown into a box, it is a set of vectors that describe a linear space in relation to the "world", and it doesn't really make sense to describe a linear space any other way than by writing down the vectors that make up the axes of that space.

This is what a 3x3 matrix is: https://dl.dropboxusercontent.com/u/364079/WhatAMatrixIs.png

Just one of the many reasons you don't want to use R^4 to describe a matrix is because, for an orthonormal basis, A^-1 == A^T. The inverse and transpose are the same thing. That doesn't work in any arrangement except a rectangle.

(edited for spelling)




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

Search: