Live data from Hacker News

Matrix Multiplication

matrixmultiplication.xyz

131–135 of 135 posts

Re: Matrix Multiplication

#131
post #87
post #85

Earlier quoted context omitted.

To back up the parent, unfortunately, the audience is not always qualified to judge the quality of your work - for the simple reason that they have no idea what they are missing! What they are missing from your explanation is "why". Your animation shows how to multiply two matrices, and anyone confused about the mechanics of doing that might find it helpful. But the actual mechanics are not of much use if you don't k…

I totally acknowledge that it is missing the "why", I knew that from the beginning. The widget I built simply answers the "how". It's a very focused tool, and this kind of tool may be very useful in itself. It's a tool to be used in the context of other tools, like books and courses. Your ordinary calculator never answers the why question. And if the audience, who includes both students and teachers, isn't qualified…

> And if the audience, who includes both students and teachers, isn't qualified to judge the quality of the work, who exactly is?

Again, it is very unfortunate, but on the average, high school teachers wouldn't be.

For starters, linear algebra (where multiplication belongs) simply isn't taught at high-school level. It is not in the standard math curriculum in any state. Bits and pieces of linear algebra, like teaching matrix multiplication alone, simply don't belong in the high school curriculum.

For that matter, too many high school instructors either don't have deep enough knowledge of linear algebra themselves, or if they do, they don't have enough experience or expertise in teaching this subject - simply because it is not a part of the curriculum.

To compound the problem, too often we don't teach math educators well enough. The math requirements for math teachers are often significantly lower than for math majors, and many don't get to see too many facets of mathematics.

To answer your question: matrix multiplication belongs in a university-level linear algebra course. Our system is so perverse that the version taught to non-math majors is missing most of the explanations, and even the math majors don't really learn the linear algebra until their second (or even third) year.

So here's my opinion:

The instructors qualified to judge linear algebra instructional materials would be people involved in teaching linear algebra courses at a college level - the professors, TA's, and people running help sessions in universities.

The students would be qualified to judge in retrospect, once they have themselves learned the material beyond the definition.

>On a side note, it's disgusting [...] how hackernews threads are so harsh and negative. [...] If hackernews discussions are good judges of quality [...] this world sucks.

Don't take HN threads as judges of quality - you have seen yourself that they are not. Yes, they are endless sources of critique, and some of the critique is valid and useful. Things people here talk about may succeed in spite of the flaws, but it doesn't mean they are flawless.

And it's great! This thread alone can give you many ideas on where to go from here if you like making educational props like this one - and how to improve what you have done. Treat this thread as a feature request, as a todo-list, as a bug report. You have just got yourself a small army of through beta-testers, who were kind enough to submit detailed reports (with links and examples!). Leverage that.

If you need praise: you are a talented programmer, who can create great visualizations that can help many people get a deeper understanding of things that you have mastered. And the critique is here because of this potential - because you really, really, really can do better.

>I totally acknowledge that it is missing the "why", I knew that from the beginning. The widget I built simply answers the "how".

"How" what?

How humans multiply matrices? Certainly not, I don't cut out one matrix and put it on top of the other. And, to be frank, if I need to multiply two matrices, I either use a computer algebra system (or code it up).

How computers multiply matrices? Software like MATLAB or BLAS would use more complicated algorithms which perform faster (Karatsuba, Strassen, whatever).

In the end, your tool is just a visual mnemonic for a definition. It's a SOHCAHTOA for matrices. And really do think we don't need more of that in education.

> Your ordinary calculator never answers the why question.

That's why there should be way more caution in using calculators in classrooms than is currently exercised. The current way of things is horrendous, but doesn't have to be. I have designed Calculus labs with MATLAB in which, I hope, the computer is not doing anything that the students could do by hand (given a lot of time). Done this way, calculators and computers become tools which aid understanding.

Anyway, regardless of what the motivation of others here was, here is where I'm coming from:

I've taught linear algebra help sessions where by the middle of the semester the students could multiply, row-reduce, invert matrices without having a clue what they are doing. They could put a bunch of vectors in a matrix and do - what to them was - some number magic to check for linear dependence.

I would draw them two arrows on the board pointing in different directions, and ask them a simple question - are these vectors linearly independent or not? They would be thoroughly lost.

That's the state of linear algebra education in the US. We are teaching people mechanical operations that computers do better.

There are better approaches! Linear Algebra Done Right (S. Axler), for example, is one of the few books that justifies the definition of matrix multiplication. Practical Linear Algebra does everything visually, and is suitable for beginners. But the first text is only taught to math majors, and the second one is not widely used.

In any case, I am highly opposed to teaching the mechanics an operation, because with a good understanding, people will come up with the mechanics themselves.

You are an example of this. Having an understanding of the operation allowed you to come up with a visualization. But the visualization, in my opinion, doesn't set one on a path to develop a similar understanding. And this is where your work can be improved.

For instance, take this: https://betterexplained.com/articles/matrix-multiplication/ https://betterexplained.com/articles/linear-algebra-guide/

Is this a perfect explanation? Maybe not, and it's not animated. But the author tries to pass on the way to get a better understanding, a new angle on how to understand the operations being done.

Would doing things like that with an animation be challenging? Certainly. But don't blame the audience for having a high expectation of what you can do.

Re: Matrix Multiplication

#132
post #128

Earlier quoted context omitted.

But surely these sort of meaningless examples with randomized numbers like at the site aren't that useful? I mean, a "real-world" example of matrix multiplication would be having a proper translation or rotation matrix and then visualizing how it maps a point to its image.

That demonstrates multiplication of a matrix with a vector which is being rotated, but multiplication of two matrices corresponds to composition of the corresponding operators. This is actually pretty instructive. For instance, rotations in three-dimensional space do not commute in general; hence neither does matrix multiplication.

Technically matrix-vector multiplication is just a special case of matrix-matrix-multiplication, but I take your point. Indeed it would be illuminating to see how exactly matrix multiplication composes two transformations.

Re: Matrix Multiplication

#133

This is a cool example of what Bret Victor calls an "Explorable Explanation" [0]. That said, I feel that it's more important to understand how and why matrix multiplication corresponds to a composition of linear transformations than learning the actual mechanics of doing the computation. You can get good at matrix multiplication without knowing what is going on. I view that as a less valuable activity than learning a…

Is there something like this regarding homogeneous coordinates and the projective plane? It's strange. Somehow I have now problems whatsoever regarding the use of 4-component vectors. As long as the z component stays one, I'm all set. But lately I'm trying to understand the construction of projection matrices and how to apply the knowledge of homogeneous coordinates, for example shadow mapping. Parallel lines suddenl…

Homogenous coordinates have accrued really overcomplicated language around the very simple idea that something appears half as large twice as far away.

Re: Matrix Multiplication

#134

This is a cool example of what Bret Victor calls an "Explorable Explanation" [0]. That said, I feel that it's more important to understand how and why matrix multiplication corresponds to a composition of linear transformations than learning the actual mechanics of doing the computation. You can get good at matrix multiplication without knowing what is going on. I view that as a less valuable activity than learning a…

Is there something like this regarding homogeneous coordinates and the projective plane? It's strange. Somehow I have now problems whatsoever regarding the use of 4-component vectors. As long as the z component stays one, I'm all set. But lately I'm trying to understand the construction of projection matrices and how to apply the knowledge of homogeneous coordinates, for example shadow mapping. Parallel lines suddenl…

Not sure if you already are aware, but you didn't use the term, so I figured it might help to point out that what you are talking about is projective geometry. I'm not sure of any good texts, though it sounds like you might want one more focused on graphics than projective geometry purely in the abstract.

Re: Matrix Multiplication

#135
post #88
post #82

It's easier to think of matrix multiplication by computing the matrix elements, which means reducing the problem to NM vector dot products. To get the element of the result matrix at position (n,m), compute the inner product , where r_n is the nth row vector of the left matrix and c_m is the mth column vector of the right matrix. Once you try it, you'll see that it's also much easier to visualize than this strange, u…

Nope, won't ditch the domain. I'd recommend you ditch that type of speech.

I'm sorry if my words upset you. That said, it would be a shame to tell someone off if they bring up a good point (however brash). I used to teach this stuff, and I can tell you many of my students would end up being more confused with your visualization. I hope you can see that you've assumed some responsibility. That's all I can hope.
Post reply on HN